diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-12-03 18:05:41 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-12-03 18:05:41 +0100 |
commit | 21d09632a524c0d2a7f44a51f877370ad07b983c (patch) | |
tree | 62d8f9d523ba09b71d70ebbe89bdf089dc3f8f92 /proto/bgp/bgp.h | |
parent | 92249894b333f7785e62b2f629dca1bbe6597c2f (diff) |
BGP: Add some statistics
Add some statistic counters to BGP consistent with BGP MIB (RFC 4273),
including persistent 'FSM established transitions'.
Diffstat (limited to 'proto/bgp/bgp.h')
-rw-r--r-- | proto/bgp/bgp.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index d336132b..03b92bd8 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -245,6 +245,14 @@ struct bgp_socket { u32 uc; /* Use count */ }; +struct bgp_stats { + uint rx_messages, tx_messages; + uint rx_updates, tx_updates; + u64 rx_bytes, tx_bytes; + + uint fsm_established_transitions; +}; + struct bgp_conn { struct bgp_proto *bgp; struct birdsock *sk; @@ -303,6 +311,9 @@ struct bgp_proto { struct bgp_socket *sock; /* Shared listening socket */ struct bfd_request *bfd_req; /* BFD request, if BFD is used */ struct birdsock *postponed_sk; /* Postponed incoming socket for dynamic BGP */ + struct bgp_stats stats; /* BGP statistics */ + btime last_established; /* Last time of enter/leave of established state */ + btime last_rx_update; /* Last time of RX update */ ip_addr link_addr; /* Link-local version of local_ip */ event *event; /* Event for respawning and shutting process */ timer *startup_timer; /* Timer used to delay protocol startup due to previous errors (startup_delay) */ |