aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_api.c
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2017-04-27 14:07:55 +0300
committerJohn Lo <loj@cisco.com>2017-05-08 12:33:17 +0000
commit7537e717d1ca6de0e33478bc50b9f7125f04c808 (patch)
tree43006c833fe8caa85231160db94866d348a52cca /src/vnet/l2/l2_api.c
parent57d7dbc8bf8a49ee2421fe97bd3ed7099d2384bf (diff)
L2FIB:CLI/API to flush all non-static entries
added CLI l2fib flush-mac all added API l2fib_flush_all flushes all non static l2fib entries on all valid BDs Change-Id: Ic963c88f4bed56308c03ab43106033132a0e87be Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_api.c')
-rw-r--r--src/vnet/l2/l2_api.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c
index 8cc7c7942eb..5f371ccd6ee 100644
--- a/src/vnet/l2/l2_api.c
+++ b/src/vnet/l2/l2_api.c
@@ -48,6 +48,7 @@
_(L2_XCONNECT_DUMP, l2_xconnect_dump) \
_(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
_(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
+_(L2FIB_FLUSH_ALL, l2fib_flush_all) \
_(L2FIB_FLUSH_INT, l2fib_flush_int) \
_(L2FIB_FLUSH_BD, l2fib_flush_bd) \
_(L2FIB_ADD_DEL, l2fib_add_del) \
@@ -106,11 +107,8 @@ vl_api_l2_fib_clear_table_t_handler (vl_api_l2_fib_clear_table_t * mp)
int rv = 0;
vl_api_l2_fib_clear_table_reply_t *rmp;
- /* DAW-FIXME: This API should only clear non-static l2fib entries, but
- * that is not currently implemented. When that TODO is fixed
- * this call should be changed to pass 1 instead of 0.
- */
- l2fib_clear_table (0);
+ /* Clear all MACs including static MACs */
+ l2fib_clear_table ();
REPLY_MACRO (VL_API_L2_FIB_CLEAR_TABLE_REPLY);
}
@@ -259,6 +257,16 @@ vl_api_l2fib_flush_int_t_handler (vl_api_l2fib_flush_int_t * mp)
}
static void
+vl_api_l2fib_flush_all_t_handler (vl_api_l2fib_flush_all_t * mp)
+{
+ int rv = 0;
+ vl_api_l2fib_flush_all_reply_t *rmp;
+
+ l2fib_flush_all_mac (vlib_get_main ());
+ REPLY_MACRO (VL_API_L2FIB_FLUSH_ALL_REPLY);
+}
+
+static void
vl_api_l2fib_flush_bd_t_handler (vl_api_l2fib_flush_bd_t * mp)
{
int rv = 0;