diff options
author | Dave Barach <dave@barachs.net> | 2016-12-02 13:31:25 -0500 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-12-05 09:19:43 +0000 |
commit | 072f8debf21c786ab785ed623229935e0a6cddb6 (patch) | |
tree | bf50847f3f54f9fd1dbc2ad630b85e96160bd004 /vpp | |
parent | e3371afc8a90177eef331cf609ddd89c9413aeb5 (diff) |
Variable-message-length tracing support, VPP-370
Clean up several message handlers which spuriously depended on having
a vlib_main_t * pointer passed as a second argument. That definitely
doesn't happen when replaying an api trace...
Change-Id: Id4cf9745f770933566cb13698ee779333ee35d79
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vpp')
-rw-r--r-- | vpp/vpp-api/api.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index b778d3ca..5b249095 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -1854,8 +1854,9 @@ out: } static void -vl_api_tap_connect_t_handler (vl_api_tap_connect_t * mp, vlib_main_t * vm) +vl_api_tap_connect_t_handler (vl_api_tap_connect_t * mp) { + vlib_main_t *vm = vlib_get_main (); int rv; vl_api_tap_connect_reply_t *rmp; vnet_main_t *vnm = vnet_get_main (); @@ -1868,10 +1869,6 @@ vl_api_tap_connect_t_handler (vl_api_tap_connect_t * mp, vlib_main_t * vm) &sw_if_index, mp->renumber, ntohl (mp->custom_dev_instance)); - q = vl_api_client_index_to_input_queue (mp->client_index); - if (!q) - return; - /* Add tag if supplied */ if (rv == 0 && mp->tag[0]) { @@ -1880,6 +1877,10 @@ vl_api_tap_connect_t_handler (vl_api_tap_connect_t * mp, vlib_main_t * vm) vnet_set_sw_interface_tag (vnm, tag, sw_if_index); } + q = vl_api_client_index_to_input_queue (mp->client_index); + if (!q) + return; + rmp = vl_msg_api_alloc (sizeof (*rmp)); rmp->_vl_msg_id = ntohs (VL_API_TAP_CONNECT_REPLY); rmp->context = mp->context; @@ -1890,12 +1891,13 @@ vl_api_tap_connect_t_handler (vl_api_tap_connect_t * mp, vlib_main_t * vm) } static void -vl_api_tap_modify_t_handler (vl_api_tap_modify_t * mp, vlib_main_t * vm) +vl_api_tap_modify_t_handler (vl_api_tap_modify_t * mp) { int rv; vl_api_tap_modify_reply_t *rmp; unix_shared_memory_queue_t *q; u32 sw_if_index = (u32) ~ 0; + vlib_main_t *vm = vlib_get_main (); rv = vnet_tap_modify (vm, ntohl (mp->sw_if_index), mp->tap_name, mp->use_random_mac ? 0 : mp->mac_address, @@ -1916,8 +1918,9 @@ vl_api_tap_modify_t_handler (vl_api_tap_modify_t * mp, vlib_main_t * vm) } static void -vl_api_tap_delete_t_handler (vl_api_tap_delete_t * mp, vlib_main_t * vm) +vl_api_tap_delete_t_handler (vl_api_tap_delete_t * mp) { + vlib_main_t *vm = vlib_get_main (); int rv; vpe_api_main_t *vam = &vpe_api_main; vl_api_tap_delete_reply_t *rmp; @@ -3003,9 +3006,10 @@ static void vl_api_dhcp_client_config_t_handler static void vl_api_sw_interface_ip6nd_ra_config_t_handler - (vl_api_sw_interface_ip6nd_ra_config_t * mp, vlib_main_t * vm) + (vl_api_sw_interface_ip6nd_ra_config_t * mp) { vl_api_sw_interface_ip6nd_ra_config_reply_t *rmp; + vlib_main_t *vm = vlib_get_main (); int rv = 0; u8 is_no, suppress, managed, other, ll_option, send_unicast, cease, default_router; @@ -3037,8 +3041,9 @@ static void static void vl_api_sw_interface_ip6nd_ra_prefix_t_handler - (vl_api_sw_interface_ip6nd_ra_prefix_t * mp, vlib_main_t * vm) + (vl_api_sw_interface_ip6nd_ra_prefix_t * mp) { + vlib_main_t *vm = vlib_get_main (); vl_api_sw_interface_ip6nd_ra_prefix_reply_t *rmp; int rv = 0; u8 is_no, use_default, no_advertise, off_link, no_autoconfig, no_onlink; @@ -3065,8 +3070,9 @@ static void static void vl_api_sw_interface_ip6_enable_disable_t_handler - (vl_api_sw_interface_ip6_enable_disable_t * mp, vlib_main_t * vm) + (vl_api_sw_interface_ip6_enable_disable_t * mp) { + vlib_main_t *vm = vlib_get_main (); vl_api_sw_interface_ip6_enable_disable_reply_t *rmp; vnet_main_t *vnm = vnet_get_main (); int rv = 0; @@ -3098,8 +3104,9 @@ static void static void vl_api_sw_interface_ip6_set_link_local_address_t_handler - (vl_api_sw_interface_ip6_set_link_local_address_t * mp, vlib_main_t * vm) + (vl_api_sw_interface_ip6_set_link_local_address_t * mp) { + vlib_main_t *vm = vlib_get_main (); vl_api_sw_interface_ip6_set_link_local_address_reply_t *rmp; int rv = 0; clib_error_t *error; |