summaryrefslogtreecommitdiffstats
path: root/src/vnet/bfd/bfd_main.h
diff options
context:
space:
mode:
authorKlement Sekera <klement.sekera@gmail.com>2022-02-14 20:20:22 +0000
committerKlement Sekera <klement.sekera@gmail.com>2022-02-14 20:21:01 +0000
commitcdaf0d8c884ae0f337ef94b0ceb7449c991a3e6c (patch)
tree0a72992ae6f8a9e3868c01c0237bed100342e9d7 /src/vnet/bfd/bfd_main.h
parentb59f63b0e71c879331280b721ec72ff0b4699540 (diff)
bfd: add per session counters
Add udp total session counts - as stat segment entries: /bfd/udp4/sessions /bfd/udp6/sessions and per session packet/byte counters: /bfd/rx-session-counters /bfd/rx-session-echo-counters /bfd/tx-session-counters /bfd/tx-session-echo-counters These counters are per-thread and per-session id. Adjust tests to verify proper function. Type: refactor Signed-off-by: Klement Sekera <klement.sekera@gmail.com> Change-Id: Ie597928022b6ac74c2220019b9e8e1714295f170
Diffstat (limited to 'src/vnet/bfd/bfd_main.h')
-rw-r--r--src/vnet/bfd/bfd_main.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vnet/bfd/bfd_main.h b/src/vnet/bfd/bfd_main.h
index 5e9f025c657..2d91e68c557 100644
--- a/src/vnet/bfd/bfd_main.h
+++ b/src/vnet/bfd/bfd_main.h
@@ -258,7 +258,7 @@ typedef enum
} bfd_listen_event_e;
/**
- * session nitification call back function type
+ * session notification call back function type
*/
typedef void (*bfd_notify_fn_t) (bfd_listen_event_e, const bfd_session_t *);
@@ -322,6 +322,11 @@ typedef struct
vlib_log_class_t log_class;
u16 msg_id_base;
+
+ vlib_combined_counter_main_t rx_counter;
+ vlib_combined_counter_main_t rx_echo_counter;
+ vlib_combined_counter_main_t tx_counter;
+ vlib_combined_counter_main_t tx_echo_counter;
} bfd_main_t;
extern bfd_main_t bfd_main;
@@ -412,10 +417,11 @@ void bfd_put_session (bfd_main_t * bm, bfd_session_t * bs);
bfd_session_t *bfd_find_session_by_idx (bfd_main_t * bm, uword bs_idx);
bfd_session_t *bfd_find_session_by_disc (bfd_main_t * bm, u32 disc);
void bfd_session_start (bfd_main_t * bm, bfd_session_t * bs);
+void bfd_session_stop (bfd_main_t *bm, bfd_session_t *bs);
void bfd_consume_pkt (vlib_main_t * vm, bfd_main_t * bm,
const bfd_pkt_t * bfd, u32 bs_idx);
-int bfd_consume_echo_pkt (vlib_main_t * vm, bfd_main_t * bm,
- vlib_buffer_t * b);
+bfd_session_t *bfd_consume_echo_pkt (vlib_main_t *vm, bfd_main_t *bm,
+ vlib_buffer_t *b);
int bfd_verify_pkt_common (const bfd_pkt_t * pkt);
int bfd_verify_pkt_auth (vlib_main_t * vm, const bfd_pkt_t * pkt,
u16 pkt_size, bfd_session_t * bs);