From d85590a00421a73f019a91c6c3cdd05b6b73f414 Mon Sep 17 00:00:00 2001 From: Pavel Kotucek Date: Fri, 26 Aug 2016 13:35:40 +0200 Subject: VPP-240: delete subinterface Added new CLI and API command to delete subinterface. Change-Id: Ia92a8facc6ad84634bdec430093e6add02ee674e Signed-off-by: Pavel Kotucek --- vpp-api-test/vat/api_format.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'vpp-api-test') diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c index fbe4aedbca5..c1a472a3c8a 100644 --- a/vpp-api-test/vat/api_format.c +++ b/vpp-api-test/vat/api_format.c @@ -3385,7 +3385,8 @@ _(ipfix_enable_reply) \ _(pg_capture_reply) \ _(pg_enable_disable_reply) \ _(ip_source_and_port_range_check_add_del_reply) \ -_(ip_source_and_port_range_check_interface_add_del_reply) +_(ip_source_and_port_range_check_interface_add_del_reply)\ +_(delete_subif_reply) #define _(n) \ static void vl_api_##n##_t_handler \ @@ -3604,7 +3605,8 @@ _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL_REPLY, \ _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY, \ ip_source_and_port_range_check_interface_add_del_reply) \ _(IPSEC_GRE_ADD_DEL_TUNNEL_REPLY, ipsec_gre_add_del_tunnel_reply) \ -_(IPSEC_GRE_TUNNEL_DETAILS, ipsec_gre_tunnel_details) +_(IPSEC_GRE_TUNNEL_DETAILS, ipsec_gre_tunnel_details) \ +_(DELETE_SUBIF_REPLY, delete_subif_reply) /* M: construct, but don't yet send a message */ @@ -15209,6 +15211,36 @@ api_ipsec_gre_tunnel_dump (vat_main_t * vam) W; } +static int +api_delete_subif (vat_main_t * vam) +{ + unformat_input_t *i = vam->input; + vl_api_delete_subif_t *mp; + f64 timeout; + u32 sw_if_index = ~0; + + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (unformat (i, "sw_if_index %d", &sw_if_index)) + ; + else + break; + } + + if (sw_if_index == ~0) + { + errmsg ("missing sw_if_index\n"); + return -99; + } + + /* Construct the API message */ + M (DELETE_SUBIF, delete_subif); + mp->sw_if_index = ntohl (sw_if_index); + + S; + W; +} + static int q_or_quit (vat_main_t * vam) { @@ -15789,7 +15821,8 @@ _(ip_source_and_port_range_check_interface_add_del, \ "[udp-in-vrf ] [udp-out-vrf ]") \ _(ipsec_gre_add_del_tunnel, \ "src dst local_sa remote_sa [del]") \ -_(ipsec_gre_tunnel_dump, "[sw_if_index ]") +_(ipsec_gre_tunnel_dump, "[sw_if_index ]") \ +_(delete_subif,"sub_sw_if_index sub_if_id ") /* List of command functions, CLI names map directly to functions */ #define foreach_cli_function \ -- cgit 1.2.3-korg