summaryrefslogtreecommitdiffhomepage
path: root/packet
diff options
context:
space:
mode:
Diffstat (limited to 'packet')
-rw-r--r--packet/constatnt.go4
-rw-r--r--packet/fsmstate_string.go17
2 files changed, 20 insertions, 1 deletions
diff --git a/packet/constatnt.go b/packet/constatnt.go
index 6f358ebe..31002c1b 100644
--- a/packet/constatnt.go
+++ b/packet/constatnt.go
@@ -19,8 +19,10 @@ const AS_TRANS = 23456
const BGP_PORT = 179
+type FSMState int
+
const (
- _ = iota
+ _ FSMState = iota
BGP_FSM_IDLE
BGP_FSM_CONNECT
BGP_FSM_ACTIVE
diff --git a/packet/fsmstate_string.go b/packet/fsmstate_string.go
new file mode 100644
index 00000000..26cafe25
--- /dev/null
+++ b/packet/fsmstate_string.go
@@ -0,0 +1,17 @@
+// generated by stringer -type FSMState constatnt.go; DO NOT EDIT
+
+package bgp
+
+import "fmt"
+
+const _FSMState_name = "BGP_FSM_IDLEBGP_FSM_CONNECTBGP_FSM_ACTIVEBGP_FSM_OPENSENTBGP_FSM_OPENCONFIRMBGP_FSM_ESTABLISHED"
+
+var _FSMState_index = [...]uint8{0, 12, 27, 41, 57, 76, 95}
+
+func (i FSMState) String() string {
+ i -= 1
+ if i < 0 || i+1 >= FSMState(len(_FSMState_index)) {
+ return fmt.Sprintf("FSMState(%d)", i+1)
+ }
+ return _FSMState_name[_FSMState_index[i]:_FSMState_index[i+1]]
+}