From 7539e4b5522b015a715ba49eed4477b8cece1b86 Mon Sep 17 00:00:00 2001 From: Emanuele Di Pascale Date: Tue, 29 Mar 2022 12:29:23 +0200 Subject: vrrp: add stats support and update API Add simple counter statistics to VRRP, based on a subset of those defined in RFC8347. Add an update API that allows in-place modification of an existing instance. The method returns a vrrp_index which can be used both for retrieving statistics and to modify non-key parameters. Also add a delete method which will take that vrrp_index as parameter. Type: improvement Signed-off-by: Emanuele Di Pascale Change-Id: I2cd11467b4dbd9dfdb5aa748783144b4883dba57 --- src/plugins/vrrp/vrrp_packet.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/vrrp/vrrp_packet.c') diff --git a/src/plugins/vrrp/vrrp_packet.c b/src/plugins/vrrp/vrrp_packet.c index 89a6ede605e..0ae73aa9d0a 100644 --- a/src/plugins/vrrp/vrrp_packet.c +++ b/src/plugins/vrrp/vrrp_packet.c @@ -354,6 +354,12 @@ vrrp_adv_send (vrrp_vr_t * vr, int shutdown) vlib_put_frame_to_node (vm, node_index, to_frame); + vrrp_incr_stat_counter (VRRP_STAT_COUNTER_ADV_SENT, vr->stat_index); + if (shutdown) + { + vrrp_incr_stat_counter (VRRP_STAT_COUNTER_PRIO0_SENT, vr->stat_index); + } + vec_free (bi); return 0; -- cgit 1.2.3-korg