summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/interface_api.c')
-rw-r--r--src/vnet/interface_api.c29
1 files changed, 29 insertions, 0 deletions
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)
{