summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_neighbor.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-09-28 05:00:57 -0700
committerDamjan Marion <dmarion@me.com>2018-10-01 17:02:18 +0000
commit14260393c096b270ef318d74b481911c7def0496 (patch)
tree29bbd213ea550254b15131684e34032b4b8ab9e7 /src/vnet/ip/ip_neighbor.c
parent5df628bb8a30b69f223a7c8b017dcba770c87e43 (diff)
Add adjacency counters to the stats segment
Change-Id: I6b59df939c9daf40e261d73d19f500bd90abe6ff Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip_neighbor.c')
-rw-r--r--src/vnet/ip/ip_neighbor.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/vnet/ip/ip_neighbor.c b/src/vnet/ip/ip_neighbor.c
index 2edd737aa07..f5a816d5a18 100644
--- a/src/vnet/ip/ip_neighbor.c
+++ b/src/vnet/ip/ip_neighbor.c
@@ -50,8 +50,12 @@ static ip_neighbor_scan_config_t ip_neighbor_scan_conf;
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;
/*
@@ -66,7 +70,8 @@ ip_neighbor_add (const ip46_address_t * ip,
(flags & IP_NEIGHBOR_FLAG_STATIC),
(flags &
IP_NEIGHBOR_FLAG_NO_ADJ_FIB));
-
+ fproto = FIB_PROTOCOL_IP6;
+ linkt = VNET_LINK_IP6;
}
else
{
@@ -82,8 +87,13 @@ ip_neighbor_add (const ip46_address_t * ip,
(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);
}