summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-27 07:12:51 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-27 07:12:51 -0800
commitebd6f9a06639df996da8e4570b8c26b664bbbc1a (patch)
treed30505b840eba4d2aaef5d914374154c822bccec /packet/bgp.go
parenta3c1e53deda9f9834994751382f64827c14a9c32 (diff)
packet: BGPCapabiltyCode cleanup
use stringer command. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp.go')
-rw-r--r--packet/bgp.go36
1 files changed, 8 insertions, 28 deletions
diff --git a/packet/bgp.go b/packet/bgp.go
index fda524d0..60502e1a 100644
--- a/packet/bgp.go
+++ b/packet/bgp.go
@@ -56,34 +56,14 @@ type BGPCapabilityCode uint8
const (
BGP_CAP_MULTIPROTOCOL BGPCapabilityCode = 1
- BGP_CAP_ROUTE_REFRESH = 2
- BGP_CAP_CARRYING_LABEL_INFO = 4
- BGP_CAP_GRACEFUL_RESTART = 64
- BGP_CAP_FOUR_OCTET_AS_NUMBER = 65
- BGP_CAP_ENHANCED_ROUTE_REFRESH = 70
- BGP_CAP_ROUTE_REFRESH_CISCO = 128
+ BGP_CAP_ROUTE_REFRESH BGPCapabilityCode = 2
+ BGP_CAP_CARRYING_LABEL_INFO BGPCapabilityCode = 4
+ BGP_CAP_GRACEFUL_RESTART BGPCapabilityCode = 64
+ BGP_CAP_FOUR_OCTET_AS_NUMBER BGPCapabilityCode = 65
+ BGP_CAP_ENHANCED_ROUTE_REFRESH BGPCapabilityCode = 70
+ BGP_CAP_ROUTE_REFRESH_CISCO BGPCapabilityCode = 128
)
-func (c BGPCapabilityCode) String() string {
- switch c {
- case BGP_CAP_MULTIPROTOCOL:
- return "MultiProtocol"
- case BGP_CAP_ROUTE_REFRESH:
- return "RouteRefresh"
- case BGP_CAP_CARRYING_LABEL_INFO:
- return "CarryingLabelInfo"
- case BGP_CAP_GRACEFUL_RESTART:
- return "GracefulRestart"
- case BGP_CAP_FOUR_OCTET_AS_NUMBER:
- return "FourOctetASNumber"
- case BGP_CAP_ENHANCED_ROUTE_REFRESH:
- return "EnhancedRouteRefresh"
- case BGP_CAP_ROUTE_REFRESH_CISCO:
- return "RouteRefreshCisco"
- }
- return "Unknown"
-}
-
type ParameterCapabilityInterface interface {
DecodeFromBytes([]byte) error
Serialize() ([]byte, error)
@@ -943,8 +923,8 @@ func (n *RouteTargetMembershipNLRI) SAFI() uint8 {
func (n *RouteTargetMembershipNLRI) Len() int { return 12 }
-func rfshift(afi uint16, safi uint8) RouteFamily {
- return RouteFamily (int(afi)<<16 | int(safi))
+func rfshift(afi uint16, safi uint8) RouteFamily {
+ return RouteFamily(int(afi)<<16 | int(safi))
}
type RouteFamily int