*/
#include <vnet/ip-neighbor/ip4_neighbor.h>
+#include <vnet/ip-neighbor/ip_neighbor.api_enum.h>
#include <vnet/ethernet/ethernet.h>
#include <vnet/util/throttle.h>
#include <vnet/fib/fib_sas.h>
!ip4_sas_by_sw_if_index (sw_if_index0, &resolve0, &src0))
{
/* No source address available */
- p0->error = node->errors[IP4_ARP_ERROR_NO_SOURCE_ADDRESS];
+ p0->error =
+ node->errors[IP4_NEIGHBOR_ERROR_NO_SOURCE_ADDRESS];
continue;
}
}
if (throttle_check (&arp_throttle, thread_index, r0, seed))
{
- p0->error = node->errors[IP4_ARP_ERROR_THROTTLED];
+ p0->error = node->errors[IP4_NEIGHBOR_ERROR_THROTTLED];
continue;
}
*/
if (IP_LOOKUP_NEXT_REWRITE == adj0->lookup_next_index)
{
- p0->error = node->errors[IP4_ARP_ERROR_RESOLVED];
+ p0->error = node->errors[IP4_NEIGHBOR_ERROR_RESOLVED];
continue;
}
if ((is_glean && adj0->lookup_next_index != IP_LOOKUP_NEXT_GLEAN)
|| (!is_glean && adj0->lookup_next_index != IP_LOOKUP_NEXT_ARP))
{
- p0->error = node->errors[IP4_ARP_ERROR_NON_ARP_ADJ];
+ p0->error = node->errors[IP4_NEIGHBOR_ERROR_NON_ARP_ADJ];
continue;
}
/* copy the persistent fields from the original */
clib_memcpy_fast (b0->opaque2, p0->opaque2,
sizeof (p0->opaque2));
- p0->error = node->errors[IP4_ARP_ERROR_REQUEST_SENT];
+ p0->error = node->errors[IP4_NEIGHBOR_ERROR_REQUEST_SENT];
}
else
{
- p0->error = node->errors[IP4_ARP_ERROR_NO_BUFFERS];
+ p0->error = node->errors[IP4_NEIGHBOR_ERROR_NO_BUFFERS];
continue;
}
}
return (ip4_arp_inline (vm, node, frame, 1));
}
-static char *ip4_arp_error_strings[] = {
- [IP4_ARP_ERROR_THROTTLED] = "ARP requests throttled",
- [IP4_ARP_ERROR_RESOLVED] = "ARP requests resolved",
- [IP4_ARP_ERROR_NO_BUFFERS] = "ARP requests out of buffer",
- [IP4_ARP_ERROR_REQUEST_SENT] = "ARP requests sent",
- [IP4_ARP_ERROR_NON_ARP_ADJ] = "ARPs to non-ARP adjacencies",
- [IP4_ARP_ERROR_NO_SOURCE_ADDRESS] = "no source address for ARP request",
-};
-
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ip4_arp_node) =
{
.name = "ip4-arp",
.vector_size = sizeof (u32),
.format_trace = format_ip4_forward_next_trace,
- .n_errors = ARRAY_LEN (ip4_arp_error_strings),
- .error_strings = ip4_arp_error_strings,
+ .n_errors = IP4_NEIGHBOR_N_ERROR,
+ .error_counters = ip4_neighbor_error_counters,
.n_next_nodes = IP4_ARP_N_NEXT,
.next_nodes = {
[IP4_ARP_NEXT_DROP] = "ip4-drop",
.name = "ip4-glean",
.vector_size = sizeof (u32),
.format_trace = format_ip4_forward_next_trace,
- .n_errors = ARRAY_LEN (ip4_arp_error_strings),
- .error_strings = ip4_arp_error_strings,
+ .n_errors = IP4_NEIGHBOR_N_ERROR,
+ .error_counters = ip4_neighbor_error_counters,
.n_next_nodes = IP4_ARP_N_NEXT,
.next_nodes = {
[IP4_ARP_NEXT_DROP] = "ip4-drop",
vlib_node_runtime_t *rt = vlib_node_get_runtime (vm, ip4_arp_node.index);
/* don't trace ARP request packets */
-#define _(a) \
- vnet_pcap_drop_trace_filter_add_del \
- (rt->errors[IP4_ARP_ERROR_##a], \
- 1 /* is_add */);
+#define _(a) \
+ vnet_pcap_drop_trace_filter_add_del (rt->errors[IP4_NEIGHBOR_ERROR_##a], \
+ 1 /* is_add */);
foreach_notrace_ip4_arp_error;
#undef _
return 0;