aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/l2
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2017-04-05 05:33:21 +0300
committerJohn Lo <loj@cisco.com>2017-04-05 21:46:36 +0000
commitf24991cab4a899f9e36e7f12ca61c591fedde249 (patch)
tree4fae3489cf49010f264726f3c19256391f3d94d9 /src/vnet/l2
parente50e8568c160f51cc2a268b59e209d13cb7344be (diff)
L2FIB:add l2fib_flush_bd l2fib_flush_int apis
Change-Id: I0a6989c6963956f3e60e8c50835c57845fccef8c Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/vnet/l2')
-rw-r--r--src/vnet/l2/l2.api44
-rw-r--r--src/vnet/l2/l2_api.c38
2 files changed, 82 insertions, 0 deletions
diff --git a/src/vnet/l2/l2.api b/src/vnet/l2/l2.api
index 81b75858bce..c23eebeca8c 100644
--- a/src/vnet/l2/l2.api
+++ b/src/vnet/l2/l2.api
@@ -86,6 +86,50 @@ define l2_fib_clear_table_reply
i32 retval;
};
+/** \brief L2 FIB flush bridge domain entries
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param bd_id - the entry's bridge domain id
+*/
+define l2fib_flush_bd
+{
+ u32 client_index;
+ u32 context;
+ u32 bd_id;
+};
+
+/** \brief L2 FIB flush bridge domain entries response
+ @param context - sender context, to match reply w/ request
+ @param retval - return code for the request
+*/
+define l2fib_flush_bd_reply
+{
+ u32 context;
+ i32 retval;
+};
+
+/** \brief L2 FIB flush interface entries
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param bd_id - the entry's bridge domain id
+*/
+define l2fib_flush_int
+{
+ u32 client_index;
+ u32 context;
+ u32 sw_if_index;
+};
+
+/** \brief L2 FIB flush interface entries response
+ @param context - sender context, to match reply w/ request
+ @param retval - return code for the request
+*/
+define l2fib_flush_int_reply
+{
+ u32 context;
+ i32 retval;
+};
+
/** \brief L2 FIB add entry request
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c
index ffcc790134e..026f1706b84 100644
--- a/src/vnet/l2/l2_api.c
+++ b/src/vnet/l2/l2_api.c
@@ -48,6 +48,8 @@
_(L2_XCONNECT_DUMP, l2_xconnect_dump) \
_(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
_(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \
+_(L2FIB_FLUSH_INT, l2fib_flush_int) \
+_(L2FIB_FLUSH_BD, l2fib_flush_bd) \
_(L2FIB_ADD_DEL, l2fib_add_del) \
_(L2_FLAGS, l2_flags) \
_(BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del) \
@@ -241,6 +243,42 @@ vl_api_l2fib_add_del_t_handler (vl_api_l2fib_add_del_t * mp)
}
static void
+vl_api_l2fib_flush_int_t_handler (vl_api_l2fib_flush_int_t * mp)
+{
+ int rv = 0;
+ vlib_main_t *vm = vlib_get_main ();
+ vl_api_l2fib_flush_int_reply_t *rmp;
+
+ VALIDATE_SW_IF_INDEX (mp);
+
+ u32 sw_if_index = ntohl (mp->sw_if_index);
+ l2fib_flush_int_mac (vm, sw_if_index);
+
+ BAD_SW_IF_INDEX_LABEL;
+ REPLY_MACRO (VL_API_L2FIB_FLUSH_INT_REPLY);
+}
+
+static void
+vl_api_l2fib_flush_bd_t_handler (vl_api_l2fib_flush_bd_t * mp)
+{
+ int rv = 0;
+ vlib_main_t *vm = vlib_get_main ();
+ bd_main_t *bdm = &bd_main;
+ vl_api_l2fib_flush_bd_reply_t *rmp;
+
+ u32 bd_id = ntohl (mp->bd_id);
+ uword *p = hash_get (bdm->bd_index_by_bd_id, bd_id);
+ if (p == 0)
+ {
+ rv = VNET_API_ERROR_NO_SUCH_ENTRY;
+ goto out;
+ }
+ l2fib_flush_bd_mac (vm, *p);
+out:
+ REPLY_MACRO (VL_API_L2FIB_FLUSH_BD_REPLY);
+}
+
+static void
vl_api_l2_flags_t_handler (vl_api_l2_flags_t * mp)
{
vl_api_l2_flags_reply_t *rmp;