summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-02-16 09:51:36 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-02-16 09:51:36 +0900
commit979fdad86cac0ba67851cd2cf28582f32be2f838 (patch)
treea1162b286173f7f24e227261de976509dd1d85fe /server/peer.go
parent4e1edd39c2333af217d8972ad8c1b7b0556c93cc (diff)
server: support discarded counters
fujita@ubuntu:~/git/gobgp$ ./cli/gobgpcli show neighbor 10.0.255.7 BGP neighbor is 10.0.255.7, remote AS 65070 BGP version 4, remote router ID 192.168.0.7 BGP state = BGP_FSM_ACTIVE, up for 0:00:01.982115 BGP OutQ = 0, Flops = 4 Neighbor capabilities: MULTIPROTOCOL: advertised and received ROUTE_REFRESH: advertised FOUR_OCTET_AS_NUMBER: advertised and received Message statistics: Sent Rcvd Opens: 4 4 Notifications: 4 0 Updates: 8 0 Keepalives: 4 4 Route Refesh: 0 0 Discarded: 0 4 Total: 20 12 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go32
1 files changed, 18 insertions, 14 deletions
diff --git a/server/peer.go b/server/peer.go
index ca10c1db..d04947fa 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -428,20 +428,22 @@ func (peer *Peer) MarshalJSON() ([]byte, error) {
}
p["info"] = struct {
- BgpState string `json:"bgp_state"`
- FsmEstablishedTransitions uint32 `json:"fsm_established_transitions"`
- TotalMessageOut uint32 `json:"total_message_out"`
- TotalMessageIn uint32 `json:"total_message_in"`
- UpdateMessageOut uint32 `json:"update_message_out"`
- UpdateMessageIn uint32 `json:"update_message_in"`
- KeepAliveMessageOut uint32 `json:"keepalive_message_out"`
- KeepAliveMessageIn uint32 `json:"keepalive_message_in"`
- OpenMessageOut uint32 `json:"open_message_out"`
- OpenMessageIn uint32 `json:"open_message_in"`
- NotificationOut uint32 `json:"notification_out"`
- NotificationIn uint32 `json:"notification_in"`
- RefreshMessageOut uint32 `json:"refresh_message_out"`
- RefreshMessageIn uint32 `json:"refresh_message_in"`
+ BgpState string `json:"bgp_state"`
+ FsmEstablishedTransitions uint32 `json:"fsm_established_transitions"`
+ TotalMessageOut uint32 `json:"total_message_out"`
+ TotalMessageIn uint32 `json:"total_message_in"`
+ UpdateMessageOut uint32 `json:"update_message_out"`
+ UpdateMessageIn uint32 `json:"update_message_in"`
+ KeepAliveMessageOut uint32 `json:"keepalive_message_out"`
+ KeepAliveMessageIn uint32 `json:"keepalive_message_in"`
+ OpenMessageOut uint32 `json:"open_message_out"`
+ OpenMessageIn uint32 `json:"open_message_in"`
+ NotificationOut uint32 `json:"notification_out"`
+ NotificationIn uint32 `json:"notification_in"`
+ RefreshMessageOut uint32 `json:"refresh_message_out"`
+ RefreshMessageIn uint32 `json:"refresh_message_in"`
+ DiscardedOut uint32
+ DiscardedIn uint32
Uptime float64 `json:"uptime"`
Downtime float64 `json:"downtime"`
LastError string `json:"last_error"`
@@ -466,6 +468,8 @@ func (peer *Peer) MarshalJSON() ([]byte, error) {
NotificationIn: s.NotifyIn,
RefreshMessageOut: s.RefreshOut,
RefreshMessageIn: s.RefreshIn,
+ DiscardedOut: s.DiscardedOut,
+ DiscardedIn: s.DiscardedIn,
Uptime: uptime,
Downtime: downtime,
Received: uint32(peer.adjRib.GetInCount(peer.rf)),