summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-08 15:13:07 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-08 15:13:07 +0900
commit1c982d8336c9d89732e8a481a8c90b3e7e283f6f (patch)
tree60c48bd57d3fb771ddab46a9e9e2b76b7715069b /packet/bgp.go
parent608d09c90e906ed43e9206e903443753f73d80b0 (diff)
server: support multiple route familes per peer
You can configure like the following: [Global] As = 65032 RouterId = "192.168.255.1" [[NeighborList]] NeighborAddress = "10.0.255.1" PeerAs = 65001 [NeighborList.RouteServer] RouteServerClient = true [[NeighborList.AfiSafiList]] AfiSafiName = "ipv4-unicast" [[NeighborList.AfiSafiList]] AfiSafiName = "ipv6-unicast" Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp.go')
-rw-r--r--packet/bgp.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/packet/bgp.go b/packet/bgp.go
index 3a27bce0..1b80e543 100644
--- a/packet/bgp.go
+++ b/packet/bgp.go
@@ -959,6 +959,10 @@ func AfiSafiToRouteFamily(afi uint16, safi uint8) RouteFamily {
return RouteFamily(int(afi)<<16 | int(safi))
}
+func RouteFamilyToAfiSafi(rf RouteFamily) (uint16, uint8) {
+ return uint16(int(rf) >> 16), uint8(int(rf) & 0xff)
+}
+
type RouteFamily int
const (