X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fvat%2Fapi_format.c;h=9f02507e4f74ed78d12520a6c53566706f782652;hp=4c1a85f58e621b63e8ec7014375999473a8ed49d;hb=e0792fdff;hpb=6a6af6ea1a77b5818e717047b5d01251ef6d024a diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 4c1a85f58e6..9f02507e4f7 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -5173,6 +5173,7 @@ _(l2_interface_pbb_tag_rewrite_reply) \ _(set_punt_reply) \ _(feature_enable_disable_reply) \ _(sw_interface_tag_add_del_reply) \ +_(sw_interface_add_del_mac_address_reply) \ _(hw_interface_set_mtu_reply) \ _(p2p_ethernet_add_reply) \ _(p2p_ethernet_del_reply) \ @@ -5481,6 +5482,7 @@ _(IP_TABLE_DETAILS, ip_table_details) \ _(IP_ROUTE_DETAILS, ip_route_details) \ _(FEATURE_ENABLE_DISABLE_REPLY, feature_enable_disable_reply) \ _(SW_INTERFACE_TAG_ADD_DEL_REPLY, sw_interface_tag_add_del_reply) \ +_(SW_INTERFACE_ADD_DEL_MAC_ADDRESS_REPLY, sw_interface_add_del_mac_address_reply) \ _(L2_XCONNECT_DETAILS, l2_xconnect_details) \ _(HW_INTERFACE_SET_MTU_REPLY, hw_interface_set_mtu_reply) \ _(IP_NEIGHBOR_DETAILS, ip_neighbor_details) \ @@ -19999,6 +20001,54 @@ api_sw_interface_tag_add_del (vat_main_t * vam) return ret; } +static int +api_sw_interface_add_del_mac_address (vat_main_t * vam) +{ + unformat_input_t *i = vam->input; + vl_api_mac_address_t mac = { 0 }; + vl_api_sw_interface_add_del_mac_address_t *mp; + u32 sw_if_index = ~0; + u8 is_add = 1; + u8 mac_set = 0; + int ret; + + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index)) + ; + else if (unformat (i, "sw_if_index %d", &sw_if_index)) + ; + else if (unformat (i, "%U", unformat_vl_api_mac_address, &mac)) + mac_set++; + else if (unformat (i, "del")) + is_add = 0; + else + break; + } + + if (sw_if_index == ~0) + { + errmsg ("missing interface name or sw_if_index"); + return -99; + } + + if (!mac_set) + { + errmsg ("missing MAC address"); + return -99; + } + + /* Construct the API message */ + M (SW_INTERFACE_ADD_DEL_MAC_ADDRESS, mp); + mp->sw_if_index = ntohl (sw_if_index); + mp->is_add = is_add; + clib_memcpy (&mp->addr, &mac, sizeof (mac)); + + S (mp); + W (ret); + return ret; +} + static void vl_api_l2_xconnect_details_t_handler (vl_api_l2_xconnect_details_t * mp) { @@ -21753,6 +21803,8 @@ _(feature_enable_disable, "arc_name " \ "feature_name | sw_if_index [disable]") \ _(sw_interface_tag_add_del, " | sw_if_index tag " \ "[disable]") \ +_(sw_interface_add_del_mac_address, " | sw_if_index " \ + "mac [del]") \ _(l2_xconnect_dump, "") \ _(hw_interface_set_mtu, " | hw_if_index mtu ") \ _(ip_neighbor_dump, "[ip6] | sw_if_index ") \