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/vpp-api/api.c | 14 +++++++++++++- vpp/vpp-api/custom_dump.c | 13 ++++++++++++- vpp/vpp-api/vpe.api | 20 ++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) (limited to 'vpp/vpp-api') diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index fb44aaa8..8d54ba75 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -384,7 +384,8 @@ _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \ _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \ ip_source_and_port_range_check_interface_add_del) \ _(IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel) \ -_(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) +_(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \ +_(DELETE_SUBIF, delete_subif) #define QUOTE_(x) #x #define QUOTE(x) QUOTE_(x) @@ -8155,6 +8156,17 @@ static void vl_api_ipsec_gre_tunnel_dump_t_handler } } +static void +vl_api_delete_subif_t_handler (vl_api_delete_subif_t * mp) +{ + vl_api_delete_subif_reply_t *rmp; + int rv; + + rv = vnet_delete_sub_interface (ntohl (mp->sw_if_index)); + + REPLY_MACRO (VL_API_DELETE_SUBIF_REPLY); +} + #define BOUNCE_HANDLER(nn) \ static void vl_api_##nn##_t_handler ( \ vl_api_##nn##_t *mp) \ diff --git a/vpp/vpp-api/custom_dump.c b/vpp/vpp-api/custom_dump.c index 375535f6..87331eb1 100644 --- a/vpp/vpp-api/custom_dump.c +++ b/vpp/vpp-api/custom_dump.c @@ -728,6 +728,16 @@ static void *vl_api_create_subif_t_print foreach_create_subif_bit; #undef _ + FINISH; +} + +static void *vl_api_delete_subif_t_print + (vl_api_delete_subif_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: delete_subif "); + s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index)); FINISH; } @@ -2732,7 +2742,8 @@ _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \ _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \ _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \ _(IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel) \ -_(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) +_(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \ +_(DELETE_SUBIF, delete_subif) void vl_msg_api_custom_dump_configure (api_main_t * am) { diff --git a/vpp/vpp-api/vpe.api b/vpp/vpp-api/vpe.api index a2a7be45..386ff163 100644 --- a/vpp/vpp-api/vpe.api +++ b/vpp/vpp-api/vpe.api @@ -4831,3 +4831,23 @@ define ipsec_gre_tunnel_details { u8 src_address[4]; u8 dst_address[4]; }; + +/** \brief Delete sub interface request + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param sw_if_index - sw index of the interface that was created by create_subif +*/ +define delete_subif { + u32 client_index; + u32 context; + u32 sw_if_index; +}; + +/** \brief Delete sub interface response + @param context - sender context, to match reply w/ request + @param retval - return code for the request +*/ +define delete_subif_reply { + u32 context; + i32 retval; +}; -- cgit 1.2.3-korg