summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-06 22:40:31 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-06 22:40:31 +0900
commitedf0ca14a493b4e01bbb4279c1d282a20b2d4da5 (patch)
treef58d5389c5584242cf9008f6cbfed649a0f5b8aa /server/peer.go
parentcf936759004764cae72099ba87972f1153913ba6 (diff)
cli: improve the capability representation
Show both advertised and received caps like: fujita@ubuntu:~/git/gobgp$ ./cli/gobgpcli show neighbor 10.0.0.2 BGP neighbor is 10.0.0.2, remote AS 64515 BGP version 4, remote router ID 192.168.0.2 BGP state = BGP_FSM_ESTABLISHED, up for 0:09:28.011988 Neighbor capabilities: MULTIPROTOCOL: advertised and received ROUTE_REFRESH: advertised and received FOUR_OCTET_AS_NUMBER: advertised and received ROUTE_REFRESH_CISCO: received Message statistics: Sent Rcvd Opens: 2 1 Notifications: 0 0 Updates: 0 0 Keepalives: 18 1 Route Refesh: 0 0 Total: 20 2 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/peer.go b/server/peer.go
index 96f6dfb3..0bc993e9 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -304,14 +304,14 @@ func (peer *Peer) MarshalJSON() ([]byte, error) {
RemoteAS uint32 `json:"remote_as"`
CapRefresh bool `json:"cap_refresh"`
CapEnhancedRefresh bool `json:"cap_enhanced_refresh"`
- CapList []int
+ RemoteCap []int
+ LocalCap []int
}{
- RemoteIP: c.NeighborAddress.String(),
- Id: peer.peerInfo.ID.To4().String(),
- RemoteAS: c.PeerAs,
- CapList: capList,
- CapRefresh: false,
- CapEnhancedRefresh: false,
+ RemoteIP: c.NeighborAddress.String(),
+ Id: peer.peerInfo.ID.To4().String(),
+ RemoteAS: c.PeerAs,
+ RemoteCap: capList,
+ LocalCap: []int{int(bgp.BGP_CAP_MULTIPROTOCOL), int(bgp.BGP_CAP_ROUTE_REFRESH), int(bgp.BGP_CAP_FOUR_OCTET_AS_NUMBER)},
}
s := c.BgpNeighborCommonState