From fd2417b2a42e34062e3d07875e5c4e11922513d5 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Fri, 16 Jul 2021 14:00:16 +0000 Subject: ip-neighbor: ARP and ND stats per-interface. Type: feature stats of the like from: https://datatracker.ietf.org/doc/html/draft-ietf-rtgwg-arp-yang-model-03#section-4 Signed-off-by: Neale Ranns Change-Id: Icb1bf4f6f7e6ccc2f44b0008d4774b61cae96184 --- src/vnet/ip-neighbor/ip_neighbor_types.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/vnet/ip-neighbor/ip_neighbor_types.h') diff --git a/src/vnet/ip-neighbor/ip_neighbor_types.h b/src/vnet/ip-neighbor/ip_neighbor_types.h index 2eb8fd0841f..d7e818ba252 100644 --- a/src/vnet/ip-neighbor/ip_neighbor_types.h +++ b/src/vnet/ip-neighbor/ip_neighbor_types.h @@ -120,7 +120,37 @@ extern void ip_neighbor_clone (const ip_neighbor_t * ipn, extern void ip_neighbor_free (ip_neighbor_t * ipn); +/** + * Keep RX and TX counts per-AF + */ +#define foreach_ip_neighbor_counter_type \ + _ (REPLY, "reply") \ + _ (REQUEST, "request") \ + _ (GRAT, "gratuitous") + +typedef enum ip_neighbor_counter_type_t_ +{ +#define _(a, b) IP_NEIGHBOR_CTR_##a, + foreach_ip_neighbor_counter_type +#undef _ +} ip_neighbor_counter_type_t; + +#define N_IP_NEIGHBOR_CTRS (IP_NEIGHBOR_CTR_GRAT + 1) + +#define FOREACH_IP_NEIGHBOR_CTR(_type) \ + for (_type = 0; _type < N_IP_NEIGHBOR_CTRS; _type++) + +typedef struct ip_neighbor_counters_t_ +{ + vlib_simple_counter_main_t ipnc[VLIB_N_DIR][N_IP_NEIGHBOR_CTRS]; +} ip_neighbor_counters_t; + +extern u8 *format_ip_neighbor_counters (u8 *s, va_list *args); + +extern void ip_neighbor_alloc_ctr (ip_neighbor_counters_t *ctr, + u32 sw_if_index); +extern ip_neighbor_counters_t ip_neighbor_counters[N_AF]; #endif /* __INCLUDE_IP_NEIGHBOR_H__ */ -- cgit 1.2.3-korg