summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip-neighbor/ip_neighbor_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-04-23 09:04:59 +0000
committerOle Trøan <otroan@employees.org>2020-04-30 20:24:45 +0000
commit240dcb24a00004017ec2d1b23b93d9ae8d3c9f65 (patch)
tree5c0397ecbf4c0936ce703871888ff666239f775f /src/vnet/ip-neighbor/ip_neighbor_api.c
parentf3783e15014c4c93a1b43697bfcc6422b0a7e369 (diff)
ip-neighbor: Add flush API
Type: feature Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I96509c274895b917c3e220204d7959d9270de30d
Diffstat (limited to 'src/vnet/ip-neighbor/ip_neighbor_api.c')
-rw-r--r--src/vnet/ip-neighbor/ip_neighbor_api.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vnet/ip-neighbor/ip_neighbor_api.c b/src/vnet/ip-neighbor/ip_neighbor_api.c
index 86587fab31b..02952c7ba24 100644
--- a/src/vnet/ip-neighbor/ip_neighbor_api.c
+++ b/src/vnet/ip-neighbor/ip_neighbor_api.c
@@ -301,6 +301,25 @@ vl_api_ip_neighbor_replace_end_t_handler (vl_api_ip_neighbor_replace_end_t *
REPLY_MACRO (VL_API_IP_NEIGHBOR_REPLACE_END_REPLY);
}
+static void
+vl_api_ip_neighbor_flush_t_handler (vl_api_ip_neighbor_flush_t * mp)
+{
+ vl_api_ip_neighbor_flush_reply_t *rmp;
+ ip_address_family_t af;
+ int rv;
+
+ if (mp->sw_if_index != ~0)
+ VALIDATE_SW_IF_INDEX (mp);
+
+ rv = ip_address_family_decode (mp->af, &af);
+
+ if (!rv)
+ ip_neighbor_del_all (ip46_type_from_af (af), ntohl (mp->sw_if_index));
+
+ BAD_SW_IF_INDEX_LABEL;
+ REPLY_MACRO (VL_API_IP_NEIGHBOR_FLUSH_REPLY);
+}
+
#define vl_msg_name_crc_list
#include <vnet/ip-neighbor/ip_neighbor.api.h>
#undef vl_msg_name_crc_list