X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fvnet%2Finterface_api.c;h=4d5dab30f3801c83c5fc2db8498479ae7fc4008f;hp=687f599b616908c63a021aaab17b7aea8c8a8d3a;hb=e0792fdff;hpb=6a6af6ea1a77b5818e717047b5d01251ef6d024a diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c index 687f599b616..4d5dab30f38 100644 --- a/src/vnet/interface_api.c +++ b/src/vnet/interface_api.c @@ -68,6 +68,7 @@ _(SW_INTERFACE_GET_TABLE, sw_interface_get_table) \ _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \ _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \ _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \ +_(SW_INTERFACE_ADD_DEL_MAC_ADDRESS, sw_interface_add_del_mac_address) \ _(SW_INTERFACE_SET_MAC_ADDRESS, sw_interface_set_mac_address) \ _(SW_INTERFACE_GET_MAC_ADDRESS, sw_interface_get_mac_address) \ _(CREATE_VLAN_SUBIF, create_vlan_subif) \ @@ -899,6 +900,34 @@ out: REPLY_MACRO (VL_API_SW_INTERFACE_TAG_ADD_DEL_REPLY); } +static void vl_api_sw_interface_add_del_mac_address_t_handler + (vl_api_sw_interface_add_del_mac_address_t * mp) +{ + vl_api_sw_interface_add_del_mac_address_reply_t *rmp; + vnet_main_t *vnm = vnet_get_main (); + u32 sw_if_index = ntohl (mp->sw_if_index); + vnet_hw_interface_t *hi; + clib_error_t *error; + int rv = 0; + + VALIDATE_SW_IF_INDEX (mp); + + /* for subifs, the MAC should be changed on the actual hw if */ + hi = vnet_get_sup_hw_interface (vnm, sw_if_index); + error = vnet_hw_interface_add_del_mac_address (vnm, hi->hw_if_index, + mp->addr, mp->is_add); + if (error) + { + rv = VNET_API_ERROR_UNIMPLEMENTED; + clib_error_report (error); + goto out; + } + + BAD_SW_IF_INDEX_LABEL; +out: + REPLY_MACRO (VL_API_SW_INTERFACE_ADD_DEL_MAC_ADDRESS_REPLY); +} + static void vl_api_sw_interface_set_mac_address_t_handler (vl_api_sw_interface_set_mac_address_t * mp) {