diff options
Diffstat (limited to 'vpp/api')
-rw-r--r-- | vpp/api/api.c | 6 | ||||
-rw-r--r-- | vpp/api/custom_dump.c | 28 | ||||
-rw-r--r-- | vpp/api/vpe.api | 1 |
3 files changed, 33 insertions, 2 deletions
diff --git a/vpp/api/api.c b/vpp/api/api.c index 95301f4c..f398e4f9 100644 --- a/vpp/api/api.c +++ b/vpp/api/api.c @@ -6001,16 +6001,18 @@ vl_api_af_packet_create_t_handler vl_api_af_packet_create_reply_t *rmp; int rv = 0; u8 *host_if_name = NULL; + u32 sw_if_index; host_if_name = format(0, "%s", mp->host_if_name); vec_add1 (host_if_name, 0); rv = af_packet_create_if(vm, host_if_name, - mp->use_random_hw_addr ? 0 : mp->hw_addr, 0); + mp->use_random_hw_addr ? 0 : mp->hw_addr, &sw_if_index); vec_free(host_if_name); - REPLY_MACRO(VL_API_AF_PACKET_CREATE_REPLY); + REPLY_MACRO2(VL_API_AF_PACKET_CREATE_REPLY, + rmp->sw_if_index = clib_host_to_net_u32(sw_if_index)); } static void diff --git a/vpp/api/custom_dump.c b/vpp/api/custom_dump.c index f49e1b05..388c7e50 100644 --- a/vpp/api/custom_dump.c +++ b/vpp/api/custom_dump.c @@ -1717,6 +1717,32 @@ static void * vl_api_cop_whitelist_enable_disable_t_print FINISH; } +static void * vl_api_af_packet_create_t_print +(vl_api_af_packet_create_t * mp, void *handle) +{ + u8 * s; + + s = format (0, "SCRIPT: af_packet_create "); + s = format (s, "host_if_name %s ", mp->host_if_name); + if ( mp->use_random_hw_addr) + s = format (s, "hw_addr random "); + else + s = format (s, "hw_addr %U ", format_ethernet_address, mp->hw_addr); + + FINISH; +} + +static void * vl_api_af_packet_delete_t_print +(vl_api_af_packet_delete_t * mp, void *handle) +{ + u8 * s; + + s = format (0, "SCRIPT: af_packet_delete "); + s = format (s, "host_if_name %s ", mp->host_if_name); + + FINISH; +} + static void *vl_api_sw_interface_clear_stats_t_print (vl_api_sw_interface_clear_stats_t * mp, void *handle) { @@ -1814,6 +1840,8 @@ _(DELETE_LOOPBACK, delete_loopback) \ _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \ _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \ _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \ +_(AF_PACKET_CREATE, af_packet_create) \ +_(AF_PACKET_DELETE, af_packet_delete) \ _(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) void vl_msg_api_custom_dump_configure (api_main_t *am) diff --git a/vpp/api/vpe.api b/vpp/api/vpe.api index 9a639c61..71783a46 100644 --- a/vpp/api/vpe.api +++ b/vpp/api/vpe.api @@ -3443,6 +3443,7 @@ define af_packet_create { define af_packet_create_reply { u32 context; i32 retval; + u32 sw_if_index; }; /** \brief Delete host-interface |