aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vrrp/vrrp_packet.c
diff options
context:
space:
mode:
authorEmanuele Di Pascale <lele84@gmail.com>2022-03-29 12:29:23 +0200
committerEmanuele Di Pascale <lele84@gmail.com>2022-04-01 18:10:35 +0200
commit7539e4b5522b015a715ba49eed4477b8cece1b86 (patch)
tree9f181557091c4125d1561f606fa40f4d0f5d2ef5 /src/plugins/vrrp/vrrp_packet.c
parent2518dca440f1ef41500d73067fe44318b782b98d (diff)
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 <lele84@gmail.com> Change-Id: I2cd11467b4dbd9dfdb5aa748783144b4883dba57
Diffstat (limited to 'src/plugins/vrrp/vrrp_packet.c')
-rw-r--r--src/plugins/vrrp/vrrp_packet.c6
1 files changed, 6 insertions, 0 deletions
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;