diff options
Diffstat (limited to 'packet/bgp.go')
-rw-r--r-- | packet/bgp.go | 4 |
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 ( |