From e22a7041626cf1ebee7534d84068d48e8671a6ab Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 9 Aug 2022 03:03:29 +0000 Subject: ip: Use .api declared error counters Type: improvement Signed-off-by: Neale Ranns Change-Id: I822ead1495edb96ee62e53dc5920aa6c565e3621 --- src/vnet/ip/ip_frag.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) (limited to 'src/vnet/ip/ip_frag.c') diff --git a/src/vnet/ip/ip_frag.c b/src/vnet/ip/ip_frag.c index 95600116365..5e8d3682eaa 100644 --- a/src/vnet/ip/ip_frag.c +++ b/src/vnet/ip/ip_frag.c @@ -500,12 +500,6 @@ ip6_frag_do_fragment (vlib_main_t * vm, u32 from_bi, u16 mtu, return IP_FRAG_ERROR_NONE; } -char *ip4_frag_error_strings[] = { -#define _(sym,string) string, - foreach_ip_frag_error -#undef _ -}; - /* *INDENT-OFF* */ VLIB_REGISTER_NODE (ip4_frag_node) = { .function = ip4_frag, @@ -515,17 +509,15 @@ VLIB_REGISTER_NODE (ip4_frag_node) = { .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = IP_FRAG_N_ERROR, - .error_strings = ip4_frag_error_strings, + .error_counters = ip_frag_error_counters, .n_next_nodes = IP_FRAG_N_NEXT, - .next_nodes = { - [IP_FRAG_NEXT_IP_REWRITE] = "ip4-rewrite", - [IP_FRAG_NEXT_IP_REWRITE_MIDCHAIN] = "ip4-midchain", - [IP_FRAG_NEXT_IP4_LOOKUP] = "ip4-lookup", - [IP_FRAG_NEXT_IP6_LOOKUP] = "ip6-lookup", - [IP_FRAG_NEXT_ICMP_ERROR] = "ip4-icmp-error", - [IP_FRAG_NEXT_DROP] = "ip4-drop" - }, + .next_nodes = { [IP_FRAG_NEXT_IP_REWRITE] = "ip4-rewrite", + [IP_FRAG_NEXT_IP_REWRITE_MIDCHAIN] = "ip4-midchain", + [IP_FRAG_NEXT_IP4_LOOKUP] = "ip4-lookup", + [IP_FRAG_NEXT_IP6_LOOKUP] = "ip6-lookup", + [IP_FRAG_NEXT_ICMP_ERROR] = "ip4-icmp-error", + [IP_FRAG_NEXT_DROP] = "ip4-drop" }, }; /* *INDENT-ON* */ @@ -538,17 +530,15 @@ VLIB_REGISTER_NODE (ip6_frag_node) = { .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = IP_FRAG_N_ERROR, - .error_strings = ip4_frag_error_strings, + .error_counters = ip_frag_error_counters, .n_next_nodes = IP_FRAG_N_NEXT, - .next_nodes = { - [IP_FRAG_NEXT_IP_REWRITE] = "ip6-rewrite", - [IP_FRAG_NEXT_IP_REWRITE_MIDCHAIN] = "ip6-midchain", - [IP_FRAG_NEXT_IP4_LOOKUP] = "ip4-lookup", - [IP_FRAG_NEXT_IP6_LOOKUP] = "ip6-lookup", - [IP_FRAG_NEXT_ICMP_ERROR] = "error-drop", - [IP_FRAG_NEXT_DROP] = "ip6-drop" - }, + .next_nodes = { [IP_FRAG_NEXT_IP_REWRITE] = "ip6-rewrite", + [IP_FRAG_NEXT_IP_REWRITE_MIDCHAIN] = "ip6-midchain", + [IP_FRAG_NEXT_IP4_LOOKUP] = "ip4-lookup", + [IP_FRAG_NEXT_IP6_LOOKUP] = "ip6-lookup", + [IP_FRAG_NEXT_ICMP_ERROR] = "error-drop", + [IP_FRAG_NEXT_DROP] = "ip6-drop" }, }; /* *INDENT-ON* */ -- cgit 1.2.3-korg