aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api-test
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2016-08-26 13:35:40 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-08-31 10:02:15 +0000
commitd85590a00421a73f019a91c6c3cdd05b6b73f414 (patch)
treec216afd39f7b4560b88813cb431f48b00563a4e7 /vpp-api-test
parentf53db2a6c2a7e511716018aa37bc8ae8d0c18156 (diff)
VPP-240: delete subinterface
Added new CLI and API command to delete subinterface. Change-Id: Ia92a8facc6ad84634bdec430093e6add02ee674e Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'vpp-api-test')
-rw-r--r--vpp-api-test/vat/api_format.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index fbe4aedb..c1a472a3 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 */
@@ -15210,6 +15212,36 @@ api_ipsec_gre_tunnel_dump (vat_main_t * vam)
}
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)
{
longjmp (vam->jump_buf, 1);
@@ -15789,7 +15821,8 @@ _(ip_source_and_port_range_check_interface_add_del, \
"[udp-in-vrf <id>] [udp-out-vrf <id>]") \
_(ipsec_gre_add_del_tunnel, \
"src <addr> dst <addr> local_sa <sa-id> remote_sa <sa-id> [del]") \
-_(ipsec_gre_tunnel_dump, "[sw_if_index <nn>]")
+_(ipsec_gre_tunnel_dump, "[sw_if_index <nn>]") \
+_(delete_subif,"sub_sw_if_index <nn> sub_if_id <nn>")
/* List of command functions, CLI names map directly to functions */
#define foreach_cli_function \