summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-23 05:20:31 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-23 05:20:31 -0800
commitf33719f78de63f9b51d10605e99d72222410e60d (patch)
treeef668c9187abe3f36042d01d3f12321e799054a3 /server/server.go
parentcb48c082ed63590c42ff27315e583649027241e1 (diff)
packet: define FSMState
Then we can use stringer nicely. Now FSMstate shows nicely like: DEBU[0081] Peer (10.0.0.1) state changed from BGP_FSM_ACTIVE to BGP_FSM_OPENSENT Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/server.go b/server/server.go
index f3ed0092..126bd6a9 100644
--- a/server/server.go
+++ b/server/server.go
@@ -20,6 +20,7 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/osrg/gobgp/api"
"github.com/osrg/gobgp/config"
+ "github.com/osrg/gobgp/packet"
"net"
"os"
"strconv"
@@ -158,7 +159,7 @@ func (server *BgpServer) handleRest(restReq *api.RestRequest) {
peer, found := server.peerMap[remoteAddr]
if found {
c := peer.peerConfig
- result.NeighborState = c.BgpNeighborCommonState.State
+ result.NeighborState = bgp.FSMState(c.BgpNeighborCommonState.State).String()
result.RemoteAddr = c.NeighborAddress.String()
result.RemoteAs = c.PeerAs
} else {