summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-27 06:58:50 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-27 06:58:50 -0800
commita3c1e53deda9f9834994751382f64827c14a9c32 (patch)
tree7c9504d979ac1afe425d8e57cb8117c389ec8f8c /packet/bgp.go
parenteff70c21375742b44ae5ebfd845dba38d0f3fcfc (diff)
RouteFamily cleanup
RouteFamily is defined in two files. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp.go')
-rw-r--r--packet/bgp.go20
1 files changed, 11 insertions, 9 deletions
diff --git a/packet/bgp.go b/packet/bgp.go
index 1c6c883a..fda524d0 100644
--- a/packet/bgp.go
+++ b/packet/bgp.go
@@ -943,18 +943,20 @@ func (n *RouteTargetMembershipNLRI) SAFI() uint8 {
func (n *RouteTargetMembershipNLRI) Len() int { return 12 }
-func rfshift(afi uint16, safi uint8) int {
- return int(afi)<<16 | int(safi)
+func rfshift(afi uint16, safi uint8) RouteFamily {
+ return RouteFamily (int(afi)<<16 | int(safi))
}
+type RouteFamily int
+
const (
- RF_IPv4_UC = AFI_IP<<16 | SAFI_UNICAST
- RF_IPv6_UC = AFI_IP6<<16 | SAFI_UNICAST
- RF_IPv4_VPN = AFI_IP<<16 | SAFI_MPLS_VPN
- RF_IPv6_VPN = AFI_IP6<<16 | SAFI_MPLS_VPN
- RF_IPv4_MPLS = AFI_IP<<16 | SAFI_MPLS_LABEL
- RF_IPv6_MPLS = AFI_IP6<<16 | SAFI_MPLS_LABEL
- RF_RTC_UC = AFI_IP<<16 | SAFI_ROUTE_TARGET_CONSTRTAINS
+ RF_IPv4_UC RouteFamily = AFI_IP<<16 | SAFI_UNICAST
+ RF_IPv6_UC RouteFamily = AFI_IP6<<16 | SAFI_UNICAST
+ RF_IPv4_VPN RouteFamily = AFI_IP<<16 | SAFI_MPLS_VPN
+ RF_IPv6_VPN RouteFamily = AFI_IP6<<16 | SAFI_MPLS_VPN
+ RF_IPv4_MPLS RouteFamily = AFI_IP<<16 | SAFI_MPLS_LABEL
+ RF_IPv6_MPLS RouteFamily = AFI_IP6<<16 | SAFI_MPLS_LABEL
+ RF_RTC_UC RouteFamily = AFI_IP<<16 | SAFI_ROUTE_TARGET_CONSTRTAINS
)
func routeFamilyPrefix(afi uint16, safi uint8) (prefix AddrPrefixInterface) {