summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/icmp4.c
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2022-08-12 01:50:24 +0000
committerBeno�t Ganne <bganne@cisco.com>2022-08-18 08:29:21 +0000
commitb29c60660a69ae892495de65e8c5147052c84ef5 (patch)
tree1813e86c6bde802965c89a8e556819ba15aa8ea1 /src/vnet/ip/icmp4.c
parentc65921f7744a0da09ede876b6588628e3a188529 (diff)
ip: Use .api declarative counters for ICMP.
Type: improvement Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I3d36faa60075658fd59eb5bbe16efcb48664691b
Diffstat (limited to 'src/vnet/ip/icmp4.c')
-rw-r--r--src/vnet/ip/icmp4.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/vnet/ip/icmp4.c b/src/vnet/ip/icmp4.c
index 857c3b1d2a5..318081b9c9f 100644
--- a/src/vnet/ip/icmp4.c
+++ b/src/vnet/ip/icmp4.c
@@ -43,12 +43,6 @@
#include <vnet/ip/ip_sas.h>
#include <vnet/util/throttle.h>
-static char *icmp_error_strings[] = {
-#define _(f,s) s,
- foreach_icmp4_error
-#undef _
-};
-
/** ICMP throttling */
static throttle_t icmp_throttle;
@@ -219,8 +213,8 @@ VLIB_REGISTER_NODE (ip4_icmp_input_node) = {
.format_trace = format_icmp_input_trace,
- .n_errors = ARRAY_LEN (icmp_error_strings),
- .error_strings = icmp_error_strings,
+ .n_errors = ICMP4_N_ERROR,
+ .error_counters = icmp4_error_counters,
.n_next_nodes = 1,
.next_nodes = {
@@ -399,8 +393,8 @@ VLIB_REGISTER_NODE (ip4_icmp_error_node) = {
.name = "ip4-icmp-error",
.vector_size = sizeof (u32),
- .n_errors = ARRAY_LEN (icmp_error_strings),
- .error_strings = icmp_error_strings,
+ .n_errors = ICMP4_N_ERROR,
+ .error_counters = icmp4_error_counters,
.n_next_nodes = IP4_ICMP_ERROR_N_NEXT,
.next_nodes = {