summaryrefslogtreecommitdiffhomepage
path: root/packet/bgpcapabilitycode_string.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/bgpcapabilitycode_string.go
parenta3c1e53deda9f9834994751382f64827c14a9c32 (diff)
packet: BGPCapabiltyCode cleanup
use stringer command. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgpcapabilitycode_string.go')
-rw-r--r--packet/bgpcapabilitycode_string.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/packet/bgpcapabilitycode_string.go b/packet/bgpcapabilitycode_string.go
new file mode 100644
index 00000000..0dc70a87
--- /dev/null
+++ b/packet/bgpcapabilitycode_string.go
@@ -0,0 +1,40 @@
+// generated by stringer -type=BGPCapabilityCode; DO NOT EDIT
+
+package bgp
+
+import "fmt"
+
+const (
+ _BGPCapabilityCode_name_0 = "BGP_CAP_MULTIPROTOCOLBGP_CAP_ROUTE_REFRESH"
+ _BGPCapabilityCode_name_1 = "BGP_CAP_CARRYING_LABEL_INFO"
+ _BGPCapabilityCode_name_2 = "BGP_CAP_GRACEFUL_RESTARTBGP_CAP_FOUR_OCTET_AS_NUMBER"
+ _BGPCapabilityCode_name_3 = "BGP_CAP_ENHANCED_ROUTE_REFRESH"
+ _BGPCapabilityCode_name_4 = "BGP_CAP_ROUTE_REFRESH_CISCO"
+)
+
+var (
+ _BGPCapabilityCode_index_0 = [...]uint8{0, 21, 42}
+ _BGPCapabilityCode_index_1 = [...]uint8{0, 27}
+ _BGPCapabilityCode_index_2 = [...]uint8{0, 24, 52}
+ _BGPCapabilityCode_index_3 = [...]uint8{0, 30}
+ _BGPCapabilityCode_index_4 = [...]uint8{0, 27}
+)
+
+func (i BGPCapabilityCode) String() string {
+ switch {
+ case 1 <= i && i <= 2:
+ i -= 1
+ return _BGPCapabilityCode_name_0[_BGPCapabilityCode_index_0[i]:_BGPCapabilityCode_index_0[i+1]]
+ case i == 4:
+ return _BGPCapabilityCode_name_1
+ case 64 <= i && i <= 65:
+ i -= 64
+ return _BGPCapabilityCode_name_2[_BGPCapabilityCode_index_2[i]:_BGPCapabilityCode_index_2[i+1]]
+ case i == 70:
+ return _BGPCapabilityCode_name_3
+ case i == 128:
+ return _BGPCapabilityCode_name_4
+ default:
+ return fmt.Sprintf("BGPCapabilityCode(%d)", i)
+ }
+}