int
ip_neighbor_add (const ip46_address_t * ip,
u8 is_ip6,
- const u8 * mac, u32 sw_if_index, ip_neighbor_flags_t flags)
+ const u8 * mac,
+ u32 sw_if_index,
+ ip_neighbor_flags_t flags, u32 * stats_index)
{
+ fib_protocol_t fproto;
+ vnet_link_t linkt;
int rv;
/*
(flags & IP_NEIGHBOR_FLAG_STATIC),
(flags &
IP_NEIGHBOR_FLAG_NO_ADJ_FIB));
-
+ fproto = FIB_PROTOCOL_IP6;
+ linkt = VNET_LINK_IP6;
}
else
{
(flags & IP_NEIGHBOR_FLAG_STATIC),
(flags &
IP_NEIGHBOR_FLAG_NO_ADJ_FIB));
+ fproto = FIB_PROTOCOL_IP4;
+ linkt = VNET_LINK_IP4;
}
+ if (0 == rv && stats_index)
+ *stats_index = adj_nbr_find (fproto, linkt, ip, sw_if_index);
+
return (rv);
}
u32 interval = 0, time = 0, update = 0, delay = 0, stale = 0;
ip_neighbor_scan_arg_t arg;
- memset (&arg, 0, sizeof (arg));
+ clib_memset (&arg, 0, sizeof (arg));
arg.mode = IP_SCAN_V46_NEIGHBORS;
/* Get a line of input. */