diff options
author | Neale Ranns <neale@graphiant.com> | 2022-08-09 03:03:29 +0000 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2022-08-11 06:54:16 +0000 |
commit | e22a7041626cf1ebee7534d84068d48e8671a6ab (patch) | |
tree | dc3a7f46c3a4aef4c3af20229d3df18fb5465f8a /src/vnet/ip/ip_frag.c | |
parent | 93688d7341ada44755dc0432de3e3dbaaa8aa111 (diff) |
ip: Use .api declared error counters
Type: improvement
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I822ead1495edb96ee62e53dc5920aa6c565e3621
Diffstat (limited to 'src/vnet/ip/ip_frag.c')
-rw-r--r-- | src/vnet/ip/ip_frag.c | 38 |
1 files changed, 14 insertions, 24 deletions
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* */ |