X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fvnet%2Fl2%2Fl2_api.c;h=f60cd41bb39ad97afb1f13a12c88792d3c8279b5;hp=059f668d664bd18589fd879d43e8c07f297d66c2;hb=192b13f96;hpb=1ea74b5df5acfc827ee53fd5cb6bdb40140da0f0 diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c index 059f668d664..f60cd41bb39 100644 --- a/src/vnet/l2/l2_api.c +++ b/src/vnet/l2/l2_api.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -74,7 +75,9 @@ _(BRIDGE_FLAGS, bridge_flags) \ _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) \ _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \ _(BRIDGE_DOMAIN_SET_MAC_AGE, bridge_domain_set_mac_age) \ -_(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) +_(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \ +_(BVI_CREATE, bvi_create) \ +_(BVI_DELETE, bvi_delete) static void send_l2_xconnect_details (vl_api_registration_t * reg, u32 context, @@ -993,6 +996,37 @@ vl_api_sw_interface_set_vpath_t_handler (vl_api_sw_interface_set_vpath_t * mp) REPLY_MACRO (VL_API_SW_INTERFACE_SET_VPATH_REPLY); } +static void +vl_api_bvi_create_t_handler (vl_api_bvi_create_t * mp) +{ + vl_api_bvi_create_reply_t *rmp; + mac_address_t mac; + u32 sw_if_index; + int rv; + + mac_address_decode (mp->mac, &mac); + + rv = l2_bvi_create (ntohl (mp->user_instance), &mac, &sw_if_index); + + /* *INDENT-OFF* */ + REPLY_MACRO2(VL_API_BVI_CREATE_REPLY, + ({ + rmp->sw_if_index = ntohl (sw_if_index); + })); + /* *INDENT-ON* */ +} + +static void +vl_api_bvi_delete_t_handler (vl_api_bvi_delete_t * mp) +{ + vl_api_bvi_delete_reply_t *rmp; + int rv; + + rv = l2_bvi_delete (ntohl (mp->sw_if_index)); + + REPLY_MACRO (VL_API_BVI_DELETE_REPLY); +} + /* * l2_api_hookup * Add vpe's API message handlers to the table.