diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-12 10:12:12 +0000 |
---|---|---|
committer | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-14 02:15:47 +0000 |
commit | 1e22e529c92fe7b2e1576ceea96d827f16a76654 (patch) | |
tree | 587c27db5caad26185ff6e0c0aff126b21fe1b2d /api/grpc_server.go | |
parent | c4ced97e76f12d5c37721c107e61147edb4254d7 (diff) |
config/api: create admin-state type
align with session-state
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'api/grpc_server.go')
-rw-r--r-- | api/grpc_server.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go index a21a3d85..78a53d0b 100644 --- a/api/grpc_server.go +++ b/api/grpc_server.go @@ -138,7 +138,7 @@ func NewPeerFromConfigStruct(pconf *config.Neighbor) *Peer { }, Info: &PeerState{ BgpState: string(s.SessionState), - AdminState: s.AdminState, + AdminState: PeerState_AdminState(s.AdminState.ToInt()), Messages: &Messages{ Received: &Message{ NOTIFICATION: s.Messages.Received.Notification, @@ -392,7 +392,7 @@ func (s *Server) MonitorPeerState(arg *Arguments, stream GobgpApi_MonitorPeerSta LocalAs: msg.LocalAS, NeighborAddress: msg.PeerAddress.String(), BgpState: msg.State.String(), - AdminState: msg.AdminState.String(), + AdminState: PeerState_AdminState(msg.AdminState), }, Transport: &Transport{ LocalAddress: msg.LocalAddress.String(), @@ -907,7 +907,7 @@ func NewNeighborFromAPIStruct(a *Peer) (*config.Neighbor, error) { } if a.Info != nil { pconf.State.SessionState = config.SessionState(a.Info.BgpState) - pconf.State.AdminState = a.Info.AdminState + pconf.State.AdminState = config.IntToAdminStateMap[int(a.Info.AdminState)] pconf.State.AdjTable.Received = a.Info.Received pconf.State.AdjTable.Accepted = a.Info.Accepted |