diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-01-22 23:58:31 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-01-25 04:57:11 -0800 |
commit | cca91da0dfe70c2c32d5152b3a2cf76bfdb0f048 (patch) | |
tree | c651f896af8ae8a85a1e928bbc919b9eda4dd6b5 /server | |
parent | 4ad751b4f01a23af523ba6ea6b183bebb74be041 (diff) |
config: add go type of embeded enums defined in openconfig
these types are embeded enums of openconfig and were left uint32
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/peer.go | 2 | ||||
-rw-r--r-- | server/server.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/server/peer.go b/server/peer.go index ef08a4d8..b8bc9bcb 100644 --- a/server/peer.go +++ b/server/peer.go @@ -56,7 +56,7 @@ func NewPeer(g config.Global, conf config.Neighbor, loc *table.TableManager, pol tableId = conf.Config.NeighborAddress } peer.tableId = tableId - conf.State.SessionState = uint32(bgp.BGP_FSM_IDLE) + conf.State.SessionState = conf.State.SessionState.FromInt(int(bgp.BGP_FSM_IDLE)) conf.Timers.State.Downtime = time.Now().Unix() rfs, _ := config.AfiSafis(conf.AfiSafis).ToRfList() peer.adjRibIn = table.NewAdjRib(peer.ID(), rfs) diff --git a/server/server.go b/server/server.go index 3471ee7e..3a3b70fe 100644 --- a/server/server.go +++ b/server/server.go @@ -910,8 +910,8 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg) []*SenderMsg { switch e.MsgType { case FSM_MSG_STATE_CHANGE: nextState := e.MsgData.(bgp.FSMState) - oldState := bgp.FSMState(peer.conf.State.SessionState) - peer.conf.State.SessionState = uint32(nextState) + oldState := bgp.FSMState(peer.conf.State.SessionState.ToInt()) + peer.conf.State.SessionState = peer.conf.State.SessionState.FromInt(int(nextState)) peer.fsm.StateChange(nextState) if oldState == bgp.BGP_FSM_ESTABLISHED { |