From cb034b9b374927c7552e36dcbc306d8456b2a0cb Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Wed, 28 Dec 2016 18:38:59 +0100 Subject: Move java,lua api and remaining plugins to src/ Change-Id: I1c3b87e886603678368428ae56a6bd3327cbc90d Signed-off-by: Damjan Marion --- src/plugins/ioam/lib-pot/pot_test.c | 365 ++++++++++++++++++++++++++++++++++++ 1 file changed, 365 insertions(+) create mode 100644 src/plugins/ioam/lib-pot/pot_test.c (limited to 'src/plugins/ioam/lib-pot/pot_test.c') diff --git a/src/plugins/ioam/lib-pot/pot_test.c b/src/plugins/ioam/lib-pot/pot_test.c new file mode 100644 index 00000000..2e870238 --- /dev/null +++ b/src/plugins/ioam/lib-pot/pot_test.c @@ -0,0 +1,365 @@ +/* + * Copyright (c) 2016 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + *------------------------------------------------------------------ + * pot_test.c - test harness for pot plugin + *------------------------------------------------------------------ + */ + +#include +#include +#include +#include +#include + +/* Declare message IDs */ +#include + +/* define message structures */ +#define vl_typedefs +#include +#undef vl_typedefs + +/* declare message handlers for each api */ + +#define vl_endianfun /* define message structures */ +#include +#undef vl_endianfun + +/* instantiate all the print functions we know about */ +#define vl_print(handle, ...) +#define vl_printfun +#include +#undef vl_printfun + +/* Get the API version number. */ +#define vl_api_version(n,v) static u32 api_version=(v); +#include +#undef vl_api_version + + +typedef struct { + /* API message ID base */ + u16 msg_id_base; + vat_main_t *vat_main; +} pot_test_main_t; + +pot_test_main_t pot_test_main; + +#define foreach_standard_reply_retval_handler \ +_(pot_profile_add_reply) \ +_(pot_profile_activate_reply) \ +_(pot_profile_del_reply) + +#define foreach_custom_reply_retval_handler \ +_(pot_profile_show_config_details, \ + errmsg(" ID:%d\n",mp->id); \ + errmsg(" Validator:%d\n",mp->validator); \ + errmsg(" secret_key:%Lx\n",clib_net_to_host_u64(mp->secret_key)); \ + errmsg(" secret_share:%Lx\n",clib_net_to_host_u64(mp->secret_share)); \ + errmsg(" prime:%Lx\n",clib_net_to_host_u64(mp->prime)); \ + errmsg(" bitmask:%Lx\n",clib_net_to_host_u64(mp->bit_mask)); \ + errmsg(" lpc:%Lx\n",clib_net_to_host_u64(mp->lpc)); \ + errmsg(" public poly:%Lx\n",clib_net_to_host_u64(mp->polynomial_public)); \ + ) + +#define _(n) \ + static void vl_api_##n##_t_handler \ + (vl_api_##n##_t * mp) \ + { \ + vat_main_t * vam = pot_test_main.vat_main; \ + i32 retval = ntohl(mp->retval); \ + if (vam->async_mode) { \ + vam->async_errors += (retval < 0); \ + } else { \ + vam->retval = retval; \ + vam->result_ready = 1; \ + } \ + } +foreach_standard_reply_retval_handler; +#undef _ + +#define _(n,body) \ + static void vl_api_##n##_t_handler \ + (vl_api_##n##_t * mp) \ + { \ + vat_main_t * vam = pot_test_main.vat_main; \ + i32 retval = ntohl(mp->retval); \ + if (vam->async_mode) { \ + vam->async_errors += (retval < 0); \ + } else { \ + vam->retval = retval; \ + vam->result_ready = 1; \ + } \ + do{body;}while(0); \ + } +foreach_custom_reply_retval_handler; +#undef _ + +/* + * Table of message reply handlers, must include boilerplate handlers + * we just generated + */ +#define foreach_vpe_api_reply_msg \ +_(POT_PROFILE_ADD_REPLY, pot_profile_add_reply) \ +_(POT_PROFILE_ACTIVATE_REPLY, pot_profile_activate_reply) \ +_(POT_PROFILE_DEL_REPLY, pot_profile_del_reply) \ +_(POT_PROFILE_SHOW_CONFIG_DETAILS, pot_profile_show_config_details) + + +/* M: construct, but don't yet send a message */ + +#define M(T,t) \ +do { \ + vam->result_ready = 0; \ + mp = vl_msg_api_alloc(sizeof(*mp)); \ + memset (mp, 0, sizeof (*mp)); \ + mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ + mp->client_index = vam->my_client_index; \ +} while(0); + +#define M2(T,t,n) \ +do { \ + vam->result_ready = 0; \ + mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ + memset (mp, 0, sizeof (*mp)); \ + mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ + mp->client_index = vam->my_client_index; \ +} while(0); + +/* S: send a message */ +#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) + +/* W: wait for results, with timeout */ +#define W \ +do { \ + timeout = vat_time_now (vam) + 1.0; \ + \ + while (vat_time_now (vam) < timeout) { \ + if (vam->result_ready == 1) { \ + return (vam->retval); \ + } \ + } \ + return -99; \ +} while(0); + + +static int api_pot_profile_add (vat_main_t *vam) +{ +#define MAX_BITS 64 + pot_test_main_t * sm = &pot_test_main; + unformat_input_t *input = vam->input; + vl_api_pot_profile_add_t *mp; + u8 *name = NULL; + u64 prime = 0; + u64 secret_share = 0; + u64 secret_key = 0; + u32 bits = MAX_BITS; + u64 lpc = 0, poly2 = 0; + f64 timeout; + u8 id = 0; + int rv = 0; + + while (unformat_check_input(input) != UNFORMAT_END_OF_INPUT) + { + if (unformat(input, "name %s", &name)) + ; + else if(unformat(input, "id %d", &id)) + ; + else if (unformat(input, "validator-key 0x%Lx", &secret_key)) + ; + else if (unformat(input, "prime-number 0x%Lx", &prime)) + ; + else if (unformat(input, "secret-share 0x%Lx", &secret_share)) + ; + else if (unformat(input, "polynomial-public 0x%Lx", &poly2)) + ; + else if (unformat(input, "lpc 0x%Lx", &lpc)) + ; + else if (unformat(input, "bits-in-random %u", &bits)) + { + if (bits > MAX_BITS) + bits = MAX_BITS; + } + else + break; + } + + if (!name) + { + errmsg ("name required\n"); + rv = -99; + goto OUT; + } + + M2(POT_PROFILE_ADD, pot_profile_add, vec_len(name)); + + mp->list_name_len = vec_len(name); + clib_memcpy(mp->list_name, name, mp->list_name_len); + mp->secret_share = clib_host_to_net_u64(secret_share); + mp->polynomial_public = clib_host_to_net_u64(poly2); + mp->lpc = clib_host_to_net_u64(lpc); + mp->prime = clib_host_to_net_u64(prime); + if (secret_key != 0) + { + mp->secret_key = clib_host_to_net_u64(secret_key); + mp->validator = 1; + } + else + { + mp->validator = 0; + } + mp->id = id; + mp->max_bits = bits; + + S; W; + +OUT: + vec_free(name); + return(rv); +} + +static int api_pot_profile_activate (vat_main_t *vam) +{ +#define MAX_BITS 64 + pot_test_main_t * sm = &pot_test_main; + unformat_input_t *input = vam->input; + vl_api_pot_profile_activate_t *mp; + u8 *name = NULL; + u8 id = 0; + int rv = 0; + f64 timeout; + + while (unformat_check_input(input) != UNFORMAT_END_OF_INPUT) + { + if (unformat(input, "name %s", &name)) + ; + else if(unformat(input, "id %d", &id)) + ; + else + break; + } + + if (!name) + { + errmsg ("name required\n"); + rv = -99; + goto OUT; + } + + M2(POT_PROFILE_ACTIVATE, pot_profile_activate, vec_len(name)); + + mp->list_name_len = vec_len(name); + clib_memcpy(mp->list_name, name, mp->list_name_len); + mp->id = id; + + S; W; + +OUT: + vec_free(name); + return(rv); +} + + +static int api_pot_profile_del (vat_main_t *vam) +{ + pot_test_main_t * sm = &pot_test_main; + vl_api_pot_profile_del_t *mp; + f64 timeout; + + M(POT_PROFILE_DEL, pot_profile_del); + mp->list_name_len = 0; + S; W; + return 0; +} + +static int api_pot_profile_show_config_dump (vat_main_t *vam) +{ + pot_test_main_t * sm = &pot_test_main; + unformat_input_t *input = vam->input; + vl_api_pot_profile_show_config_dump_t *mp; + f64 timeout; + u8 id = 0; + + while(unformat_check_input(input) != UNFORMAT_END_OF_INPUT) + { + if(unformat(input,"id %d",&id)); + else + break; + } + M(POT_PROFILE_SHOW_CONFIG_DUMP, pot_profile_show_config_dump); + + mp->id = id; + + S; W; + return 0; +} + +/* + * List of messages that the api test plugin sends, + * and that the data plane plugin processes + */ +#define foreach_vpe_api_msg \ +_(pot_profile_add, "name id [0-1] " \ + "prime-number <0xu64> bits-in-random [0-64] " \ + "secret-share <0xu64> lpc <0xu64> polynomial-public <0xu64> " \ + "[validator-key <0xu64>] [validity <0xu64>]") \ +_(pot_profile_activate, "name id [0-1] ") \ +_(pot_profile_del, "[id ]") \ +_(pot_profile_show_config_dump, "id [0-1]") + +void vat_api_hookup (vat_main_t *vam) +{ + pot_test_main_t * sm = &pot_test_main; + /* Hook up handlers for replies from the data plane plug-in */ +#define _(N,n) \ + vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ + #n, \ + vl_api_##n##_t_handler, \ + vl_noop_handler, \ + vl_api_##n##_t_endian, \ + vl_api_##n##_t_print, \ + sizeof(vl_api_##n##_t), 1); + foreach_vpe_api_reply_msg; +#undef _ + + /* API messages we can send */ +#define _(n,h) hash_set_mem (vam->function_by_name, #n, api_##n); + foreach_vpe_api_msg; +#undef _ + + /* Help strings */ +#define _(n,h) hash_set_mem (vam->help_by_name, #n, h); + foreach_vpe_api_msg; +#undef _ +} + +clib_error_t * vat_plugin_register (vat_main_t *vam) +{ + pot_test_main_t * sm = &pot_test_main; + u8 * name; + + sm->vat_main = vam; + + name = format (0, "ioam_pot_%08x%c", api_version, 0); + sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); + + if (sm->msg_id_base != (u16) ~0) + vat_api_hookup (vam); + + vec_free(name); + + return 0; +} -- cgit 1.2.3-korg From fe6bdfd84573cd8813a211f9094ee734f088ce16 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Fri, 20 Jan 2017 19:50:09 -0500 Subject: binary-api debug CLI works with plugins Change-Id: I81f33f5153d5afac94b66b5a8cb91da77463af79 Signed-off-by: Dave Barach --- src/examples/sample-plugin/sample/sample_test.c | 37 +--- src/plugins/acl/acl_test.c | 51 +----- src/plugins/flowperpkt/flowperpkt_test.c | 45 +---- .../export-vxlan-gpe/vxlan_gpe_ioam_export_test.c | 46 +---- src/plugins/ioam/export/ioam_export_test.c | 44 +---- src/plugins/ioam/lib-pot/pot_test.c | 48 +---- src/plugins/ioam/lib-trace/trace_test.c | 48 +---- src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c | 56 +----- src/plugins/lb/lb_test.c | 35 +--- src/plugins/snat/snat_test.c | 57 +----- src/vat/api_format.c | 95 ++++------ src/vat/vat.h | 33 +--- src/vlib/unix/plugin.c | 9 +- src/vlibapi/api_helper_macros.h | 1 - src/vlibapi/vat_helper_macros.h | 76 ++++++++ src/vpp-api-test.am | 3 + src/vpp.am | 6 +- src/vpp/api/api_main.c | 39 ++++ src/vpp/api/plugin.c | 201 +++++++++++++++++++++ src/vpp/api/plugin.h | 61 +++++++ 20 files changed, 476 insertions(+), 515 deletions(-) create mode 100644 src/vlibapi/vat_helper_macros.h create mode 100644 src/vpp/api/plugin.c create mode 100644 src/vpp/api/plugin.h (limited to 'src/plugins/ioam/lib-pot/pot_test.c') diff --git a/src/examples/sample-plugin/sample/sample_test.c b/src/examples/sample-plugin/sample/sample_test.c index dd1b0215..a47710ee 100644 --- a/src/examples/sample-plugin/sample/sample_test.c +++ b/src/examples/sample-plugin/sample/sample_test.c @@ -23,6 +23,7 @@ #include #include #include +#include uword unformat_sw_if_index (unformat_input_t * input, va_list * args); @@ -87,42 +88,6 @@ foreach_standard_reply_retval_handler; _(SAMPLE_MACSWAP_ENABLE_DISABLE_REPLY, sample_macswap_enable_disable_reply) -/* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - static int api_sample_macswap_enable_disable (vat_main_t * vam) { sample_test_main_t * sm = &sample_test_main; diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c index a0e413e1..5cacf716 100644 --- a/src/plugins/acl/acl_test.c +++ b/src/plugins/acl/acl_test.c @@ -25,6 +25,7 @@ #include #include #include +#include uword unformat_sw_if_index (unformat_input_t * input, va_list * args); @@ -259,42 +260,6 @@ _(MACIP_ACL_INTERFACE_ADD_DEL_REPLY, macip_acl_interface_add_del_reply) \ _(MACIP_ACL_INTERFACE_GET_REPLY, macip_acl_interface_get_reply) \ _(ACL_PLUGIN_GET_VERSION_REPLY, acl_plugin_get_version_reply) -/* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - static int api_acl_plugin_get_version (vat_main_t * vam) { acl_test_main_t * sm = &acl_test_main; @@ -520,7 +485,6 @@ static int api_acl_add_replace (vat_main_t * vam) static int api_acl_del (vat_main_t * vam) { - acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_acl_del_t * mp; @@ -544,7 +508,6 @@ static int api_acl_del (vat_main_t * vam) static int api_macip_acl_del (vat_main_t * vam) { - acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_acl_del_t * mp; @@ -568,7 +531,6 @@ static int api_macip_acl_del (vat_main_t * vam) static int api_acl_interface_add_del (vat_main_t * vam) { - acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_acl_interface_add_del_t * mp; @@ -636,7 +598,6 @@ static int api_acl_interface_add_del (vat_main_t * vam) static int api_macip_acl_interface_add_del (vat_main_t * vam) { - acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_macip_acl_interface_add_del_t * mp; @@ -687,7 +648,6 @@ static int api_macip_acl_interface_add_del (vat_main_t * vam) static int api_acl_interface_set_acl_list (vat_main_t * vam) { - acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_acl_interface_set_acl_list_t * mp; @@ -746,7 +706,6 @@ static int api_acl_interface_set_acl_list (vat_main_t * vam) static int api_acl_interface_list_dump (vat_main_t * vam) { - acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; f64 timeout; u32 sw_if_index = ~0; @@ -775,7 +734,6 @@ static int api_acl_interface_list_dump (vat_main_t * vam) static int api_acl_dump (vat_main_t * vam) { - acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; f64 timeout; u32 acl_index = ~0; @@ -802,7 +760,6 @@ static int api_acl_dump (vat_main_t * vam) static int api_macip_acl_dump (vat_main_t * vam) { - acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; f64 timeout; u32 acl_index = ~0; @@ -978,8 +935,8 @@ _(macip_acl_interface_add_del, " | sw_if_index [add|del] acl msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); if (sm->msg_id_base != (u16) ~0) - vat_api_hookup (vam); + acl_vat_api_hookup (vam); vec_free(name); diff --git a/src/plugins/flowperpkt/flowperpkt_test.c b/src/plugins/flowperpkt/flowperpkt_test.c index 716818ff..9211ebe3 100644 --- a/src/plugins/flowperpkt/flowperpkt_test.c +++ b/src/plugins/flowperpkt/flowperpkt_test.c @@ -19,6 +19,7 @@ #include #include #include +#include /** * @file vpp_api_test plugin @@ -88,47 +89,9 @@ foreach_standard_reply_retval_handler; _(FLOWPERPKT_TX_INTERFACE_ADD_DEL_REPLY, \ flowperpkt_tx_interface_add_del_reply) - -/* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - static int api_flowperpkt_tx_interface_add_del (vat_main_t * vam) { - flowperpkt_test_main_t *sm = &flowperpkt_test_main; unformat_input_t *i = vam->input; f64 timeout; int enable_disable = 1; @@ -177,8 +140,8 @@ api_flowperpkt_tx_interface_add_del (vat_main_t * vam) #define foreach_vpe_api_msg \ _(flowperpkt_tx_interface_add_del, " [disable]") -void -vat_api_hookup (vat_main_t * vam) +static void +flowperpkt_vat_api_hookup (vat_main_t * vam) { flowperpkt_test_main_t *sm = &flowperpkt_test_main; /* Hook up handlers for replies from the data plane plug-in */ @@ -218,7 +181,7 @@ vat_plugin_register (vat_main_t * vam) /* Don't attempt to hook up API messages if the data plane plugin is AWOL */ if (sm->msg_id_base != (u16) ~ 0) - vat_api_hookup (vam); + flowperpkt_vat_api_hookup (vam); vec_free (name); diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c index 494263d9..5b641cc7 100644 --- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c +++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c @@ -23,7 +23,7 @@ #include #include #include - +#include /* Declare message IDs */ #include @@ -86,47 +86,9 @@ foreach_standard_reply_retval_handler; #define foreach_vpe_api_reply_msg \ _(VXLAN_GPE_IOAM_EXPORT_ENABLE_DISABLE_REPLY, vxlan_gpe_ioam_export_enable_disable_reply) - -/* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - static int api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam) { - export_test_main_t *sm = &export_test_main; unformat_input_t *i = vam->input; f64 timeout; int is_disable = 0; @@ -160,8 +122,8 @@ api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam) #define foreach_vpe_api_msg \ _(vxlan_gpe_ioam_export_enable_disable, " [disable]") -void -vat_api_hookup (vat_main_t * vam) +static void +vxlan_gpe_ioam_vat_api_hookup (vat_main_t * vam) { export_test_main_t *sm = &export_test_main; /* Hook up handlers for replies from the data plane plug-in */ @@ -199,7 +161,7 @@ vat_plugin_register (vat_main_t * vam) sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); if (sm->msg_id_base != (u16) ~ 0) - vat_api_hookup (vam); + vxlan_gpe_ioam_vat_api_hookup (vam); vec_free (name); diff --git a/src/plugins/ioam/export/ioam_export_test.c b/src/plugins/ioam/export/ioam_export_test.c index f991fc0c..a4ec80d0 100644 --- a/src/plugins/ioam/export/ioam_export_test.c +++ b/src/plugins/ioam/export/ioam_export_test.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Declare message IDs */ @@ -87,46 +88,9 @@ foreach_standard_reply_retval_handler; _(IOAM_EXPORT_IP6_ENABLE_DISABLE_REPLY, ioam_export_ip6_enable_disable_reply) -/* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - static int api_ioam_export_ip6_enable_disable (vat_main_t * vam) { - export_test_main_t *sm = &export_test_main; unformat_input_t *i = vam->input; f64 timeout; int is_disable = 0; @@ -159,8 +123,8 @@ api_ioam_export_ip6_enable_disable (vat_main_t * vam) #define foreach_vpe_api_msg \ _(ioam_export_ip6_enable_disable, " [disable]") -void -vat_api_hookup (vat_main_t * vam) +static void +ioam_export_vat_api_hookup (vat_main_t * vam) { export_test_main_t *sm = &export_test_main; /* Hook up handlers for replies from the data plane plug-in */ @@ -198,7 +162,7 @@ vat_plugin_register (vat_main_t * vam) sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); if (sm->msg_id_base != (u16) ~ 0) - vat_api_hookup (vam); + ioam_export_vat_api_hookup (vam); vec_free (name); diff --git a/src/plugins/ioam/lib-pot/pot_test.c b/src/plugins/ioam/lib-pot/pot_test.c index 2e870238..9f9d0c99 100644 --- a/src/plugins/ioam/lib-pot/pot_test.c +++ b/src/plugins/ioam/lib-pot/pot_test.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Declare message IDs */ #include @@ -118,48 +119,9 @@ _(POT_PROFILE_ACTIVATE_REPLY, pot_profile_activate_reply) \ _(POT_PROFILE_DEL_REPLY, pot_profile_del_reply) \ _(POT_PROFILE_SHOW_CONFIG_DETAILS, pot_profile_show_config_details) - -/* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - - static int api_pot_profile_add (vat_main_t *vam) { #define MAX_BITS 64 - pot_test_main_t * sm = &pot_test_main; unformat_input_t *input = vam->input; vl_api_pot_profile_add_t *mp; u8 *name = NULL; @@ -234,7 +196,6 @@ OUT: static int api_pot_profile_activate (vat_main_t *vam) { #define MAX_BITS 64 - pot_test_main_t * sm = &pot_test_main; unformat_input_t *input = vam->input; vl_api_pot_profile_activate_t *mp; u8 *name = NULL; @@ -275,7 +236,6 @@ OUT: static int api_pot_profile_del (vat_main_t *vam) { - pot_test_main_t * sm = &pot_test_main; vl_api_pot_profile_del_t *mp; f64 timeout; @@ -287,7 +247,6 @@ static int api_pot_profile_del (vat_main_t *vam) static int api_pot_profile_show_config_dump (vat_main_t *vam) { - pot_test_main_t * sm = &pot_test_main; unformat_input_t *input = vam->input; vl_api_pot_profile_show_config_dump_t *mp; f64 timeout; @@ -320,7 +279,8 @@ _(pot_profile_activate, "name id [0-1] ") \ _(pot_profile_del, "[id ]") \ _(pot_profile_show_config_dump, "id [0-1]") -void vat_api_hookup (vat_main_t *vam) +static void +pot_vat_api_hookup (vat_main_t *vam) { pot_test_main_t * sm = &pot_test_main; /* Hook up handlers for replies from the data plane plug-in */ @@ -357,7 +317,7 @@ clib_error_t * vat_plugin_register (vat_main_t *vam) sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); if (sm->msg_id_base != (u16) ~0) - vat_api_hookup (vam); + pot_vat_api_hookup (vam); vec_free(name); diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c index 111dd461..f4f1d4d5 100644 --- a/src/plugins/ioam/lib-trace/trace_test.c +++ b/src/plugins/ioam/lib-trace/trace_test.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Declare message IDs */ #include @@ -115,48 +116,9 @@ _(TRACE_PROFILE_ADD_REPLY, trace_profile_add_reply) \ _(TRACE_PROFILE_DEL_REPLY, trace_profile_del_reply) \ _(TRACE_PROFILE_SHOW_CONFIG_REPLY, trace_profile_show_config_reply) - -/* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - - static int api_trace_profile_add (vat_main_t * vam) { - trace_test_main_t *sm = &trace_test_main; unformat_input_t *input = vam->input; vl_api_trace_profile_add_t *mp; u8 trace_type = 0; @@ -204,7 +166,6 @@ api_trace_profile_add (vat_main_t * vam) static int api_trace_profile_del (vat_main_t * vam) { - trace_test_main_t *sm = &trace_test_main; vl_api_trace_profile_del_t *mp; f64 timeout; @@ -217,7 +178,6 @@ api_trace_profile_del (vat_main_t * vam) static int api_trace_profile_show_config (vat_main_t * vam) { - trace_test_main_t *sm = &trace_test_main; vl_api_trace_profile_show_config_t *mp; f64 timeout; M (TRACE_PROFILE_SHOW_CONFIG, trace_profile_show_config); @@ -237,8 +197,8 @@ _(trace_profile_del, "[id ]") \ _(trace_profile_show_config, "[id ]") -void -vat_api_hookup (vat_main_t * vam) +static void +ioam_trace_vat_api_hookup (vat_main_t * vam) { trace_test_main_t *sm = &trace_test_main; /* Hook up handlers for replies from the data plane plug-in */ @@ -276,7 +236,7 @@ vat_plugin_register (vat_main_t * vam) sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); if (sm->msg_id_base != (u16) ~ 0) - vat_api_hookup (vam); + ioam_trace_vat_api_hookup (vam); vec_free (name); diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c index b5fee724..7c4088ee 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Declare message IDs */ #include @@ -96,49 +97,9 @@ _(VXLAN_GPE_IOAM_VNI_DISABLE_REPLY, vxlan_gpe_ioam_vni_disable_reply) \ _(VXLAN_GPE_IOAM_TRANSIT_ENABLE_REPLY, vxlan_gpe_ioam_transit_enable_reply) \ _(VXLAN_GPE_IOAM_TRANSIT_DISABLE_REPLY, vxlan_gpe_ioam_transit_disable_reply) \ - -/* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - - static int api_vxlan_gpe_ioam_enable (vat_main_t * vam) { - vxlan_gpe_test_main_t *sm = &vxlan_gpe_test_main; - unformat_input_t *input = vam->input; vl_api_vxlan_gpe_ioam_enable_t *mp; f64 timeout; @@ -179,7 +140,6 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam) static int api_vxlan_gpe_ioam_disable (vat_main_t * vam) { - vxlan_gpe_test_main_t *sm = &vxlan_gpe_test_main; vl_api_vxlan_gpe_ioam_disable_t *mp; f64 timeout; @@ -192,8 +152,6 @@ api_vxlan_gpe_ioam_disable (vat_main_t * vam) static int api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) { - vxlan_gpe_test_main_t *sm = &vxlan_gpe_test_main; - unformat_input_t *line_input = vam->input; vl_api_vxlan_gpe_ioam_vni_enable_t *mp; ip4_address_t local4, remote4; @@ -289,8 +247,6 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) static int api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) { - vxlan_gpe_test_main_t *sm = &vxlan_gpe_test_main; - unformat_input_t *line_input = vam->input; vl_api_vxlan_gpe_ioam_vni_disable_t *mp; ip4_address_t local4, remote4; @@ -386,8 +342,6 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) static int api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) { - vxlan_gpe_test_main_t *sm = &vxlan_gpe_test_main; - unformat_input_t *line_input = vam->input; vl_api_vxlan_gpe_ioam_transit_enable_t *mp; ip4_address_t local4; @@ -458,8 +412,6 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) static int api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam) { - vxlan_gpe_test_main_t *sm = &vxlan_gpe_test_main; - unformat_input_t *line_input = vam->input; vl_api_vxlan_gpe_ioam_transit_disable_t *mp; ip4_address_t local4; @@ -545,8 +497,8 @@ _(vxlan_gpe_ioam_transit_disable, ""\ "dst-ip [outer-fib-index ]") \ -void -vat_api_hookup (vat_main_t * vam) +static void +vxlan_gpe_vat_api_hookup (vat_main_t * vam) { vxlan_gpe_test_main_t *sm = &vxlan_gpe_test_main; /* Hook up handlers for replies from the data plane plug-in */ @@ -584,7 +536,7 @@ vat_plugin_register (vat_main_t * vam) sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); if (sm->msg_id_base != (u16) ~ 0) - vat_api_hookup (vam); + vxlan_gpe_vat_api_hookup (vam); vec_free (name); diff --git a/src/plugins/lb/lb_test.c b/src/plugins/lb/lb_test.c index 8c2eaa91..7e3519a8 100644 --- a/src/plugins/lb/lb_test.c +++ b/src/plugins/lb/lb_test.c @@ -19,6 +19,7 @@ #include #include #include +#include //TODO: Move that to vat/plugin_api.c ////////////////////////// @@ -127,35 +128,8 @@ foreach_standard_reply_retval_handler; _(LB_ADD_DEL_VIP_REPLY, lb_add_del_vip_reply) \ _(LB_ADD_DEL_AS_REPLY, lb_add_del_as_reply) -/* M: construct, but don't yet send a message */ -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memcpy (mp, &mps, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + lbtm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - static int api_lb_conf (vat_main_t * vam) { - lb_test_main_t *lbtm = &lb_test_main; unformat_input_t *i = vam->input; f64 timeout; vl_api_lb_conf_t mps, *mp; @@ -177,7 +151,6 @@ static int api_lb_conf (vat_main_t * vam) static int api_lb_add_del_vip (vat_main_t * vam) { - lb_test_main_t *lbtm = &lb_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_lb_add_del_vip_t mps, *mp; @@ -215,7 +188,6 @@ static int api_lb_add_del_vip (vat_main_t * vam) static int api_lb_add_del_as (vat_main_t * vam) { - lb_test_main_t *lbtm = &lb_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_lb_add_del_as_t mps, *mp; @@ -246,7 +218,8 @@ _(lb_conf, " [gre4|gre6] [del]") \ _(lb_add_del_as, "
[del]") -void vat_api_hookup (vat_main_t *vam) +static void +lb_vat_api_hookup (vat_main_t *vam) { lb_test_main_t * lbtm = &lb_test_main; /* Hook up handlers for replies from the data plane plug-in */ @@ -285,7 +258,7 @@ clib_error_t * vat_plugin_register (vat_main_t *vam) lbtm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); if (lbtm->msg_id_base != (u16) ~0) - vat_api_hookup (vam); + lb_vat_api_hookup (vam); vec_free(name); diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c index 013d7d9b..b601d7d9 100644 --- a/src/plugins/snat/snat_test.c +++ b/src/plugins/snat/snat_test.c @@ -21,6 +21,7 @@ #include #include #include +#include uword unformat_sw_if_index (unformat_input_t * input, va_list * args); @@ -103,44 +104,8 @@ _(SNAT_INTERFACE_ADDR_DETAILS, snat_interface_addr_details) \ _(SNAT_IPFIX_ENABLE_DISABLE_REPLY, \ snat_ipfix_enable_disable_reply) -/* M: construct, but don't yet send a message */ -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - } \ - return -99; \ -} while(0); - static int api_snat_add_address_range (vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; unformat_input_t * i = vam->input; f64 timeout; ip4_address_t start_addr, end_addr; @@ -200,7 +165,6 @@ static int api_snat_add_address_range (vat_main_t * vam) static int api_snat_interface_add_del_feature (vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_snat_interface_add_del_feature_t * mp; @@ -246,7 +210,6 @@ static int api_snat_interface_add_del_feature (vat_main_t * vam) static int api_snat_add_static_mapping(vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_snat_add_static_mapping_t * mp; @@ -338,7 +301,6 @@ static void vl_api_snat_static_mapping_details_t_handler static int api_snat_static_mapping_dump(vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; f64 timeout; vl_api_snat_static_mapping_dump_t * mp; @@ -398,7 +360,6 @@ static void vl_api_snat_show_config_reply_t_handler static int api_snat_show_config(vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; f64 timeout; vl_api_snat_show_config_t * mp; @@ -425,7 +386,6 @@ static void vl_api_snat_address_details_t_handler static int api_snat_address_dump(vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; f64 timeout; vl_api_snat_address_dump_t * mp; @@ -460,7 +420,6 @@ static void vl_api_snat_interface_details_t_handler static int api_snat_interface_dump(vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; f64 timeout; vl_api_snat_interface_dump_t * mp; @@ -485,7 +444,6 @@ static int api_snat_interface_dump(vat_main_t * vam) static int api_snat_set_workers (vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_snat_set_workers_t * mp; @@ -523,7 +481,6 @@ static void vl_api_snat_worker_details_t_handler static int api_snat_worker_dump(vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; f64 timeout; vl_api_snat_worker_dump_t * mp; @@ -548,7 +505,6 @@ static int api_snat_worker_dump(vat_main_t * vam) static int api_snat_ipfix_enable_disable (vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_snat_add_del_interface_addr_t * mp; @@ -597,7 +553,6 @@ static void vl_api_snat_interface_addr_details_t_handler static int api_snat_interface_addr_dump(vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; f64 timeout; vl_api_snat_interface_addr_dump_t * mp; @@ -622,7 +577,6 @@ static int api_snat_interface_addr_dump(vat_main_t * vam) static int api_snat_add_del_interface_addr (vat_main_t * vam) { - snat_test_main_t * sm = &snat_test_main; unformat_input_t * i = vam->input; f64 timeout; vl_api_snat_ipfix_enable_disable_t * mp; @@ -677,7 +631,8 @@ _(snat_interface_addr_dump, "") \ _(snat_ipfix_enable_disable, "[domain ] [src_port ] " \ "[disable]") -void vat_api_hookup (vat_main_t *vam) +static void +snat_vat_api_hookup (vat_main_t *vam) { snat_test_main_t * sm __attribute__((unused)) = &snat_test_main; /* Hook up handlers for replies from the data plane plug-in */ @@ -693,7 +648,9 @@ void vat_api_hookup (vat_main_t *vam) #undef _ /* API messages we can send */ -#define _(n,h) hash_set_mem (vam->function_by_name, #n, api_##n); +#define _(n,h) \ + hash_set_mem (vam->function_by_name, #n, api_##n); \ + clib_warning ("vam %llx add '%s' handler %llx", vam, #n, api_##n); foreach_vpe_api_msg; #undef _ @@ -715,7 +672,7 @@ clib_error_t * vat_plugin_register (vat_main_t *vam) sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); if (sm->msg_id_base != (u16) ~0) - vat_api_hookup (vam); + snat_vat_api_hookup (vam); vec_free(name); diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 1babaf40..653cf79f 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -70,6 +70,46 @@ #include #undef vl_printfun +#include + +f64 +vat_time_now (vat_main_t * vam) +{ +#if VPP_API_TEST_BUILTIN + return vlib_time_now (vam->vlib_main); +#else + return clib_time_now (&vam->clib_time); +#endif +} + +void +errmsg (char *fmt, ...) +{ + vat_main_t *vam = &vat_main; + va_list va; + u8 *s; + + va_start (va, fmt); + s = va_format (0, fmt, &va); + va_end (va); + + vec_add1 (s, 0); + +#if VPP_API_TEST_BUILTIN + vlib_cli_output (vam->vlib_main, (char *) s); +#else + { + if (vam->ifp != stdin) + fformat (vam->ofp, "%s(%d): \n", vam->current_file, + vam->input_line_number); + fformat (vam->ofp, (char *) s); + fflush (vam->ofp); + } +#endif + + vec_free (s); +} + static uword api_unformat_sw_if_index (unformat_input_t * input, va_list * args) { @@ -88,8 +128,6 @@ api_unformat_sw_if_index (unformat_input_t * input, va_list * args) return 1; } -void vat_suspend (vlib_main_t * vm, f64 interval); - #if VPP_API_TEST_BUILTIN == 0 /* Parse an IP4 address %d.%d.%d.%d. */ uword @@ -3867,59 +3905,6 @@ _(SW_INTERFACE_SET_DPDK_HQOS_TCTBL_REPLY, \ sw_interface_set_dpdk_hqos_tctbl_reply) #endif -/* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T); \ - mp->client_index = vam->my_client_index; \ -} while(0); - -#define M2(T,t,n) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)+(n)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T); \ - mp->client_index = vam->my_client_index; \ -} while(0); - - -/* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) - -/* W: wait for results, with timeout */ -#define W \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - return (vam->retval); \ - } \ - vat_suspend (vam->vlib_main, 1e-3); \ - } \ - return -99; \ -} while(0); - -/* W2: wait for results, with timeout */ -#define W2(body) \ -do { \ - timeout = vat_time_now (vam) + 1.0; \ - \ - while (vat_time_now (vam) < timeout) { \ - if (vam->result_ready == 1) { \ - (body); \ - return (vam->retval); \ - } \ - vat_suspend (vam->vlib_main, 1e-3); \ - } \ - return -99; \ -} while(0); - typedef struct { u8 *name; diff --git a/src/vat/vat.h b/src/vat/vat.h index 64be2f7f..3d7d96ae 100644 --- a/src/vat/vat.h +++ b/src/vat/vat.h @@ -190,36 +190,11 @@ typedef struct vlib_main_t *vlib_main; } vat_main_t; -vat_main_t vat_main; - -static inline f64 -vat_time_now (vat_main_t * vam) -{ -#if VPP_API_TEST_BUILTIN - return vlib_time_now (vam->vlib_main); -#else - return clib_time_now (&vam->clib_time); -#endif -} - -#if VPP_API_TEST_BUILTIN -#define errmsg(fmt,args...) \ -do { \ - vat_main_t *__vam = &vat_main; \ - vlib_cli_output (__vam->vlib_main, fmt, ##args); \ - } while(0); -#else -#define errmsg(fmt,args...) \ -do { \ - vat_main_t *__vam = &vat_main; \ - if(__vam->ifp != stdin) \ - fformat(__vam->ofp,"%s(%d): \n", __vam->current_file, \ - __vam->input_line_number); \ - fformat(__vam->ofp, fmt "\n", ##args); \ - fflush(__vam->ofp); \ -} while(0); -#endif +extern vat_main_t vat_main; +void vat_suspend (vlib_main_t * vm, f64 interval); +f64 vat_time_now (vat_main_t * vam); +void errmsg (char *fmt, ...); void vat_api_hookup (vat_main_t * vam); int api_sw_interface_dump (vat_main_t * vam); void do_one_file (vat_main_t * vam); diff --git a/src/vlib/unix/plugin.c b/src/vlib/unix/plugin.c index 987f7d05..40399090 100644 --- a/src/vlib/unix/plugin.c +++ b/src/vlib/unix/plugin.c @@ -264,10 +264,15 @@ vlib_plugins_show_cmd_fn (vlib_main_t * vm, return 0; } +/* *INDENT-OFF* */ VLIB_CLI_COMMAND (plugins_show_cmd, static) = { -.path = "show plugins",.short_help = "show loaded plugins",.function = - vlib_plugins_show_cmd_fn,}; + .path = "show plugins", + .short_help = "show loaded plugins", + .function = vlib_plugins_show_cmd_fn, +}; +/* *INDENT-ON* */ + /* * fd.io coding-style-patch-verification: ON * diff --git a/src/vlibapi/api_helper_macros.h b/src/vlibapi/api_helper_macros.h index 16f34cfc..7f94e446 100644 --- a/src/vlibapi/api_helper_macros.h +++ b/src/vlibapi/api_helper_macros.h @@ -17,7 +17,6 @@ *------------------------------------------------------------------ */ - #ifndef __api_helper_macros_h__ #define __api_helper_macros_h__ diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h new file mode 100644 index 00000000..7199364a --- /dev/null +++ b/src/vlibapi/vat_helper_macros.h @@ -0,0 +1,76 @@ +/* + *------------------------------------------------------------------ + * vat_helper_macros.h - collect api client helper macros in one place + * + * Copyright (c) 2016 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------ + */ +#ifndef __vat_helper_macros_h__ +#define __vat_helper_macros_h__ + +/* M: construct, but don't yet send a message */ + +#define M(T,t) \ +do { \ + vam->result_ready = 0; \ + mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)); \ + memset (mp, 0, sizeof (*mp)); \ + mp->_vl_msg_id = ntohs (VL_API_##T); \ + mp->client_index = vam->my_client_index; \ +} while(0); + +#define M2(T,t,n) \ +do { \ + vam->result_ready = 0; \ + mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)+(n)); \ + memset (mp, 0, sizeof (*mp)); \ + mp->_vl_msg_id = ntohs (VL_API_##T); \ + mp->client_index = vam->my_client_index; \ +} while(0); + + +/* S: send a message */ +#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) + +/* W: wait for results, with timeout */ +#define W \ +do { \ + timeout = vat_time_now (vam) + 1.0; \ + \ + while (vat_time_now (vam) < timeout) { \ + if (vam->result_ready == 1) { \ + return (vam->retval); \ + } \ + vat_suspend (vam->vlib_main, 1e-5); \ + } \ + return -99; \ +} while(0); + +/* W2: wait for results, with timeout */ +#define W2(body) \ +do { \ + timeout = vat_time_now (vam) + 1.0; \ + \ + while (vat_time_now (vam) < timeout) { \ + if (vam->result_ready == 1) { \ + (body); \ + return (vam->retval); \ + } \ + vat_suspend (vam->vlib_main, 1e-5); \ + } \ + return -99; \ +} while(0); + + +#endif /* __vat_helper_macros_h__ */ diff --git a/src/vpp-api-test.am b/src/vpp-api-test.am index 32610056..f0d5df62 100644 --- a/src/vpp-api-test.am +++ b/src/vpp-api-test.am @@ -44,7 +44,10 @@ vpp_api_test_LDADD = \ libvnet.la \ -lpthread -lm -lrt -ldl -lcrypto +vpp_api_test_LDFLAGS = -Wl,--export-dynamic + vpp_json_test_LDADD = libvppinfra.la -lm +vpp_json_test_LDFLAGS = -Wl,--export-dynamic nobase_include_HEADERS += \ vat/vat.h \ diff --git a/src/vpp.am b/src/vpp.am index 425f1e32..0b605ec5 100644 --- a/src/vpp.am +++ b/src/vpp.am @@ -28,7 +28,9 @@ bin_vpp_SOURCES += \ if WITH_APICLI bin_vpp_SOURCES += \ vpp/api/api_format.c \ - vpp/api/api_main.c + vpp/api/api_main.c \ + vpp/api/plugin.c \ + vpp/api/plugin.h endif # comment out to disable stats upload to gmond @@ -78,6 +80,8 @@ bin_vpp_LDADD = \ libvppinfra.la \ -lrt -lm -lpthread -ldl +bin_vpp_LDFLAGS = -Wl,--export-dynamic + if ENABLE_TESTS noinst_PROGRAMS += bin/test_client diff --git a/src/vpp/api/api_main.c b/src/vpp/api/api_main.c index fd6998f4..7bf7e8b7 100644 --- a/src/vpp/api/api_main.c +++ b/src/vpp/api/api_main.c @@ -42,11 +42,17 @@ static clib_error_t * api_main_init (vlib_main_t * vm) { vat_main_t *vam = &vat_main; + int rv; + int vat_plugin_init (vat_main_t * vam); vam->vlib_main = vm; vam->my_client_index = (u32) ~ 0; init_error_string_table (vam); vat_api_hookup (vam); + clib_warning ("vam %llx", vam); + rv = vat_plugin_init (vam); + if (rv) + clib_warning ("vat_plugin_init returned %d", rv); return 0; } @@ -183,6 +189,39 @@ api_cli_output (void *notused, const char *fmt, ...) vec_free (s); } +u16 +vl_client_get_first_plugin_msg_id (char *plugin_name) +{ + api_main_t *am = &api_main; + vl_api_msg_range_t *rp; + uword *p; + + p = hash_get_mem (am->msg_range_by_name, plugin_name); + if (p == 0) + return ~0; + + rp = vec_elt_at_index (am->msg_ranges, p[0]); + + return (rp->first_msg_id); +} + +uword +unformat_sw_if_index (unformat_input_t * input, va_list * args) +{ + u32 *result = va_arg (*args, u32 *); + vnet_main_t *vnm = vnet_get_main (); + u32 sw_if_index = ~0; + u8 *if_name; + uword *p; + + if (unformat (input, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index)) + { + *result = sw_if_index; + return 1; + } + return 0; +} + /* * fd.io coding-style-patch-verification: ON * diff --git a/src/vpp/api/plugin.c b/src/vpp/api/plugin.c new file mode 100644 index 00000000..c1cc928c --- /dev/null +++ b/src/vpp/api/plugin.c @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2015 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * plugin.c: plugin handling + */ + +#include +#include +#include +#include + +plugin_main_t vat_plugin_main; + +static int +load_one_plugin (plugin_main_t * pm, plugin_info_t * pi) +{ + void *handle, *register_handle; + clib_error_t *(*fp) (vat_main_t *); + clib_error_t *error; + + handle = dlopen ((char *) pi->name, RTLD_LAZY); + + /* + * Note: this can happen if the plugin has an undefined symbol reference, + * so print a warning. Otherwise, the poor slob won't know what happened. + * Ask me how I know that... + */ + if (handle == 0) + { + clib_warning ("%s", dlerror ()); + return -1; + } + + pi->handle = handle; + + register_handle = dlsym (pi->handle, "vat_plugin_register"); + if (register_handle == 0) + return 0; + + fp = register_handle; + + error = (*fp) (pm->vat_main); + + if (error) + { + clib_error_report (error); + dlclose (handle); + return 1; + } + + clib_warning ("Loaded plugin: %s", pi->name); + + return 0; +} + +static u8 ** +split_plugin_path (plugin_main_t * pm) +{ + int i; + u8 **rv = 0; + u8 *path = pm->plugin_path; + u8 *this = 0; + + for (i = 0; i < vec_len (pm->plugin_path); i++) + { + if (path[i] != ':') + { + vec_add1 (this, path[i]); + continue; + } + vec_add1 (this, 0); + vec_add1 (rv, this); + this = 0; + } + if (this) + { + vec_add1 (this, 0); + vec_add1 (rv, this); + } + return rv; +} + +int +vat_load_new_plugins (plugin_main_t * pm) +{ + DIR *dp; + struct dirent *entry; + struct stat statb; + uword *p; + plugin_info_t *pi; + u8 **plugin_path; + int i; + + plugin_path = split_plugin_path (pm); + + for (i = 0; i < vec_len (plugin_path); i++) + { + dp = opendir ((char *) plugin_path[i]); + + if (dp == 0) + continue; + + while ((entry = readdir (dp))) + { + u8 *plugin_name; + + if (pm->plugin_name_filter) + { + int j; + for (j = 0; j < vec_len (pm->plugin_name_filter); j++) + if (entry->d_name[j] != pm->plugin_name_filter[j]) + goto next; + } + + plugin_name = format (0, "%s/%s%c", plugin_path[i], + entry->d_name, 0); + + /* unreadable */ + if (stat ((char *) plugin_name, &statb) < 0) + { + ignore: + vec_free (plugin_name); + continue; + } + + /* a dir or other things which aren't plugins */ + if (!S_ISREG (statb.st_mode)) + goto ignore; + + p = hash_get_mem (pm->plugin_by_name_hash, plugin_name); + if (p == 0) + { + vec_add2 (pm->plugin_info, pi, 1); + pi->name = plugin_name; + pi->file_info = statb; + + if (load_one_plugin (pm, pi)) + { + vec_free (plugin_name); + _vec_len (pm->plugin_info) = vec_len (pm->plugin_info) - 1; + continue; + } + memset (pi, 0, sizeof (*pi)); + hash_set_mem (pm->plugin_by_name_hash, plugin_name, + pi - pm->plugin_info); + } + next: + ; + } + closedir (dp); + vec_free (plugin_path[i]); + } + vec_free (plugin_path); + return 0; +} + +#define QUOTE_(x) #x +#define QUOTE(x) QUOTE_(x) + +/* + * Load plugins from /usr/lib/vpp_api_test_plugins by default + */ +char *vat_plugin_path = "/usr/lib/vpp_api_test_plugins"; + +char *vat_plugin_name_filter = 0; + +int +vat_plugin_init (vat_main_t * vam) +{ + plugin_main_t *pm = &vat_plugin_main; + + + pm->plugin_path = format (0, "%s%c", vat_plugin_path, 0); + if (vat_plugin_name_filter) + pm->plugin_name_filter = format (0, "%s%c", vat_plugin_name_filter, 0); + + pm->plugin_by_name_hash = hash_create_string (0, sizeof (uword)); + pm->vat_main = vam; + + return vat_load_new_plugins (pm); +} + +/* + * fd.io coding-style-patch-verification: ON + * + * Local Variables: + * eval: (c-set-style "gnu") + * End: + */ diff --git a/src/vpp/api/plugin.h b/src/vpp/api/plugin.h new file mode 100644 index 00000000..559ec52f --- /dev/null +++ b/src/vpp/api/plugin.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2015 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * plugin.h: plugin handling + */ + +#ifndef __included_plugin_h__ +#define __included_plugin_h__ + +#include +#include +#include + +typedef struct +{ + u8 *name; + struct stat file_info; + void *handle; +} plugin_info_t; + +typedef struct +{ + /* loaded plugin info */ + plugin_info_t *plugin_info; + uword *plugin_by_name_hash; + + /* path and name filter */ + u8 *plugin_path; + u8 *plugin_name_filter; + + /* convenience */ + vat_main_t *vat_main; + +} plugin_main_t; + +plugin_main_t vat_plugin_main; + +int vat_plugin_init (vat_main_t * vam); +int vat_load_new_plugins (plugin_main_t * pm); + +#endif + +/* + * fd.io coding-style-patch-verification: ON + * + * Local Variables: + * eval: (c-set-style "gnu") + * End: + */ -- cgit 1.2.3-korg From 2d6b2d6d1bbb130921ec525a1cc6e88f42717c79 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 25 Jan 2017 16:32:08 -0500 Subject: Repair plugin binary API message numbering Change-Id: I422a3f168bd483e011cfaf54af022cb79b78db02 Signed-off-by: Dave Barach --- src/examples/sample-plugin/sample/sample_test.c | 2 ++ src/plugins/acl/acl_test.c | 2 ++ src/plugins/flowperpkt/flowperpkt_test.c | 2 ++ .../ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c | 2 ++ src/plugins/ioam/export/ioam_export_test.c | 2 ++ src/plugins/ioam/lib-pot/pot_test.c | 2 ++ src/plugins/ioam/lib-trace/trace_test.c | 2 ++ src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c | 2 ++ src/plugins/lb/lb_test.c | 2 ++ src/plugins/snat/snat_test.c | 2 ++ src/vat/api_format.c | 1 + src/vlibapi/vat_helper_macros.h | 18 ++++++++---------- 12 files changed, 29 insertions(+), 10 deletions(-) (limited to 'src/plugins/ioam/lib-pot/pot_test.c') diff --git a/src/examples/sample-plugin/sample/sample_test.c b/src/examples/sample-plugin/sample/sample_test.c index a47710ee..2308e8f4 100644 --- a/src/examples/sample-plugin/sample/sample_test.c +++ b/src/examples/sample-plugin/sample/sample_test.c @@ -23,6 +23,8 @@ #include #include #include + +#define __plugin_msg_base sample_test_main.msg_id_base #include uword unformat_sw_if_index (unformat_input_t * input, va_list * args); diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c index 5cacf716..4ea6bcc8 100644 --- a/src/plugins/acl/acl_test.c +++ b/src/plugins/acl/acl_test.c @@ -25,6 +25,8 @@ #include #include #include + +#define __plugin_msg_base acl_test_main.msg_id_base #include uword unformat_sw_if_index (unformat_input_t * input, va_list * args); diff --git a/src/plugins/flowperpkt/flowperpkt_test.c b/src/plugins/flowperpkt/flowperpkt_test.c index 9211ebe3..4dcfdf05 100644 --- a/src/plugins/flowperpkt/flowperpkt_test.c +++ b/src/plugins/flowperpkt/flowperpkt_test.c @@ -19,6 +19,8 @@ #include #include #include + +#define __plugin_msg_base flowperpkt_test_main.msg_id_base #include /** diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c index 5b641cc7..d35bf399 100644 --- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c +++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c @@ -23,6 +23,8 @@ #include #include #include + +#define __plugin_msg_base export_test_main.msg_id_base #include /* Declare message IDs */ diff --git a/src/plugins/ioam/export/ioam_export_test.c b/src/plugins/ioam/export/ioam_export_test.c index a4ec80d0..8bfee583 100644 --- a/src/plugins/ioam/export/ioam_export_test.c +++ b/src/plugins/ioam/export/ioam_export_test.c @@ -23,6 +23,8 @@ #include #include #include + +#define __plugin_msg_base export_test_main.msg_id_base #include diff --git a/src/plugins/ioam/lib-pot/pot_test.c b/src/plugins/ioam/lib-pot/pot_test.c index 9f9d0c99..deeb563c 100644 --- a/src/plugins/ioam/lib-pot/pot_test.c +++ b/src/plugins/ioam/lib-pot/pot_test.c @@ -23,6 +23,8 @@ #include #include #include + +#define __plugin_msg_base pot_test_main.msg_id_base #include /* Declare message IDs */ diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c index f4f1d4d5..0ccb675e 100644 --- a/src/plugins/ioam/lib-trace/trace_test.c +++ b/src/plugins/ioam/lib-trace/trace_test.c @@ -23,6 +23,8 @@ #include #include #include + +#define __plugin_msg_base trace_test_main.msg_id_base #include /* Declare message IDs */ diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c index 7c4088ee..0748c5b7 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c @@ -23,6 +23,8 @@ #include #include #include + +#define __plugin_msg_base vxlan_gpe_test_main.msg_id_base #include /* Declare message IDs */ diff --git a/src/plugins/lb/lb_test.c b/src/plugins/lb/lb_test.c index 7e3519a8..9d55e4a7 100644 --- a/src/plugins/lb/lb_test.c +++ b/src/plugins/lb/lb_test.c @@ -19,6 +19,8 @@ #include #include #include + +#define __plugin_msg_base lb_test_main.msg_id_base #include //TODO: Move that to vat/plugin_api.c diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c index 67dc4380..db53470c 100644 --- a/src/plugins/snat/snat_test.c +++ b/src/plugins/snat/snat_test.c @@ -21,6 +21,8 @@ #include #include #include + +#define __plugin_msg_base snat_test_main.msg_id_base #include uword unformat_sw_if_index (unformat_input_t * input, va_list * args); diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 839bcdaa..b83313de 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -70,6 +70,7 @@ #include #undef vl_printfun +#define __plugin_msg_base 0 #include f64 diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h index 7199364a..dc91c9f5 100644 --- a/src/vlibapi/vat_helper_macros.h +++ b/src/vlibapi/vat_helper_macros.h @@ -20,14 +20,13 @@ #define __vat_helper_macros_h__ /* M: construct, but don't yet send a message */ - -#define M(T,t) \ -do { \ - vam->result_ready = 0; \ - mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)); \ - memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T); \ - mp->client_index = vam->my_client_index; \ +#define M(T,t) \ +do { \ + vam->result_ready = 0; \ + mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)); \ + memset (mp, 0, sizeof (*mp)); \ + mp->_vl_msg_id = ntohs (VL_API_##T+__plugin_msg_base); \ + mp->client_index = vam->my_client_index; \ } while(0); #define M2(T,t,n) \ @@ -35,11 +34,10 @@ do { \ vam->result_ready = 0; \ mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)+(n)); \ memset (mp, 0, sizeof (*mp)); \ - mp->_vl_msg_id = ntohs (VL_API_##T); \ + mp->_vl_msg_id = ntohs (VL_API_##T+__plugin_msg_base); \ mp->client_index = vam->my_client_index; \ } while(0); - /* S: send a message */ #define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) -- cgit 1.2.3-korg From 8a2aea3fce9dad7c729c82ee39ce95b4f357bc83 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Tue, 31 Jan 2017 13:19:40 -0600 Subject: Ensure all M() and M2() second parameters are the message pointer. Rather than maintain (?) an unused second parameter, t, and pull an unbound message pointer, mp, out of context, explicitly list the message pointer as the second parameter. Change-Id: I92143efda6211cdf6b935470f8c71579742a6b64 Signed-off-by: Jon Loeliger --- build-root/emacs-lisp/plugin-test-skel.el | 2 +- src/examples/sample-plugin/sample/sample_test.c | 2 +- src/plugins/acl/acl_test.c | 16 +- src/plugins/flowperpkt/flowperpkt_test.c | 2 +- .../export-vxlan-gpe/vxlan_gpe_ioam_export_test.c | 3 +- src/plugins/ioam/export/ioam_export_test.c | 2 +- src/plugins/ioam/lib-pot/pot_test.c | 8 +- src/plugins/ioam/lib-trace/trace_test.c | 6 +- src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c | 12 +- src/plugins/lb/lb_test.c | 12 +- src/plugins/snat/snat_test.c | 34 +- src/vat/api_format.c | 470 ++++++++++----------- 12 files changed, 285 insertions(+), 284 deletions(-) (limited to 'src/plugins/ioam/lib-pot/pot_test.c') diff --git a/build-root/emacs-lisp/plugin-test-skel.el b/build-root/emacs-lisp/plugin-test-skel.el index 5231a236..23f792fa 100644 --- a/build-root/emacs-lisp/plugin-test-skel.el +++ b/build-root/emacs-lisp/plugin-test-skel.el @@ -170,7 +170,7 @@ static int api_" plugin-name "_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M(" PLUGIN-NAME "_ENABLE_DISABLE, " plugin-name "_enable_disable); + M(" PLUGIN-NAME "_ENABLE_DISABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable_disable = enable_disable; diff --git a/src/examples/sample-plugin/sample/sample_test.c b/src/examples/sample-plugin/sample/sample_test.c index 2308e8f4..5dcee809 100644 --- a/src/examples/sample-plugin/sample/sample_test.c +++ b/src/examples/sample-plugin/sample/sample_test.c @@ -117,7 +117,7 @@ static int api_sample_macswap_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M(SAMPLE_MACSWAP_ENABLE_DISABLE, sample_macswap_enable_disable); + M(SAMPLE_MACSWAP_ENABLE_DISABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable_disable = enable_disable; diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c index 4ea6bcc8..04683a12 100644 --- a/src/plugins/acl/acl_test.c +++ b/src/plugins/acl/acl_test.c @@ -498,7 +498,7 @@ static int api_acl_del (vat_main_t * vam) } /* Construct the API message */ - M(ACL_DEL, acl_del); + M(ACL_DEL, mp); mp->acl_index = ntohl(acl_index); /* send it... */ @@ -521,7 +521,7 @@ static int api_macip_acl_del (vat_main_t * vam) } /* Construct the API message */ - M(MACIP_ACL_DEL, acl_del); + M(MACIP_ACL_DEL, mp); mp->acl_index = ntohl(acl_index); /* send it... */ @@ -585,7 +585,7 @@ static int api_acl_interface_add_del (vat_main_t * vam) /* Construct the API message */ - M(ACL_INTERFACE_ADD_DEL, acl_interface_add_del); + M(ACL_INTERFACE_ADD_DEL, mp); mp->acl_index = ntohl(acl_index); mp->sw_if_index = ntohl(sw_if_index); mp->is_add = is_add; @@ -636,7 +636,7 @@ static int api_macip_acl_interface_add_del (vat_main_t * vam) /* Construct the API message */ - M(MACIP_ACL_INTERFACE_ADD_DEL, macip_acl_interface_add_del); + M(MACIP_ACL_INTERFACE_ADD_DEL, mp); mp->acl_index = ntohl(acl_index); mp->sw_if_index = ntohl(sw_if_index); mp->is_add = is_add; @@ -690,7 +690,7 @@ static int api_acl_interface_set_acl_list (vat_main_t * vam) } /* Construct the API message */ - M2(ACL_INTERFACE_SET_ACL_LIST, acl_interface_set_acl_list, sizeof(u32) * (vec_len(inacls) + vec_len(outacls))); + M2(ACL_INTERFACE_SET_ACL_LIST, mp, sizeof(u32) * (vec_len(inacls) + vec_len(outacls))); mp->sw_if_index = ntohl(sw_if_index); mp->n_input = vec_len(inacls); mp->count = vec_len(inacls) + vec_len(outacls); @@ -724,7 +724,7 @@ static int api_acl_interface_list_dump (vat_main_t * vam) } /* Construct the API message */ - M(ACL_INTERFACE_LIST_DUMP, acl_interface_list_dump); + M(ACL_INTERFACE_LIST_DUMP, mp); mp->sw_if_index = ntohl (sw_if_index); /* send it... */ @@ -750,7 +750,7 @@ static int api_acl_dump (vat_main_t * vam) } /* Construct the API message */ - M(ACL_DUMP, acl_dump); + M(ACL_DUMP, mp); mp->acl_index = ntohl (acl_index); /* send it... */ @@ -776,7 +776,7 @@ static int api_macip_acl_dump (vat_main_t * vam) } /* Construct the API message */ - M(MACIP_ACL_DUMP, macip_acl_dump); + M(MACIP_ACL_DUMP, mp); mp->acl_index = ntohl (acl_index); /* send it... */ diff --git a/src/plugins/flowperpkt/flowperpkt_test.c b/src/plugins/flowperpkt/flowperpkt_test.c index 4dcfdf05..70b4a34a 100644 --- a/src/plugins/flowperpkt/flowperpkt_test.c +++ b/src/plugins/flowperpkt/flowperpkt_test.c @@ -123,7 +123,7 @@ api_flowperpkt_tx_interface_add_del (vat_main_t * vam) } /* Construct the API message */ - M (FLOWPERPKT_TX_INTERFACE_ADD_DEL, flowperpkt_tx_interface_add_del); + M (FLOWPERPKT_TX_INTERFACE_ADD_DEL, mp); mp->sw_if_index = ntohl (sw_if_index); mp->is_add = enable_disable; mp->which = which; diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c index d35bf399..b9f61d9a 100644 --- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c +++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c @@ -106,8 +106,7 @@ api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M (VXLAN_GPE_IOAM_EXPORT_ENABLE_DISABLE, - vxlan_gpe_ioam_export_enable_disable); + M (VXLAN_GPE_IOAM_EXPORT_ENABLE_DISABLE, mp); mp->is_disable = is_disable; /* send it... */ diff --git a/src/plugins/ioam/export/ioam_export_test.c b/src/plugins/ioam/export/ioam_export_test.c index 8bfee583..b9686058 100644 --- a/src/plugins/ioam/export/ioam_export_test.c +++ b/src/plugins/ioam/export/ioam_export_test.c @@ -108,7 +108,7 @@ api_ioam_export_ip6_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M (IOAM_EXPORT_IP6_ENABLE_DISABLE, ioam_export_ip6_enable_disable); + M(IOAM_EXPORT_IP6_ENABLE_DISABLE, mp); mp->is_disable = is_disable; /* send it... */ diff --git a/src/plugins/ioam/lib-pot/pot_test.c b/src/plugins/ioam/lib-pot/pot_test.c index deeb563c..48d5bd40 100644 --- a/src/plugins/ioam/lib-pot/pot_test.c +++ b/src/plugins/ioam/lib-pot/pot_test.c @@ -168,7 +168,7 @@ static int api_pot_profile_add (vat_main_t *vam) goto OUT; } - M2(POT_PROFILE_ADD, pot_profile_add, vec_len(name)); + M2(POT_PROFILE_ADD, mp, vec_len(name)); mp->list_name_len = vec_len(name); clib_memcpy(mp->list_name, name, mp->list_name_len); @@ -222,7 +222,7 @@ static int api_pot_profile_activate (vat_main_t *vam) goto OUT; } - M2(POT_PROFILE_ACTIVATE, pot_profile_activate, vec_len(name)); + M2(POT_PROFILE_ACTIVATE, mp, vec_len(name)); mp->list_name_len = vec_len(name); clib_memcpy(mp->list_name, name, mp->list_name_len); @@ -241,7 +241,7 @@ static int api_pot_profile_del (vat_main_t *vam) vl_api_pot_profile_del_t *mp; f64 timeout; - M(POT_PROFILE_DEL, pot_profile_del); + M(POT_PROFILE_DEL, mp); mp->list_name_len = 0; S; W; return 0; @@ -260,7 +260,7 @@ static int api_pot_profile_show_config_dump (vat_main_t *vam) else break; } - M(POT_PROFILE_SHOW_CONFIG_DUMP, pot_profile_show_config_dump); + M(POT_PROFILE_SHOW_CONFIG_DUMP, mp); mp->id = id; diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c index 0ccb675e..a1354327 100644 --- a/src/plugins/ioam/lib-trace/trace_test.c +++ b/src/plugins/ioam/lib-trace/trace_test.c @@ -149,7 +149,7 @@ api_trace_profile_add (vat_main_t * vam) } - M (TRACE_PROFILE_ADD, trace_profile_add); + M (TRACE_PROFILE_ADD, mp); mp->trace_type = trace_type; mp->trace_tsp = trace_tsp; @@ -171,7 +171,7 @@ api_trace_profile_del (vat_main_t * vam) vl_api_trace_profile_del_t *mp; f64 timeout; - M (TRACE_PROFILE_DEL, trace_profile_del); + M (TRACE_PROFILE_DEL, mp); S; W; return 0; @@ -182,7 +182,7 @@ api_trace_profile_show_config (vat_main_t * vam) { vl_api_trace_profile_show_config_t *mp; f64 timeout; - M (TRACE_PROFILE_SHOW_CONFIG, trace_profile_show_config); + M (TRACE_PROFILE_SHOW_CONFIG, mp); S; W; return 0; diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c index 0748c5b7..5d36547f 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c @@ -125,7 +125,7 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam) else break; } - M (VXLAN_GPE_IOAM_ENABLE, vxlan_gpe_ioam_enable); + M (VXLAN_GPE_IOAM_ENABLE, mp); mp->id = htons (id); mp->trace_ppc = has_ppc_option; mp->pow_enable = has_pow_option; @@ -145,7 +145,7 @@ api_vxlan_gpe_ioam_disable (vat_main_t * vam) vl_api_vxlan_gpe_ioam_disable_t *mp; f64 timeout; - M (VXLAN_GPE_IOAM_DISABLE, vxlan_gpe_ioam_disable); + M (VXLAN_GPE_IOAM_DISABLE, mp); S; W; return 0; @@ -223,7 +223,7 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) return -99; } - M (VXLAN_GPE_IOAM_VNI_ENABLE, vxlan_gpe_ioam_vni_enable); + M (VXLAN_GPE_IOAM_VNI_ENABLE, mp); if (ipv6_set) @@ -318,7 +318,7 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) return -99; } - M (VXLAN_GPE_IOAM_VNI_DISABLE, vxlan_gpe_ioam_vni_disable); + M (VXLAN_GPE_IOAM_VNI_DISABLE, mp); if (ipv6_set) @@ -389,7 +389,7 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) } - M (VXLAN_GPE_IOAM_TRANSIT_ENABLE, vxlan_gpe_ioam_transit_enable); + M (VXLAN_GPE_IOAM_TRANSIT_ENABLE, mp); if (ipv6_set) @@ -459,7 +459,7 @@ api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam) } - M (VXLAN_GPE_IOAM_TRANSIT_DISABLE, vxlan_gpe_ioam_transit_disable); + M (VXLAN_GPE_IOAM_TRANSIT_DISABLE, mp); if (ipv6_set) diff --git a/src/plugins/lb/lb_test.c b/src/plugins/lb/lb_test.c index 9d55e4a7..c150ea32 100644 --- a/src/plugins/lb/lb_test.c +++ b/src/plugins/lb/lb_test.c @@ -145,7 +145,9 @@ static int api_lb_conf (vat_main_t * vam) return -99; } - M(LB_CONF, lb_conf); S; W; + M(LB_CONF, mp); + S; + W; /* NOTREACHED */ return 0; @@ -183,7 +185,9 @@ static int api_lb_add_del_vip (vat_main_t * vam) mps.is_del = 1; } - M(LB_ADD_DEL_VIP, lb_add_del_vip); S; W; + M(LB_ADD_DEL_VIP, mp); + S; + W; /* NOTREACHED */ return 0; } @@ -206,7 +210,9 @@ static int api_lb_add_del_as (vat_main_t * vam) mps.is_del = 1; } - M(LB_ADD_DEL_AS, lb_add_del_as); S; W; + M(LB_ADD_DEL_AS, mp); + S; + W; /* NOTREACHED */ return 0; } diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c index db53470c..c6f9a8ff 100644 --- a/src/plugins/snat/snat_test.c +++ b/src/plugins/snat/snat_test.c @@ -152,7 +152,7 @@ static int api_snat_add_address_range (vat_main_t * vam) count); } - M(SNAT_ADD_ADDRESS_RANGE, snat_add_address_range); + M(SNAT_ADD_ADDRESS_RANGE, mp); memcpy (mp->first_ip_address, &start_addr, 4); memcpy (mp->last_ip_address, &end_addr, 4); @@ -200,7 +200,7 @@ static int api_snat_interface_add_del_feature (vat_main_t * vam) return -99; } - M(SNAT_INTERFACE_ADD_DEL_FEATURE, snat_interface_add_del_feature); + M(SNAT_INTERFACE_ADD_DEL_FEATURE, mp); mp->sw_if_index = ntohl(sw_if_index); mp->is_add = is_add; mp->is_inside = is_inside; @@ -262,7 +262,7 @@ static int api_snat_add_static_mapping(vat_main_t * vam) return -99; } - M(SNAT_ADD_STATIC_MAPPING, snat_add_static_mapping); + M(SNAT_ADD_STATIC_MAPPING, mp); mp->is_add = is_add; mp->is_ip4 = 1; mp->addr_only = addr_only; @@ -330,12 +330,12 @@ static int api_snat_static_mapping_dump(vat_main_t * vam) fformat (vam->ofp, "%15s%6s%15s%6s%11s\n", "address", "port", "address", "port", "vrf"); - M(SNAT_STATIC_MAPPING_DUMP, snat_static_mapping_dump); + M(SNAT_STATIC_MAPPING_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; - M (SNAT_CONTROL_PING, snat_control_ping); + M(SNAT_CONTROL_PING, mp); S; } W; @@ -385,7 +385,7 @@ static int api_snat_show_config(vat_main_t * vam) return -99; } - M(SNAT_SHOW_CONFIG, snat_show_config); + M(SNAT_SHOW_CONFIG, mp); S; W; /* NOTREACHED */ return 0; @@ -411,12 +411,12 @@ static int api_snat_address_dump(vat_main_t * vam) return -99; } - M(SNAT_ADDRESS_DUMP, snat_address_dump); + M(SNAT_ADDRESS_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; - M (SNAT_CONTROL_PING, snat_control_ping); + M(SNAT_CONTROL_PING, mp); S; } W; @@ -445,12 +445,12 @@ static int api_snat_interface_dump(vat_main_t * vam) return -99; } - M(SNAT_INTERFACE_DUMP, snat_interface_dump); + M(SNAT_INTERFACE_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; - M (SNAT_CONTROL_PING, snat_control_ping); + M(SNAT_CONTROL_PING, mp); S; } W; @@ -476,7 +476,7 @@ static int api_snat_set_workers (vat_main_t * vam) } } - M(SNAT_SET_WORKERS, snat_set_workers); + M(SNAT_SET_WORKERS, mp); mp->worker_mask = clib_host_to_net_u64 (bitmap[0]); S; W; @@ -506,12 +506,12 @@ static int api_snat_worker_dump(vat_main_t * vam) return -99; } - M(SNAT_WORKER_DUMP, snat_worker_dump); + M(SNAT_WORKER_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; - M (SNAT_CONTROL_PING, snat_control_ping); + M(SNAT_CONTROL_PING, mp); S; } W; @@ -549,7 +549,7 @@ static int api_snat_ipfix_enable_disable (vat_main_t * vam) return -99; } - M(SNAT_ADD_DEL_INTERFACE_ADDR, snat_add_del_interface_addr); + M(SNAT_ADD_DEL_INTERFACE_ADDR, mp); mp->sw_if_index = ntohl(sw_if_index); mp->is_add = is_add; @@ -578,12 +578,12 @@ static int api_snat_interface_addr_dump(vat_main_t * vam) return -99; } - M(SNAT_INTERFACE_ADDR_DUMP, snat_interface_addr_dump); + M(SNAT_INTERFACE_ADDR_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; - M (SNAT_CONTROL_PING, snat_control_ping); + M(SNAT_CONTROL_PING, mp); S; } W; @@ -615,7 +615,7 @@ static int api_snat_add_del_interface_addr (vat_main_t * vam) } } - M(SNAT_IPFIX_ENABLE_DISABLE, snat_ipfix_enable_disable); + M(SNAT_IPFIX_ENABLE_DISABLE, mp); mp->domain_id = htonl(domain_id); mp->src_port = htons((u16) src_port); mp->enable = enable; diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 0bbefd69..02987eb9 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -4590,7 +4590,7 @@ exec (vat_main_t * vam) } - M (CLI_REQUEST, cli_request); + M (CLI_REQUEST, mp); /* * Copy cmd into shared memory. @@ -4663,7 +4663,7 @@ exec_inband (vat_main_t * vam) * in \n\0. */ u32 len = vec_len (vam->input->buffer); - M2 (CLI_INBAND, cli_inband, len); + M2 (CLI_INBAND, mp, len); clib_memcpy (mp->cmd, vam->input->buffer, len); mp->length = htonl (len); @@ -4691,7 +4691,7 @@ api_create_loopback (vat_main_t * vam) } /* Construct the API message */ - M (CREATE_LOOPBACK, create_loopback); + M (CREATE_LOOPBACK, mp); if (mac_set) clib_memcpy (mp->mac_address, mac_address, sizeof (mac_address)); @@ -4722,7 +4722,7 @@ api_delete_loopback (vat_main_t * vam) } /* Construct the API message */ - M (DELETE_LOOPBACK, delete_loopback); + M (DELETE_LOOPBACK, mp); mp->sw_if_index = ntohl (sw_if_index); S; @@ -4753,7 +4753,7 @@ api_want_stats (vat_main_t * vam) return -99; } - M (WANT_STATS, want_stats); + M (WANT_STATS, mp); mp->enable_disable = enable; S; @@ -4784,7 +4784,7 @@ api_want_interface_events (vat_main_t * vam) return -99; } - M (WANT_INTERFACE_EVENTS, want_interface_events); + M (WANT_INTERFACE_EVENTS, mp); mp->enable_disable = enable; vam->interface_event_display = enable; @@ -4830,64 +4830,64 @@ api_sw_interface_dump (vat_main_t * vam) vam->sw_if_index_by_interface_name = hash_create_string (0, sizeof (uword)); /* Get list of ethernets */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "Ether", sizeof (mp->name_filter) - 1); S; /* and local / loopback interfaces */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "lo", sizeof (mp->name_filter) - 1); S; /* and packet-generator interfaces */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "pg", sizeof (mp->name_filter) - 1); S; /* and vxlan-gpe tunnel interfaces */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "vxlan_gpe", sizeof (mp->name_filter) - 1); S; /* and vxlan tunnel interfaces */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "vxlan", sizeof (mp->name_filter) - 1); S; /* and host (af_packet) interfaces */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "host", sizeof (mp->name_filter) - 1); S; /* and l2tpv3 tunnel interfaces */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "l2tpv3_tunnel", sizeof (mp->name_filter) - 1); S; /* and GRE tunnel interfaces */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "gre", sizeof (mp->name_filter) - 1); S; /* and LISP-GPE interfaces */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "lisp_gpe", sizeof (mp->name_filter) - 1); S; /* and IPSEC tunnel interfaces */ - M (SW_INTERFACE_DUMP, sw_interface_dump); + M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "ipsec", sizeof (mp->name_filter) - 1); S; @@ -4895,7 +4895,7 @@ api_sw_interface_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -4938,7 +4938,7 @@ api_sw_interface_set_flags (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_SET_FLAGS, sw_interface_set_flags); + M (SW_INTERFACE_SET_FLAGS, mp); mp->sw_if_index = ntohl (sw_if_index); mp->admin_up_down = admin_up; mp->link_up_down = link_up; @@ -4971,7 +4971,7 @@ api_sw_interface_clear_stats (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats); + M (SW_INTERFACE_CLEAR_STATS, mp); if (sw_if_index_set == 1) mp->sw_if_index = ntohl (sw_if_index); @@ -5045,7 +5045,7 @@ api_sw_interface_set_dpdk_hqos_pipe (vat_main_t * vam) return -99; } - M (SW_INTERFACE_SET_DPDK_HQOS_PIPE, sw_interface_set_dpdk_hqos_pipe); + M (SW_INTERFACE_SET_DPDK_HQOS_PIPE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->subport = ntohl (subport); @@ -5122,7 +5122,7 @@ api_sw_interface_set_dpdk_hqos_subport (vat_main_t * vam) return -99; } - M (SW_INTERFACE_SET_DPDK_HQOS_SUBPORT, sw_interface_set_dpdk_hqos_subport); + M (SW_INTERFACE_SET_DPDK_HQOS_SUBPORT, mp); mp->sw_if_index = ntohl (sw_if_index); mp->subport = ntohl (subport); @@ -5194,7 +5194,7 @@ api_sw_interface_set_dpdk_hqos_tctbl (vat_main_t * vam) return -99; } - M (SW_INTERFACE_SET_DPDK_HQOS_TCTBL, sw_interface_set_dpdk_hqos_tctbl); + M (SW_INTERFACE_SET_DPDK_HQOS_TCTBL, mp); mp->sw_if_index = ntohl (sw_if_index); mp->entry = ntohl (entry); @@ -5262,7 +5262,7 @@ api_sw_interface_add_del_address (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address); + M (SW_INTERFACE_ADD_DEL_ADDRESS, mp); mp->sw_if_index = ntohl (sw_if_index); mp->is_add = is_add; @@ -5317,7 +5317,7 @@ api_sw_interface_set_mpls_enable (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable); + M (SW_INTERFACE_SET_MPLS_ENABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable = enable; @@ -5361,7 +5361,7 @@ api_sw_interface_set_table (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_SET_TABLE, sw_interface_set_table); + M (SW_INTERFACE_SET_TABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->is_ipv6 = is_ipv6; @@ -5431,7 +5431,7 @@ api_sw_interface_get_table (vat_main_t * vam) return -99; } - M (SW_INTERFACE_GET_TABLE, sw_interface_get_table); + M (SW_INTERFACE_GET_TABLE, mp); mp->sw_if_index = htonl (sw_if_index); mp->is_ipv6 = is_ipv6; @@ -5471,7 +5471,7 @@ api_sw_interface_set_vpath (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_SET_VPATH, sw_interface_set_vpath); + M (SW_INTERFACE_SET_VPATH, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable = is_enable; @@ -5520,7 +5520,7 @@ api_sw_interface_set_vxlan_bypass (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass); + M (SW_INTERFACE_SET_VXLAN_BYPASS, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable = is_enable; @@ -5594,7 +5594,7 @@ api_sw_interface_set_l2_xconnect (vat_main_t * vam) return -99; } - M (SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect); + M (SW_INTERFACE_SET_L2_XCONNECT, mp); mp->rx_sw_if_index = ntohl (rx_sw_if_index); mp->tx_sw_if_index = ntohl (tx_sw_if_index); @@ -5655,7 +5655,7 @@ api_sw_interface_set_l2_bridge (vat_main_t * vam) return -99; } - M (SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge); + M (SW_INTERFACE_SET_L2_BRIDGE, mp); mp->rx_sw_if_index = ntohl (rx_sw_if_index); mp->bd_id = ntohl (bd_id); @@ -5686,14 +5686,14 @@ api_bridge_domain_dump (vat_main_t * vam) break; } - M (BRIDGE_DOMAIN_DUMP, bridge_domain_dump); + M (BRIDGE_DOMAIN_DUMP, mp); mp->bd_id = ntohl (bd_id); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } @@ -5751,7 +5751,7 @@ api_bridge_domain_add_del (vat_main_t * vam) return -99; } - M (BRIDGE_DOMAIN_ADD_DEL, bridge_domain_add_del); + M (BRIDGE_DOMAIN_ADD_DEL, mp); mp->bd_id = ntohl (bd_id); mp->flood = flood; @@ -5856,7 +5856,7 @@ api_l2fib_add_del (vat_main_t * vam) for (j = 0; j < count; j++) { - M (L2FIB_ADD_DEL, l2fib_add_del); + M (L2FIB_ADD_DEL, mp); mp->mac = mac; mp->bd_id = ntohl (bd_id); @@ -5882,7 +5882,7 @@ api_l2fib_add_del (vat_main_t * vam) /* Shut off async mode */ vam->async_mode = 0; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; timeout = vat_time_now (vam) + 1.0; @@ -5959,7 +5959,7 @@ api_l2_flags (vat_main_t * vam) return -99; } - M (L2_FLAGS, l2_flags); + M (L2_FLAGS, mp); mp->sw_if_index = ntohl (sw_if_index); mp->feature_bitmap = ntohl (feature_bitmap); @@ -6010,7 +6010,7 @@ api_bridge_flags (vat_main_t * vam) return -99; } - M (BRIDGE_FLAGS, bridge_flags); + M (BRIDGE_FLAGS, mp); mp->bd_id = ntohl (bd_id); mp->feature_bitmap = ntohl (flags); @@ -6081,7 +6081,7 @@ api_bd_ip_mac_add_del (vat_main_t * vam) return -99; } - M (BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del); + M (BD_IP_MAC_ADD_DEL, mp); mp->bd_id = ntohl (bd_id); mp->is_ipv6 = is_ipv6; @@ -6159,7 +6159,7 @@ api_tap_connect (vat_main_t * vam) } /* Construct the API message */ - M (TAP_CONNECT, tap_connect); + M (TAP_CONNECT, mp); mp->use_random_mac = random_mac; clib_memcpy (mp->mac_address, mac_address, 6); @@ -6241,7 +6241,7 @@ api_tap_modify (vat_main_t * vam) vec_add1 (tap_name, 0); /* Construct the API message */ - M (TAP_MODIFY, tap_modify); + M (TAP_MODIFY, mp); mp->use_random_mac = random_mac; mp->sw_if_index = ntohl (sw_if_index); @@ -6283,7 +6283,7 @@ api_tap_delete (vat_main_t * vam) } /* Construct the API message */ - M (TAP_DELETE, tap_delete); + M (TAP_DELETE, mp); mp->sw_if_index = ntohl (sw_if_index); @@ -6484,7 +6484,7 @@ api_ip_add_del_route (vat_main_t * vam) for (j = 0; j < count; j++) { /* Construct the API message */ - M2 (IP_ADD_DEL_ROUTE, ip_add_del_route, + M2 (IP_ADD_DEL_ROUTE, mp, sizeof (mpls_label_t) * vec_len (next_hop_out_label_stack)); mp->next_hop_sw_if_index = ntohl (sw_if_index); @@ -6553,7 +6553,7 @@ api_ip_add_del_route (vat_main_t * vam) /* Shut off async mode */ vam->async_mode = 0; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; timeout = vat_time_now (vam) + 1.0; @@ -6676,7 +6676,7 @@ api_ip_mroute_add_del (vat_main_t * vam) } /* Construct the API message */ - M (IP_MROUTE_ADD_DEL, ip_mroute_add_del); + M (IP_MROUTE_ADD_DEL, mp); mp->next_hop_sw_if_index = ntohl (sw_if_index); mp->table_id = ntohl (vrf_id); @@ -6829,7 +6829,7 @@ api_mpls_route_add_del (vat_main_t * vam) for (j = 0; j < count; j++) { /* Construct the API message */ - M2 (MPLS_ROUTE_ADD_DEL, mpls_route_add_del, + M2 (MPLS_ROUTE_ADD_DEL, mp, sizeof (mpls_label_t) * vec_len (next_hop_out_label_stack)); mp->mr_next_hop_sw_if_index = ntohl (sw_if_index); @@ -6891,7 +6891,7 @@ api_mpls_route_add_del (vat_main_t * vam) /* Shut off async mode */ vam->async_mode = 0; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; timeout = vat_time_now (vam) + 1.0; @@ -6990,7 +6990,7 @@ api_mpls_ip_bind_unbind (vat_main_t * vam) } /* Construct the API message */ - M (MPLS_IP_BIND_UNBIND, mpls_ip_bind_unbind); + M (MPLS_IP_BIND_UNBIND, mp); mp->mb_create_table_if_needed = create_table_if_needed; mp->mb_is_bind = is_bind; @@ -7045,7 +7045,7 @@ api_proxy_arp_add_del (vat_main_t * vam) return -99; } - M (PROXY_ARP_ADD_DEL, proxy_arp_add_del); + M (PROXY_ARP_ADD_DEL, mp); mp->vrf_id = ntohl (vrf_id); mp->is_add = is_add; @@ -7091,7 +7091,7 @@ api_proxy_arp_intfc_enable_disable (vat_main_t * vam) return -99; } - M (PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable); + M (PROXY_ARP_INTFC_ENABLE_DISABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable_disable = enable; @@ -7153,8 +7153,7 @@ api_mpls_tunnel_add_del (vat_main_t * vam) } } - M2 (MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del, - sizeof (mpls_label_t) * vec_len (labels)); + M2 (MPLS_TUNNEL_ADD_DEL, mp, sizeof (mpls_label_t) * vec_len (labels)); mp->mt_next_hop_sw_if_index = ntohl (next_hop_sw_if_index); mp->mt_sw_if_index = ntohl (sw_if_index); @@ -7223,7 +7222,7 @@ api_sw_interface_set_unnumbered (vat_main_t * vam) return -99; } - M (SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered); + M (SW_INTERFACE_SET_UNNUMBERED, mp); mp->sw_if_index = ntohl (sw_if_index); mp->unnumbered_sw_if_index = ntohl (unnum_sw_index); @@ -7301,7 +7300,7 @@ api_ip_neighbor_add_del (vat_main_t * vam) } /* Construct the API message */ - M (IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del); + M (IP_NEIGHBOR_ADD_DEL, mp); mp->sw_if_index = ntohl (sw_if_index); mp->is_add = is_add; @@ -7359,7 +7358,7 @@ api_reset_vrf (vat_main_t * vam) return -99; } - M (RESET_VRF, reset_vrf); + M (RESET_VRF, mp); mp->vrf_id = ntohl (vrf_id); mp->is_ipv6 = is_ipv6; @@ -7408,7 +7407,7 @@ api_create_vlan_subif (vat_main_t * vam) errmsg ("missing vlan_id"); return -99; } - M (CREATE_VLAN_SUBIF, create_vlan_subif); + M (CREATE_VLAN_SUBIF, mp); mp->sw_if_index = ntohl (sw_if_index); mp->vlan_id = ntohl (vlan_id); @@ -7486,7 +7485,7 @@ api_create_subif (vat_main_t * vam) errmsg ("missing sub_id"); return -99; } - M (CREATE_SUBIF, create_subif); + M (CREATE_SUBIF, mp); mp->sw_if_index = ntohl (sw_if_index); mp->sub_id = ntohl (sub_id); @@ -7545,7 +7544,7 @@ api_oam_add_del (vat_main_t * vam) return -99; } - M (OAM_ADD_DEL, oam_add_del); + M (OAM_ADD_DEL, mp); mp->vrf_id = ntohl (vrf_id); mp->is_add = is_add; @@ -7587,7 +7586,7 @@ api_reset_fib (vat_main_t * vam) return -99; } - M (RESET_FIB, reset_fib); + M (RESET_FIB, mp); mp->vrf_id = ntohl (vrf_id); mp->is_ipv6 = is_ipv6; @@ -7667,7 +7666,7 @@ api_dhcp_proxy_config (vat_main_t * vam) } /* Construct the API message */ - M (DHCP_PROXY_CONFIG, dhcp_proxy_config); + M (DHCP_PROXY_CONFIG, mp); mp->insert_circuit_id = insert_cid; mp->is_add = is_add; @@ -7765,7 +7764,7 @@ api_dhcp_proxy_config_2 (vat_main_t * vam) } /* Construct the API message */ - M (DHCP_PROXY_CONFIG_2, dhcp_proxy_config_2); + M (DHCP_PROXY_CONFIG_2, mp); mp->insert_circuit_id = insert_cid; mp->is_add = is_add; @@ -7843,7 +7842,7 @@ api_dhcp_proxy_set_vss (vat_main_t * vam) return -99; } - M (DHCP_PROXY_SET_VSS, dhcp_proxy_set_vss); + M (DHCP_PROXY_SET_VSS, mp); mp->tbl_id = ntohl (tbl_id); mp->fib_id = ntohl (fib_id); mp->oui = ntohl (oui); @@ -7899,7 +7898,7 @@ api_dhcp_client_config (vat_main_t * vam) vec_add1 (hostname, 0); /* Construct the API message */ - M (DHCP_CLIENT_CONFIG, dhcp_client_config); + M (DHCP_CLIENT_CONFIG, mp); mp->sw_if_index = ntohl (sw_if_index); clib_memcpy (mp->hostname, hostname, vec_len (hostname)); @@ -7965,7 +7964,7 @@ api_set_ip_flow_hash (vat_main_t * vam) return -99; } - M (SET_IP_FLOW_HASH, set_ip_flow_hash); + M (SET_IP_FLOW_HASH, mp); mp->src = src; mp->dst = dst; mp->sport = sport; @@ -8014,7 +8013,7 @@ api_sw_interface_ip6_enable_disable (vat_main_t * vam) return -99; } - M (SW_INTERFACE_IP6_ENABLE_DISABLE, sw_interface_ip6_enable_disable); + M (SW_INTERFACE_IP6_ENABLE_DISABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable = enable; @@ -8061,8 +8060,7 @@ api_sw_interface_ip6_set_link_local_address (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS, - sw_interface_ip6_set_link_local_address); + M (SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS, mp); mp->sw_if_index = ntohl (sw_if_index); clib_memcpy (mp->address, &v6address, sizeof (v6address)); @@ -8143,7 +8141,7 @@ api_sw_interface_ip6nd_ra_prefix (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix); + M (SW_INTERFACE_IP6ND_RA_PREFIX, mp); mp->sw_if_index = ntohl (sw_if_index); clib_memcpy (mp->address, &v6address, sizeof (v6address)); @@ -8237,7 +8235,7 @@ api_sw_interface_ip6nd_ra_config (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config); + M (SW_INTERFACE_IP6ND_RA_CONFIG, mp); mp->sw_if_index = ntohl (sw_if_index); mp->max_interval = ntohl (max_interval); @@ -8293,7 +8291,7 @@ api_set_arp_neighbor_limit (vat_main_t * vam) return -99; } - M (SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit); + M (SET_ARP_NEIGHBOR_LIMIT, mp); mp->arp_neighbor_limit = ntohl (arp_nbr_limit); mp->is_ipv6 = is_ipv6; @@ -8363,7 +8361,7 @@ api_l2_patch_add_del (vat_main_t * vam) return -99; } - M (L2_PATCH_ADD_DEL, l2_patch_add_del); + M (L2_PATCH_ADD_DEL, mp); mp->rx_sw_if_index = ntohl (rx_sw_if_index); mp->tx_sw_if_index = ntohl (tx_sw_if_index); @@ -8400,7 +8398,7 @@ api_ioam_enable (vat_main_t * vam) else break; } - M (IOAM_ENABLE, ioam_enable); + M (IOAM_ENABLE, mp); mp->id = htons (id); mp->seqno = has_seqno_option; mp->analyse = has_analyse_option; @@ -8421,7 +8419,7 @@ api_ioam_disable (vat_main_t * vam) vl_api_ioam_disable_t *mp; f64 timeout; - M (IOAM_DISABLE, ioam_disable); + M (IOAM_DISABLE, mp); S; W; return 0; @@ -8530,7 +8528,7 @@ api_sr_tunnel_add_del (vat_main_t * vam) return -99; } - M2 (SR_TUNNEL_ADD_DEL, sr_tunnel_add_del, + M2 (SR_TUNNEL_ADD_DEL, mp, vec_len (segments) * sizeof (ip6_address_t) + vec_len (tags) * sizeof (ip6_address_t)); @@ -8613,7 +8611,7 @@ api_sr_policy_add_del (vat_main_t * vam) return -99; } - M2 (SR_POLICY_ADD_DEL, sr_policy_add_del, tunnel_names_length); + M2 (SR_POLICY_ADD_DEL, mp, tunnel_names_length); @@ -8682,7 +8680,7 @@ api_sr_multicast_map_add_del (vat_main_t * vam) return -99; } - M (SR_MULTICAST_MAP_ADD_DEL, sr_multicast_map_add_del); + M (SR_MULTICAST_MAP_ADD_DEL, mp); mp->is_add = !is_del; memcpy (mp->policy_name, policy_name, vec_len (policy_name)); @@ -9391,7 +9389,7 @@ api_classify_add_del_table (vat_main_t * vam) return -99; } - M2 (CLASSIFY_ADD_DEL_TABLE, classify_add_del_table, vec_len (mask)); + M2 (CLASSIFY_ADD_DEL_TABLE, mp, vec_len (mask)); mp->is_add = is_add; mp->del_chain = del_chain; @@ -9926,7 +9924,7 @@ api_classify_add_del_session (vat_main_t * vam) return -99; } - M2 (CLASSIFY_ADD_DEL_SESSION, classify_add_del_session, vec_len (match)); + M2 (CLASSIFY_ADD_DEL_SESSION, mp, vec_len (match)); mp->is_add = is_add; mp->table_index = ntohl (table_index); @@ -9976,7 +9974,7 @@ api_classify_set_interface_ip_table (vat_main_t * vam) } - M (CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table); + M (CLASSIFY_SET_INTERFACE_IP_TABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->table_index = ntohl (table_index); @@ -10029,7 +10027,7 @@ api_classify_set_interface_l2_tables (vat_main_t * vam) } - M (CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables); + M (CLASSIFY_SET_INTERFACE_L2_TABLES, mp); mp->sw_if_index = ntohl (sw_if_index); mp->ip4_table_index = ntohl (ip4_table_index); @@ -10093,7 +10091,7 @@ api_set_ipfix_exporter (vat_main_t * vam) return -99; } - M (SET_IPFIX_EXPORTER, set_ipfix_exporter); + M (SET_IPFIX_EXPORTER, mp); memcpy (mp->collector_address, collector_address.data, sizeof (collector_address.data)); @@ -10131,7 +10129,7 @@ api_set_ipfix_classify_stream (vat_main_t * vam) } } - M (SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream); + M (SET_IPFIX_CLASSIFY_STREAM, mp); mp->domain_id = htonl (domain_id); mp->src_port = htons ((u16) src_port); @@ -10191,7 +10189,7 @@ api_ipfix_classify_table_add_del (vat_main_t * vam) return -99; } - M (IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del); + M (IPFIX_CLASSIFY_TABLE_ADD_DEL, mp); mp->is_add = is_add; mp->table_id = htonl (classify_table_index); @@ -10229,7 +10227,7 @@ api_get_node_index (vat_main_t * vam) return -99; } - M (GET_NODE_INDEX, get_node_index); + M (GET_NODE_INDEX, mp); clib_memcpy (mp->node_name, name, vec_len (name)); vec_free (name); @@ -10277,7 +10275,7 @@ api_get_next_index (vat_main_t * vam) return -99; } - M (GET_NEXT_INDEX, get_next_index); + M (GET_NEXT_INDEX, mp); clib_memcpy (mp->node_name, node_name, vec_len (node_name)); clib_memcpy (mp->next_name, next_node_name, vec_len (next_node_name)); vec_free (node_name); @@ -10328,7 +10326,7 @@ api_add_node_next (vat_main_t * vam) return -99; } - M (ADD_NODE_NEXT, add_node_next); + M (ADD_NODE_NEXT, mp); clib_memcpy (mp->node_name, name, vec_len (name)); clib_memcpy (mp->next_name, next, vec_len (next)); vec_free (name); @@ -10389,7 +10387,7 @@ api_l2tpv3_create_tunnel (vat_main_t * vam) return -99; } - M (L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel); + M (L2TPV3_CREATE_TUNNEL, mp); clib_memcpy (mp->client_address, client_address.as_u8, sizeof (mp->client_address)); @@ -10440,7 +10438,7 @@ api_l2tpv3_set_tunnel_cookies (vat_main_t * vam) return -99; } - M (L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies); + M (L2TPV3_SET_TUNNEL_COOKIES, mp); mp->sw_if_index = ntohl (sw_if_index); mp->new_local_cookie = clib_host_to_net_u64 (new_local_cookie); @@ -10482,7 +10480,7 @@ api_l2tpv3_interface_enable_disable (vat_main_t * vam) return -99; } - M (L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable); + M (L2TPV3_INTERFACE_ENABLE_DISABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable_disable = enable_disable; @@ -10519,7 +10517,7 @@ api_l2tpv3_set_lookup_key (vat_main_t * vam) return -99; } - M (L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key); + M (L2TPV3_SET_LOOKUP_KEY, mp); mp->key = key; @@ -10599,13 +10597,13 @@ api_sw_if_l2tpv3_tunnel_dump (vat_main_t * vam) f64 timeout; /* Get list of l2tpv3-tunnel interfaces */ - M (SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump); + M (SW_IF_L2TPV3_TUNNEL_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -10647,13 +10645,13 @@ api_sw_interface_tap_dump (vat_main_t * vam) print (vam->ofp, "\n%-16s %s", "dev_name", "sw_if_index"); /* Get list of tap interfaces */ - M (SW_INTERFACE_TAP_DUMP, sw_interface_tap_dump); + M (SW_INTERFACE_TAP_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -10806,7 +10804,7 @@ api_vxlan_add_del_tunnel (vat_main_t * vam) return -99; } - M (VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel); + M (VXLAN_ADD_DEL_TUNNEL, mp); if (ipv6_set) { @@ -10922,7 +10920,7 @@ api_vxlan_tunnel_dump (vat_main_t * vam) } /* Get list of vxlan-tunnel interfaces */ - M (VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump); + M (VXLAN_TUNNEL_DUMP, mp); mp->sw_if_index = htonl (sw_if_index); @@ -10931,7 +10929,7 @@ api_vxlan_tunnel_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -10981,7 +10979,7 @@ api_gre_add_del_tunnel (vat_main_t * vam) } - M (GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel); + M (GRE_ADD_DEL_TUNNEL, mp); clib_memcpy (&mp->src_address, &src4, sizeof (src4)); clib_memcpy (&mp->dst_address, &dst4, sizeof (dst4)); @@ -11062,7 +11060,7 @@ api_gre_tunnel_dump (vat_main_t * vam) } /* Get list of gre-tunnel interfaces */ - M (GRE_TUNNEL_DUMP, gre_tunnel_dump); + M (GRE_TUNNEL_DUMP, mp); mp->sw_if_index = htonl (sw_if_index); @@ -11071,7 +11069,7 @@ api_gre_tunnel_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -11084,7 +11082,7 @@ api_l2_fib_clear_table (vat_main_t * vam) vl_api_l2_fib_clear_table_t *mp; f64 timeout; - M (L2_FIB_CLEAR_TABLE, l2_fib_clear_table); + M (L2_FIB_CLEAR_TABLE, mp); S; W; @@ -11125,7 +11123,7 @@ api_l2_interface_efp_filter (vat_main_t * vam) return -99; } - M (L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter); + M (L2_INTERFACE_EFP_FILTER, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable_disable = enable; @@ -11191,8 +11189,8 @@ api_l2_interface_vlan_tag_rewrite (vat_main_t * vam) return -99; } - M (L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite) - mp->sw_if_index = ntohl (sw_if_index); + M (L2_INTERFACE_VLAN_TAG_REWRITE, mp); + mp->sw_if_index = ntohl (sw_if_index); mp->vtr_op = ntohl (vtr_op); mp->push_dot1q = ntohl (push_dot1q); mp->tag1 = ntohl (tag1); @@ -11252,7 +11250,7 @@ api_create_vhost_user_if (vat_main_t * vam) } vec_add1 (file_name, 0); - M (CREATE_VHOST_USER_IF, create_vhost_user_if); + M (CREATE_VHOST_USER_IF, mp); mp->is_server = is_server; clib_memcpy (mp->sock_filename, file_name, vec_len (file_name)); @@ -11324,7 +11322,7 @@ api_modify_vhost_user_if (vat_main_t * vam) } vec_add1 (file_name, 0); - M (MODIFY_VHOST_USER_IF, modify_vhost_user_if); + M (MODIFY_VHOST_USER_IF, mp); mp->sw_if_index = ntohl (sw_if_index); mp->is_server = is_server; @@ -11368,7 +11366,7 @@ api_delete_vhost_user_if (vat_main_t * vam) } - M (DELETE_VHOST_USER_IF, delete_vhost_user_if); + M (DELETE_VHOST_USER_IF, mp); mp->sw_if_index = ntohl (sw_if_index); @@ -11427,13 +11425,13 @@ api_sw_interface_vhost_user_dump (vat_main_t * vam) "Interface name idx hdr_sz features server regions filename"); /* Get list of vhost-user interfaces */ - M (SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump); + M (SW_INTERFACE_VHOST_USER_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -11445,7 +11443,7 @@ api_show_version (vat_main_t * vam) vl_api_show_version_t *mp; f64 timeout; - M (SHOW_VERSION, show_version); + M (SHOW_VERSION, mp); S; W; @@ -11543,7 +11541,7 @@ api_vxlan_gpe_add_del_tunnel (vat_main_t * vam) return -99; } - M (VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel); + M (VXLAN_GPE_ADD_DEL_TUNNEL, mp); if (ipv6_set) @@ -11653,7 +11651,7 @@ api_vxlan_gpe_tunnel_dump (vat_main_t * vam) } /* Get list of vxlan-tunnel interfaces */ - M (VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump); + M (VXLAN_GPE_TUNNEL_DUMP, mp); mp->sw_if_index = htonl (sw_if_index); @@ -11662,7 +11660,7 @@ api_vxlan_gpe_tunnel_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -11738,7 +11736,7 @@ api_l2_fib_table_dump (vat_main_t * vam) print (vam->ofp, "BD-ID Mac Address sw-ndx Static Filter BVI"); /* Get list of l2 fib entries */ - M (L2_FIB_TABLE_DUMP, l2_fib_table_dump); + M (L2_FIB_TABLE_DUMP, mp); mp->bd_id = ntohl (bd_id); S; @@ -11746,7 +11744,7 @@ api_l2_fib_table_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -11788,7 +11786,7 @@ api_interface_name_renumber (vat_main_t * vam) return -99; } - M (INTERFACE_NAME_RENUMBER, interface_name_renumber); + M (INTERFACE_NAME_RENUMBER, mp); mp->sw_if_index = ntohl (sw_if_index); mp->new_show_dev_instance = ntohl (new_show_dev_instance); @@ -11823,7 +11821,7 @@ api_want_ip4_arp_events (vat_main_t * vam) return -99; } - M (WANT_IP4_ARP_EVENTS, want_ip4_arp_events); + M (WANT_IP4_ARP_EVENTS, mp); mp->enable_disable = enable_disable; mp->pid = getpid (); mp->address = address.as_u32; @@ -11858,7 +11856,7 @@ api_want_ip6_nd_events (vat_main_t * vam) return -99; } - M (WANT_IP6_ND_EVENTS, want_ip6_nd_events); + M (WANT_IP6_ND_EVENTS, mp); mp->enable_disable = enable_disable; mp->pid = getpid (); clib_memcpy (mp->address, &address, sizeof (ip6_address_t)); @@ -11907,7 +11905,7 @@ api_input_acl_set_interface (vat_main_t * vam) return -99; } - M (INPUT_ACL_SET_INTERFACE, input_acl_set_interface); + M (INPUT_ACL_SET_INTERFACE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->ip4_table_index = ntohl (ip4_table_index); @@ -11968,7 +11966,7 @@ api_ip_address_dump (vat_main_t * vam) vam->current_sw_if_index = sw_if_index; vam->is_ipv6 = ipv6_set; - M (IP_ADDRESS_DUMP, ip_address_dump); + M (IP_ADDRESS_DUMP, mp); mp->sw_if_index = ntohl (sw_if_index); mp->is_ipv6 = ipv6_set; S; @@ -11976,7 +11974,7 @@ api_ip_address_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -12025,14 +12023,14 @@ api_ip_dump (vat_main_t * vam) } vec_free (vam->ip_details_by_sw_if_index[is_ipv6]); - M (IP_DUMP, ip_dump); + M (IP_DUMP, mp); mp->is_ipv6 = ipv6_set; S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -12065,7 +12063,7 @@ api_ipsec_spd_add_del (vat_main_t * vam) return -99; } - M (IPSEC_SPD_ADD_DEL, ipsec_spd_add_del); + M (IPSEC_SPD_ADD_DEL, mp); mp->spd_id = ntohl (spd_id); mp->is_add = is_add; @@ -12118,7 +12116,7 @@ api_ipsec_interface_add_del_spd (vat_main_t * vam) return -99; } - M (IPSEC_INTERFACE_ADD_DEL_SPD, ipsec_interface_add_del_spd); + M (IPSEC_INTERFACE_ADD_DEL_SPD, mp); mp->spd_id = ntohl (spd_id); mp->sw_if_index = ntohl (sw_if_index); @@ -12244,7 +12242,7 @@ api_ipsec_spd_add_del_entry (vat_main_t * vam) } - M (IPSEC_SPD_ADD_DEL_ENTRY, ipsec_spd_add_del_entry); + M (IPSEC_SPD_ADD_DEL_ENTRY, mp); mp->spd_id = ntohl (spd_id); mp->priority = ntohl (priority); @@ -12372,7 +12370,7 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam) } - M (IPSEC_SAD_ADD_DEL_ENTRY, ipsec_sad_add_del_entry); + M (IPSEC_SAD_ADD_DEL_ENTRY, mp); mp->sad_id = ntohl (sad_id); mp->is_add = is_add; @@ -12444,7 +12442,7 @@ api_ipsec_sa_set_key (vat_main_t * vam) } } - M (IPSEC_SA_SET_KEY, ipsec_set_sa_key); + M (IPSEC_SA_SET_KEY, mp); mp->sa_id = ntohl (sa_id); mp->crypto_key_length = vec_len (ck); @@ -12503,7 +12501,7 @@ api_ikev2_profile_add_del (vat_main_t * vam) return -99; } - M (IKEV2_PROFILE_ADD_DEL, ikev2_profile_add_del); + M (IKEV2_PROFILE_ADD_DEL, mp); clib_memcpy (mp->name, name, vec_len (name)); mp->is_add = is_add; @@ -12570,7 +12568,7 @@ api_ikev2_profile_set_auth (vat_main_t * vam) return -99; } - M (IKEV2_PROFILE_SET_AUTH, ikev2_profile_set_auth); + M (IKEV2_PROFILE_SET_AUTH, mp); mp->is_hex = is_hex; mp->auth_method = (u8) auth_method; @@ -12650,7 +12648,7 @@ api_ikev2_profile_set_id (vat_main_t * vam) return -99; } - M (IKEV2_PROFILE_SET_ID, ikev2_profile_set_id); + M (IKEV2_PROFILE_SET_ID, mp); mp->is_local = is_local; mp->id_type = (u8) id_type; @@ -12720,7 +12718,7 @@ api_ikev2_profile_set_ts (vat_main_t * vam) return -99; } - M (IKEV2_PROFILE_SET_TS, ikev2_profile_set_ts); + M (IKEV2_PROFILE_SET_TS, mp); mp->is_local = is_local; mp->proto = (u8) proto; @@ -12768,7 +12766,7 @@ api_ikev2_set_local_key (vat_main_t * vam) return -99; } - M (IKEV2_SET_LOCAL_KEY, ikev2_set_local_key); + M (IKEV2_SET_LOCAL_KEY, mp); clib_memcpy (mp->key_file, file, vec_len (file)); vec_free (file); @@ -12838,7 +12836,7 @@ api_map_add_domain (vat_main_t * vam) } /* Construct the API message */ - M (MAP_ADD_DOMAIN, map_add_domain); + M (MAP_ADD_DOMAIN, mp); clib_memcpy (mp->ip4_prefix, &ip4_prefix, sizeof (ip4_prefix)); mp->ip4_prefix_len = ip4_prefix_len; @@ -12890,7 +12888,7 @@ api_map_del_domain (vat_main_t * vam) } /* Construct the API message */ - M (MAP_DEL_DOMAIN, map_del_domain); + M (MAP_DEL_DOMAIN, mp); mp->index = ntohl (index); @@ -12931,7 +12929,7 @@ api_map_add_del_rule (vat_main_t * vam) } /* Construct the API message */ - M (MAP_ADD_DEL_RULE, map_add_del_rule); + M (MAP_ADD_DEL_RULE, mp); mp->index = ntohl (index); mp->is_add = is_add; @@ -12952,7 +12950,7 @@ api_map_domain_dump (vat_main_t * vam) f64 timeout; /* Construct the API message */ - M (MAP_DOMAIN_DUMP, map_domain_dump); + M (MAP_DOMAIN_DUMP, mp); /* send it... */ S; @@ -12960,7 +12958,7 @@ api_map_domain_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -12989,7 +12987,7 @@ api_map_rule_dump (vat_main_t * vam) } /* Construct the API message */ - M (MAP_RULE_DUMP, map_rule_dump); + M (MAP_RULE_DUMP, mp); mp->domain_index = htonl (domain_index); @@ -12999,7 +12997,7 @@ api_map_rule_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -13069,7 +13067,7 @@ api_get_first_msg_id (vat_main_t * vam) return -99; } - M (GET_FIRST_MSG_ID, get_first_msg_id); + M (GET_FIRST_MSG_ID, mp); clib_memcpy (mp->name, name, vec_len (name)); S; W; @@ -13108,7 +13106,7 @@ api_cop_interface_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M (COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable); + M (COP_INTERFACE_ENABLE_DISABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable_disable = enable_disable; @@ -13154,7 +13152,7 @@ api_cop_whitelist_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M (COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable); + M (COP_WHITELIST_ENABLE_DISABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->fib_id = ntohl (fib_id); mp->ip4 = ip4; @@ -13173,7 +13171,7 @@ api_get_node_graph (vat_main_t * vam) vl_api_get_node_graph_t *mp; f64 timeout; - M (GET_NODE_GRAPH, get_node_graph); + M (GET_NODE_GRAPH, mp); /* send it... */ S; @@ -13308,7 +13306,7 @@ api_lisp_add_del_locator_set (vat_main_t * vam) data_len = sizeof (vl_api_local_locator_t) * vec_len (locators); /* Construct the API message */ - M2 (LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set, data_len); + M2 (LISP_ADD_DEL_LOCATOR_SET, mp, data_len); mp->is_add = is_add; clib_memcpy (mp->locator_set_name, locator_set_name, @@ -13425,7 +13423,7 @@ api_lisp_add_del_locator (vat_main_t * vam) vec_add1 (locator_set_name, 0); /* Construct the API message */ - M (LISP_ADD_DEL_LOCATOR, lisp_add_del_locator); + M (LISP_ADD_DEL_LOCATOR, mp); mp->is_add = is_add; mp->sw_if_index = ntohl (sw_if_index); @@ -13547,7 +13545,7 @@ api_lisp_add_del_local_eid (vat_main_t * vam) vec_add1 (locator_set_name, 0); /* Construct the API message */ - M (LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid); + M (LISP_ADD_DEL_LOCAL_EID, mp); mp->is_add = is_add; lisp_eid_put_vat (mp->eid, eid->addr, eid->type); @@ -13689,7 +13687,7 @@ api_lisp_gpe_add_del_fwd_entry (vat_main_t * vam) } /* Construct the API message */ - M2 (LISP_GPE_ADD_DEL_FWD_ENTRY, lisp_gpe_add_del_fwd_entry, + M2 (LISP_GPE_ADD_DEL_FWD_ENTRY, mp, sizeof (vl_api_lisp_gpe_locator_t) * vec_len (rmt_locs) * 2); mp->is_add = is_add; @@ -13769,7 +13767,7 @@ api_lisp_add_del_map_server (vat_main_t * vam) } /* Construct the API message */ - M (LISP_ADD_DEL_MAP_SERVER, lisp_add_del_map_server); + M (LISP_ADD_DEL_MAP_SERVER, mp); mp->is_add = is_add; if (ipv6_set) @@ -13837,7 +13835,7 @@ api_lisp_add_del_map_resolver (vat_main_t * vam) } /* Construct the API message */ - M (LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver); + M (LISP_ADD_DEL_MAP_RESOLVER, mp); mp->is_add = is_add; if (ipv6_set) @@ -13894,7 +13892,7 @@ api_lisp_gpe_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M (LISP_GPE_ENABLE_DISABLE, lisp_gpe_enable_disable); + M (LISP_GPE_ENABLE_DISABLE, mp); mp->is_en = is_en; @@ -13938,7 +13936,7 @@ api_lisp_rloc_probe_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M (LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable); + M (LISP_RLOC_PROBE_ENABLE_DISABLE, mp); mp->is_enabled = is_en; @@ -13982,7 +13980,7 @@ api_lisp_map_register_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M (LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable); + M (LISP_MAP_REGISTER_ENABLE_DISABLE, mp); mp->is_enabled = is_en; @@ -14028,7 +14026,7 @@ api_lisp_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M (LISP_ENABLE_DISABLE, lisp_enable_disable); + M (LISP_ENABLE_DISABLE, mp); mp->is_en = is_en; @@ -14048,7 +14046,7 @@ api_show_lisp_map_register_state (vat_main_t * vam) f64 timeout = ~0; vl_api_show_lisp_map_register_state_t *mp; - M (SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state); + M (SHOW_LISP_MAP_REGISTER_STATE, mp); /* send */ S; @@ -14065,7 +14063,7 @@ api_show_lisp_rloc_probe_state (vat_main_t * vam) f64 timeout = ~0; vl_api_show_lisp_rloc_probe_state_t *mp; - M (SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state); + M (SHOW_LISP_RLOC_PROBE_STATE, mp); /* send */ S; @@ -14082,7 +14080,7 @@ api_show_lisp_map_request_mode (vat_main_t * vam) f64 timeout = ~0; vl_api_show_lisp_map_request_mode_t *mp; - M (SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode); + M (SHOW_LISP_MAP_REQUEST_MODE, mp); /* send */ S; @@ -14115,7 +14113,7 @@ api_lisp_map_request_mode (vat_main_t * vam) } } - M (LISP_MAP_REQUEST_MODE, lisp_map_request_mode); + M (LISP_MAP_REQUEST_MODE, mp); mp->mode = mode; @@ -14165,7 +14163,7 @@ api_lisp_pitr_set_locator_set (vat_main_t * vam) return -99; } - M (LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set); + M (LISP_PITR_SET_LOCATOR_SET, mp); mp->is_add = is_add; clib_memcpy (mp->ls_name, ls_name, vec_len (ls_name)); @@ -14192,7 +14190,7 @@ api_show_lisp_pitr (vat_main_t * vam) print (vam->ofp, "%=20s", "lisp status:"); } - M (SHOW_LISP_PITR, show_lisp_pitr); + M (SHOW_LISP_PITR, mp); /* send it... */ S; @@ -14242,7 +14240,7 @@ api_lisp_eid_table_add_del_map (vat_main_t * vam) return -99; } - M (LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map); + M (LISP_EID_TABLE_ADD_DEL_MAP, mp); mp->is_add = is_add; mp->vni = htonl (vni); @@ -14388,7 +14386,7 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam) data_len = vec_len (rlocs) * sizeof (vl_api_remote_locator_t); - M2 (LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping, data_len); + M2 (LISP_ADD_DEL_REMOTE_MAPPING, mp, data_len); mp->is_add = is_add; mp->vni = htonl (vni); mp->action = (u8) action; @@ -14506,7 +14504,7 @@ api_lisp_add_del_adjacency (vat_main_t * vam) return -99; } - M (LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency); + M (LISP_ADD_DEL_ADJACENCY, mp); mp->is_add = is_add; mp->vni = htonl (vni); mp->leid_len = leid_len; @@ -14593,7 +14591,7 @@ api_lisp_gpe_add_del_iface (vat_main_t * vam) } /* Construct the API message */ - M (LISP_GPE_ADD_DEL_IFACE, lisp_gpe_add_del_iface); + M (LISP_GPE_ADD_DEL_IFACE, mp); mp->is_add = is_add; mp->dp_table = dp_table; @@ -14657,7 +14655,7 @@ api_lisp_add_del_map_request_itr_rlocs (vat_main_t * vam) return -99; } - M (LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, lisp_add_del_map_request_itr_rlocs); + M (LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, mp); mp->is_add = is_add; if (is_add) { @@ -14731,7 +14729,7 @@ api_lisp_locator_dump (vat_main_t * vam) print (vam->ofp, "%=16s%=16s%=16s", "locator", "priority", "weight"); } - M (LISP_LOCATOR_DUMP, lisp_locator_dump); + M (LISP_LOCATOR_DUMP, mp); mp->is_index_set = is_index_set; if (is_index_set) @@ -14749,7 +14747,7 @@ api_lisp_locator_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -14790,7 +14788,7 @@ api_lisp_locator_set_dump (vat_main_t * vam) print (vam->ofp, "%=10s%=15s", "ls_index", "ls_name"); } - M (LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump); + M (LISP_LOCATOR_SET_DUMP, mp); mp->filter = filter; @@ -14800,7 +14798,7 @@ api_lisp_locator_set_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -14850,7 +14848,7 @@ api_lisp_eid_table_map_dump (vat_main_t * vam) print (vam->ofp, "%=10s%=10s", "VNI", is_l2 ? "BD" : "VRF"); } - M (LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump); + M (LISP_EID_TABLE_MAP_DUMP, mp); mp->is_l2 = is_l2; /* send it... */ @@ -14859,7 +14857,7 @@ api_lisp_eid_table_map_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -14880,7 +14878,7 @@ api_lisp_eid_table_vni_dump (vat_main_t * vam) print (vam->ofp, "VNI"); } - M (LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump); + M (LISP_EID_TABLE_VNI_DUMP, mp); /* send it... */ S; @@ -14888,7 +14886,7 @@ api_lisp_eid_table_vni_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -14955,7 +14953,7 @@ api_lisp_eid_table_dump (vat_main_t * vam) "type", "ls_index", "ttl", "authoritative", "key_id", "key"); } - M (LISP_EID_TABLE_DUMP, lisp_eid_table_dump); + M (LISP_EID_TABLE_DUMP, mp); mp->filter = filter; if (eid_set) @@ -14988,7 +14986,7 @@ api_lisp_eid_table_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } @@ -15033,7 +15031,7 @@ api_lisp_gpe_fwd_entries_get (vat_main_t * vam) "leid", "reid"); } - M (LISP_GPE_FWD_ENTRIES_GET, lisp_gpe_fwd_entries_get); + M (LISP_GPE_FWD_ENTRIES_GET, mp); mp->vni = clib_host_to_net_u32 (vni); /* send it... */ @@ -15084,7 +15082,7 @@ api_lisp_adjacencies_get (vat_main_t * vam) print (vam->ofp, "%s %40s", "leid", "reid"); } - M (LISP_ADJACENCIES_GET, lisp_adjacencies_get); + M (LISP_ADJACENCIES_GET, mp); mp->vni = clib_host_to_net_u32 (vni); /* send it... */ @@ -15108,14 +15106,14 @@ api_lisp_map_server_dump (vat_main_t * vam) print (vam->ofp, "%=20s", "Map server"); } - M (LISP_MAP_SERVER_DUMP, lisp_map_server_dump); + M (LISP_MAP_SERVER_DUMP, mp); /* send it... */ S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -15136,14 +15134,14 @@ api_lisp_map_resolver_dump (vat_main_t * vam) print (vam->ofp, "%=20s", "Map resolver"); } - M (LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump); + M (LISP_MAP_RESOLVER_DUMP, mp); /* send it... */ S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -15164,7 +15162,7 @@ api_show_lisp_status (vat_main_t * vam) print (vam->ofp, "%-20s%-16s", "lisp status", "locator-set"); } - M (SHOW_LISP_STATUS, show_lisp_status); + M (SHOW_LISP_STATUS, mp); /* send it... */ S; /* Wait for a reply... */ @@ -15201,14 +15199,14 @@ api_lisp_gpe_fwd_entry_path_dump (vat_main_t * vam) print (vam->ofp, "first line"); } - M (LISP_GPE_FWD_ENTRY_PATH_DUMP, lisp_gpe_fwd_entry_path_dump); + M (LISP_GPE_FWD_ENTRY_PATH_DUMP, mp); /* send it... */ S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -15229,7 +15227,7 @@ api_lisp_get_map_request_itr_rlocs (vat_main_t * vam) print (vam->ofp, "%=20s", "itr-rlocs:"); } - M (LISP_GET_MAP_REQUEST_ITR_RLOCS, lisp_get_map_request_itr_rlocs); + M (LISP_GET_MAP_REQUEST_ITR_RLOCS, mp); /* send it... */ S; /* Wait for a reply... */ @@ -15273,7 +15271,7 @@ api_af_packet_create (vat_main_t * vam) return -99; } - M (AF_PACKET_CREATE, af_packet_create); + M (AF_PACKET_CREATE, mp); clib_memcpy (mp->host_if_name, host_if_name, vec_len (host_if_name)); clib_memcpy (mp->hw_addr, hw_addr, 6); @@ -15314,7 +15312,7 @@ api_af_packet_delete (vat_main_t * vam) return -99; } - M (AF_PACKET_DELETE, af_packet_delete); + M (AF_PACKET_DELETE, mp); clib_memcpy (mp->host_if_name, host_if_name, vec_len (host_if_name)); vec_free (host_if_name); @@ -15399,7 +15397,7 @@ api_policer_add_del (vat_main_t * vam) return -99; } - M (POLICER_ADD_DEL, policer_add_del); + M (POLICER_ADD_DEL, mp); clib_memcpy (mp->name, name, vec_len (name)); vec_free (name); @@ -15445,7 +15443,7 @@ api_policer_dump (vat_main_t * vam) break; } - M (POLICER_DUMP, policer_dump); + M (POLICER_DUMP, mp); mp->match_name_valid = match_name_valid; clib_memcpy (mp->match_name, match_name, vec_len (match_name)); vec_free (match_name); @@ -15455,7 +15453,7 @@ api_policer_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -15505,7 +15503,7 @@ api_policer_classify_set_interface (vat_main_t * vam) return -99; } - M (POLICER_CLASSIFY_SET_INTERFACE, policer_classify_set_interface); + M (POLICER_CLASSIFY_SET_INTERFACE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->ip4_table_index = ntohl (ip4_table_index); @@ -15540,7 +15538,7 @@ api_policer_classify_dump (vat_main_t * vam) print (vam->ofp, "%10s%20s", "Intfc idx", "Classify table"); } - M (POLICER_CLASSIFY_DUMP, policer_classify_dump); + M (POLICER_CLASSIFY_DUMP, mp); mp->type = type; /* send it... */ S; @@ -15548,7 +15546,7 @@ api_policer_classify_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -15600,7 +15598,7 @@ api_netmap_create (vat_main_t * vam) return -99; } - M (NETMAP_CREATE, netmap_create); + M (NETMAP_CREATE, mp); clib_memcpy (mp->netmap_if_name, if_name, vec_len (if_name)); clib_memcpy (mp->hw_addr, hw_addr, 6); @@ -15643,7 +15641,7 @@ api_netmap_delete (vat_main_t * vam) return -99; } - M (NETMAP_DELETE, netmap_delete); + M (NETMAP_DELETE, mp); clib_memcpy (mp->netmap_if_name, if_name, vec_len (if_name)); vec_free (if_name); @@ -15722,14 +15720,14 @@ api_mpls_tunnel_dump (vat_main_t * vam) print (vam->ofp, " tunnel_index %d", index); - M (MPLS_TUNNEL_DUMP, mpls_tunnel_dump); + M (MPLS_TUNNEL_DUMP, mp); mp->tunnel_index = htonl (index); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -15822,13 +15820,13 @@ api_mpls_fib_dump (vat_main_t * vam) vl_api_mpls_fib_dump_t *mp; f64 timeout; - M (MPLS_FIB_DUMP, mpls_fib_dump); + M (MPLS_FIB_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -15923,13 +15921,13 @@ api_ip_fib_dump (vat_main_t * vam) vl_api_ip_fib_dump_t *mp; f64 timeout; - M (IP_FIB_DUMP, ip_fib_dump); + M (IP_FIB_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -16012,7 +16010,7 @@ api_ip_neighbor_dump (vat_main_t * vam) return -99; } - M (IP_NEIGHBOR_DUMP, ip_neighbor_dump); + M (IP_NEIGHBOR_DUMP, mp); mp->is_ipv6 = (u8) is_ipv6; mp->sw_if_index = ntohl (sw_if_index); S; @@ -16020,7 +16018,7 @@ api_ip_neighbor_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -16115,13 +16113,13 @@ api_ip6_fib_dump (vat_main_t * vam) vl_api_ip6_fib_dump_t *mp; f64 timeout; - M (IP6_FIB_DUMP, ip6_fib_dump); + M (IP6_FIB_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -16134,7 +16132,7 @@ api_classify_table_ids (vat_main_t * vam) f64 timeout; /* Construct the API message */ - M (CLASSIFY_TABLE_IDS, classify_table_ids); + M (CLASSIFY_TABLE_IDS, mp); mp->context = 0; S; @@ -16167,7 +16165,7 @@ api_classify_table_by_interface (vat_main_t * vam) } /* Construct the API message */ - M (CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface); + M (CLASSIFY_TABLE_BY_INTERFACE, mp); mp->context = 0; mp->sw_if_index = ntohl (sw_if_index); @@ -16199,7 +16197,7 @@ api_classify_table_info (vat_main_t * vam) } /* Construct the API message */ - M (CLASSIFY_TABLE_INFO, classify_table_info); + M (CLASSIFY_TABLE_INFO, mp); mp->context = 0; mp->table_id = ntohl (table_id); @@ -16231,7 +16229,7 @@ api_classify_session_dump (vat_main_t * vam) } /* Construct the API message */ - M (CLASSIFY_SESSION_DUMP, classify_session_dump); + M (CLASSIFY_SESSION_DUMP, mp); mp->context = 0; mp->table_id = ntohl (table_id); S; @@ -16239,7 +16237,7 @@ api_classify_session_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -16301,7 +16299,7 @@ api_ipfix_exporter_dump (vat_main_t * vam) f64 timeout; /* Construct the API message */ - M (IPFIX_EXPORTER_DUMP, ipfix_exporter_dump); + M (IPFIX_EXPORTER_DUMP, mp); mp->context = 0; S; @@ -16317,7 +16315,7 @@ api_ipfix_classify_stream_dump (vat_main_t * vam) f64 timeout; /* Construct the API message */ - M (IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump); + M (IPFIX_CLASSIFY_STREAM_DUMP, mp); mp->context = 0; S; @@ -16367,7 +16365,7 @@ api_ipfix_classify_table_dump (vat_main_t * vam) } /* Construct the API message */ - M (IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump); + M (IPFIX_CLASSIFY_TABLE_DUMP, mp); /* send it... */ S; @@ -16375,7 +16373,7 @@ api_ipfix_classify_table_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -16447,7 +16445,7 @@ api_sw_interface_span_enable_disable (vat_main_t * vam) break; } - M (SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable); + M (SW_INTERFACE_SPAN_ENABLE_DISABLE, mp); mp->sw_if_index_from = htonl (src_sw_if_index); mp->sw_if_index_to = htonl (dst_sw_if_index); @@ -16546,13 +16544,13 @@ api_sw_interface_span_dump (vat_main_t * vam) vl_api_sw_interface_span_dump_t *mp; f64 timeout; - M (SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump); + M (SW_INTERFACE_SPAN_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -16580,7 +16578,7 @@ api_pg_create_interface (vat_main_t * vam) } /* Construct the API message */ - M (PG_CREATE_INTERFACE, pg_create_interface); + M (PG_CREATE_INTERFACE, mp); mp->context = 0; mp->interface_id = ntohl (if_id); @@ -16631,7 +16629,7 @@ api_pg_capture (vat_main_t * vam) u32 name_len = vec_len (pcap_file); /* Construct the API message */ - M (PG_CAPTURE, pg_capture); + M (PG_CAPTURE, mp); mp->context = 0; mp->interface_id = ntohl (if_id); mp->is_enabled = enable; @@ -16680,7 +16678,7 @@ api_pg_enable_disable (vat_main_t * vam) u32 name_len = vec_len (stream_name); /* Construct the API message */ - M (PG_ENABLE_DISABLE, pg_enable_disable); + M (PG_ENABLE_DISABLE, mp); mp->context = 0; mp->is_enabled = enable; if (stream_name_set != 0) @@ -16795,8 +16793,7 @@ api_ip_source_and_port_range_check_add_del (vat_main_t * vam) return -99; } - M (IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, - ip_source_and_port_range_check_add_del); + M (IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, mp); mp->is_add = is_add; @@ -16881,8 +16878,7 @@ api_ip_source_and_port_range_check_interface_add_del (vat_main_t * vam) } /* Construct the API message */ - M (IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, - ip_source_and_port_range_check_interface_add_del); + M (IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, mp); mp->sw_if_index = ntohl (sw_if_index); mp->is_add = is_add; @@ -16929,7 +16925,7 @@ api_ipsec_gre_add_del_tunnel (vat_main_t * vam) } } - M (IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel); + M (IPSEC_GRE_ADD_DEL_TUNNEL, mp); mp->local_sa_id = ntohl (local_sa_id); mp->remote_sa_id = ntohl (remote_sa_id); @@ -16971,7 +16967,7 @@ api_punt (vat_main_t * vam) } } - M (PUNT, punt); + M (PUNT, mp); mp->is_add = (u8) is_add; mp->ipv = (u8) ipv; @@ -17051,7 +17047,7 @@ api_ipsec_gre_tunnel_dump (vat_main_t * vam) } /* Get list of gre-tunnel interfaces */ - M (IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump); + M (IPSEC_GRE_TUNNEL_DUMP, mp); mp->sw_if_index = htonl (sw_if_index); @@ -17060,7 +17056,7 @@ api_ipsec_gre_tunnel_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -17091,7 +17087,7 @@ api_delete_subif (vat_main_t * vam) } /* Construct the API message */ - M (DELETE_SUBIF, delete_subif); + M (DELETE_SUBIF, mp); mp->sw_if_index = ntohl (sw_if_index); S; @@ -17174,7 +17170,7 @@ api_l2_interface_pbb_tag_rewrite (vat_main_t * vam) return -99; } - M (L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite); + M (L2_INTERFACE_PBB_TAG_REWRITE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->vtr_op = ntohl (vtr_op); mp->outer_tag = ntohs (outer_tag); @@ -17226,7 +17222,7 @@ api_flow_classify_set_interface (vat_main_t * vam) return -99; } - M (FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface); + M (FLOW_CLASSIFY_SET_INTERFACE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->ip4_table_index = ntohl (ip4_table_index); @@ -17260,7 +17256,7 @@ api_flow_classify_dump (vat_main_t * vam) print (vam->ofp, "%10s%20s", "Intfc idx", "Classify table"); } - M (FLOW_CLASSIFY_DUMP, flow_classify_dump); + M (FLOW_CLASSIFY_DUMP, mp); mp->type = type; /* send it... */ S; @@ -17268,7 +17264,7 @@ api_flow_classify_dump (vat_main_t * vam) /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } /* Wait for a reply... */ @@ -17333,7 +17329,7 @@ api_feature_enable_disable (vat_main_t * vam) } /* Construct the API message */ - M (FEATURE_ENABLE_DISABLE, feature_enable_disable); + M (FEATURE_ENABLE_DISABLE, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable = enable; clib_memcpy (mp->arc_name, arc_name, vec_len (arc_name)); @@ -17382,7 +17378,7 @@ api_sw_interface_tag_add_del (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del); + M (SW_INTERFACE_TAG_ADD_DEL, mp); mp->sw_if_index = ntohl (sw_if_index); mp->is_add = enable; if (enable) @@ -17433,14 +17429,14 @@ api_l2_xconnect_dump (vat_main_t * vam) print (vam->ofp, "%15s%15s", "rx_sw_if_index", "tx_sw_if_index"); } - M (L2_XCONNECT_DUMP, l2_xconnect_dump); + M (L2_XCONNECT_DUMP, mp); S; /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; - M (CONTROL_PING, control_ping); + M (CONTROL_PING, mp); S; } W; @@ -17480,7 +17476,7 @@ api_sw_interface_set_mtu (vat_main_t * vam) } /* Construct the API message */ - M (SW_INTERFACE_SET_MTU, sw_interface_set_mtu); + M (SW_INTERFACE_SET_MTU, mp); mp->sw_if_index = ntohl (sw_if_index); mp->mtu = ntohs ((u16) mtu); -- cgit 1.2.3-korg From 7bc770ceb62ede18414b7bb5788692e32477e373 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Tue, 31 Jan 2017 14:03:33 -0600 Subject: Convert message macro S to accept a message pointer parameter; Rather than blindly assume an unbound, fixed message parameter explicilty pass it as a paramter to the S() macro. Change-Id: Ieea1f1815cadd2eec7d9240408d69acdc3caa49a Signed-off-by: Jon Loeliger --- build-root/emacs-lisp/plugin-test-skel.el | 4 +- src/examples/sample-plugin/sample/sample_test.c | 2 +- src/plugins/acl/acl_test.c | 24 +- src/plugins/flowperpkt/flowperpkt_test.c | 2 +- .../export-vxlan-gpe/vxlan_gpe_ioam_export_test.c | 2 +- src/plugins/ioam/export/ioam_export_test.c | 2 +- src/plugins/ioam/lib-pot/pot_test.c | 12 +- src/plugins/ioam/lib-trace/trace_test.c | 6 +- src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c | 12 +- src/plugins/lb/lb_test.c | 6 +- src/plugins/snat/snat_test.c | 41 +- src/vat/api_format.c | 464 ++++++++++----------- src/vlibapi/vat_helper_macros.h | 2 +- 13 files changed, 295 insertions(+), 284 deletions(-) (limited to 'src/plugins/ioam/lib-pot/pot_test.c') diff --git a/build-root/emacs-lisp/plugin-test-skel.el b/build-root/emacs-lisp/plugin-test-skel.el index d69aa2ce..6d399468 100644 --- a/build-root/emacs-lisp/plugin-test-skel.el +++ b/build-root/emacs-lisp/plugin-test-skel.el @@ -128,7 +128,7 @@ do { \\ } while(0); /* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) +#define S(mp) (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) /* W: wait for results, with timeout */ #define W \\ @@ -175,7 +175,7 @@ static int api_" plugin-name "_enable_disable (vat_main_t * vam) mp->enable_disable = enable_disable; /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; diff --git a/src/examples/sample-plugin/sample/sample_test.c b/src/examples/sample-plugin/sample/sample_test.c index 5dcee809..bf7a0590 100644 --- a/src/examples/sample-plugin/sample/sample_test.c +++ b/src/examples/sample-plugin/sample/sample_test.c @@ -122,7 +122,7 @@ static int api_sample_macswap_enable_disable (vat_main_t * vam) mp->enable_disable = enable_disable; /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c index 04683a12..70fd6959 100644 --- a/src/plugins/acl/acl_test.c +++ b/src/plugins/acl/acl_test.c @@ -276,7 +276,7 @@ static int api_acl_plugin_get_version (vat_main_t * vam) mp->client_index = vam->my_client_index; /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -298,7 +298,7 @@ static int api_macip_acl_interface_get (vat_main_t * vam) mp->client_index = vam->my_client_index; /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -479,7 +479,7 @@ static int api_acl_add_replace (vat_main_t * vam) mp->count = htonl(n_rules); /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -502,7 +502,7 @@ static int api_acl_del (vat_main_t * vam) mp->acl_index = ntohl(acl_index); /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -525,7 +525,7 @@ static int api_macip_acl_del (vat_main_t * vam) mp->acl_index = ntohl(acl_index); /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -592,7 +592,7 @@ static int api_acl_interface_add_del (vat_main_t * vam) mp->is_input = is_input; /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -642,7 +642,7 @@ static int api_macip_acl_interface_add_del (vat_main_t * vam) mp->is_add = is_add; /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -699,7 +699,7 @@ static int api_acl_interface_set_acl_list (vat_main_t * vam) clib_memcpy(mp->acls, inacls, vec_len(inacls)*sizeof(u32)); /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -728,7 +728,7 @@ static int api_acl_interface_list_dump (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -754,7 +754,7 @@ static int api_acl_dump (vat_main_t * vam) mp->acl_index = ntohl (acl_index); /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -780,7 +780,7 @@ static int api_macip_acl_dump (vat_main_t * vam) mp->acl_index = ntohl (acl_index); /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; @@ -912,7 +912,7 @@ static int api_macip_acl_add (vat_main_t * vam) mp->count = htonl(n_rules); /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; diff --git a/src/plugins/flowperpkt/flowperpkt_test.c b/src/plugins/flowperpkt/flowperpkt_test.c index 70b4a34a..d5edc4ad 100644 --- a/src/plugins/flowperpkt/flowperpkt_test.c +++ b/src/plugins/flowperpkt/flowperpkt_test.c @@ -129,7 +129,7 @@ api_flowperpkt_tx_interface_add_del (vat_main_t * vam) mp->which = which; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c index b9f61d9a..161b5241 100644 --- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c +++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c @@ -110,7 +110,7 @@ api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam) mp->is_disable = is_disable; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; diff --git a/src/plugins/ioam/export/ioam_export_test.c b/src/plugins/ioam/export/ioam_export_test.c index b9686058..45c4ca56 100644 --- a/src/plugins/ioam/export/ioam_export_test.c +++ b/src/plugins/ioam/export/ioam_export_test.c @@ -112,7 +112,7 @@ api_ioam_export_ip6_enable_disable (vat_main_t * vam) mp->is_disable = is_disable; /* send it... */ - S; + S(mp); /* Wait for a reply... */ W; diff --git a/src/plugins/ioam/lib-pot/pot_test.c b/src/plugins/ioam/lib-pot/pot_test.c index 48d5bd40..4f049be8 100644 --- a/src/plugins/ioam/lib-pot/pot_test.c +++ b/src/plugins/ioam/lib-pot/pot_test.c @@ -188,7 +188,8 @@ static int api_pot_profile_add (vat_main_t *vam) mp->id = id; mp->max_bits = bits; - S; W; + S(mp); + W; OUT: vec_free(name); @@ -228,7 +229,8 @@ static int api_pot_profile_activate (vat_main_t *vam) clib_memcpy(mp->list_name, name, mp->list_name_len); mp->id = id; - S; W; + S(mp); + W; OUT: vec_free(name); @@ -243,7 +245,8 @@ static int api_pot_profile_del (vat_main_t *vam) M(POT_PROFILE_DEL, mp); mp->list_name_len = 0; - S; W; + S(mp); + W; return 0; } @@ -264,7 +267,8 @@ static int api_pot_profile_show_config_dump (vat_main_t *vam) mp->id = id; - S; W; + S(mp); + W; return 0; } diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c index a1354327..5093f330 100644 --- a/src/plugins/ioam/lib-trace/trace_test.c +++ b/src/plugins/ioam/lib-trace/trace_test.c @@ -157,7 +157,7 @@ api_trace_profile_add (vat_main_t * vam) mp->app_data = htonl (app_data); mp->num_elts = num_elts; - S; + S (mp); W; return (rv); @@ -172,7 +172,7 @@ api_trace_profile_del (vat_main_t * vam) f64 timeout; M (TRACE_PROFILE_DEL, mp); - S; + S (mp); W; return 0; } @@ -183,7 +183,7 @@ api_trace_profile_show_config (vat_main_t * vam) vl_api_trace_profile_show_config_t *mp; f64 timeout; M (TRACE_PROFILE_SHOW_CONFIG, mp); - S; + S (mp); W; return 0; } diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c index 5d36547f..ee25a874 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c @@ -132,7 +132,7 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam) mp->trace_enable = has_trace_option; - S; + S (mp); W; return (0); @@ -146,7 +146,7 @@ api_vxlan_gpe_ioam_disable (vat_main_t * vam) f64 timeout; M (VXLAN_GPE_IOAM_DISABLE, mp); - S; + S (mp); W; return 0; } @@ -240,7 +240,7 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) mp->vni = ntohl (vni); mp->is_ipv6 = ipv6_set; - S; + S (mp); W; return (0); @@ -335,7 +335,7 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) mp->vni = ntohl (vni); mp->is_ipv6 = ipv6_set; - S; + S (mp); W; return 0; @@ -405,7 +405,7 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) mp->outer_fib_index = htonl (outer_fib_index); mp->is_ipv6 = ipv6_set; - S; + S (mp); W; return (0); @@ -474,7 +474,7 @@ api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam) mp->outer_fib_index = htonl (outer_fib_index); mp->is_ipv6 = ipv6_set; - S; + S (mp); W; diff --git a/src/plugins/lb/lb_test.c b/src/plugins/lb/lb_test.c index c150ea32..f553a93e 100644 --- a/src/plugins/lb/lb_test.c +++ b/src/plugins/lb/lb_test.c @@ -146,7 +146,7 @@ static int api_lb_conf (vat_main_t * vam) } M(LB_CONF, mp); - S; + S(mp); W; /* NOTREACHED */ @@ -186,7 +186,7 @@ static int api_lb_add_del_vip (vat_main_t * vam) } M(LB_ADD_DEL_VIP, mp); - S; + S(mp); W; /* NOTREACHED */ return 0; @@ -211,7 +211,7 @@ static int api_lb_add_del_as (vat_main_t * vam) } M(LB_ADD_DEL_AS, mp); - S; + S(mp); W; /* NOTREACHED */ return 0; diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c index c6f9a8ff..c0913f37 100644 --- a/src/plugins/snat/snat_test.c +++ b/src/plugins/snat/snat_test.c @@ -159,7 +159,8 @@ static int api_snat_add_address_range (vat_main_t * vam) mp->is_ip4 = 1; mp->is_add = is_add; - S; W; + S(mp); + W; /* NOTREACHED */ return 0; @@ -205,7 +206,8 @@ static int api_snat_interface_add_del_feature (vat_main_t * vam) mp->is_add = is_add; mp->is_inside = is_inside; - S; W; + S(mp); + W; /* NOTREACHED */ return 0; } @@ -273,7 +275,8 @@ static int api_snat_add_static_mapping(vat_main_t * vam) memcpy (mp->local_ip_address, &local_addr, 4); memcpy (mp->external_ip_address, &external_addr, 4); - S; W; + S(mp); + W; /* NOTREACHED */ return 0; } @@ -331,12 +334,12 @@ static int api_snat_static_mapping_dump(vat_main_t * vam) "port", "vrf"); M(SNAT_STATIC_MAPPING_DUMP, mp); - S; + S(mp); /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; M(SNAT_CONTROL_PING, mp); - S; + S(mp); } W; /* NOTREACHED */ @@ -386,7 +389,8 @@ static int api_snat_show_config(vat_main_t * vam) } M(SNAT_SHOW_CONFIG, mp); - S; W; + S(mp); + W; /* NOTREACHED */ return 0; } @@ -412,12 +416,12 @@ static int api_snat_address_dump(vat_main_t * vam) } M(SNAT_ADDRESS_DUMP, mp); - S; + S(mp); /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; M(SNAT_CONTROL_PING, mp); - S; + S(mp); } W; /* NOTREACHED */ @@ -446,12 +450,12 @@ static int api_snat_interface_dump(vat_main_t * vam) } M(SNAT_INTERFACE_DUMP, mp); - S; + S(mp); /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; M(SNAT_CONTROL_PING, mp); - S; + S(mp); } W; /* NOTREACHED */ @@ -479,7 +483,8 @@ static int api_snat_set_workers (vat_main_t * vam) M(SNAT_SET_WORKERS, mp); mp->worker_mask = clib_host_to_net_u64 (bitmap[0]); - S; W; + S(mp); + W; /* NOTREACHED */ return 0; @@ -507,12 +512,12 @@ static int api_snat_worker_dump(vat_main_t * vam) } M(SNAT_WORKER_DUMP, mp); - S; + S(mp); /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; M(SNAT_CONTROL_PING, mp); - S; + S(mp); } W; /* NOTREACHED */ @@ -553,7 +558,8 @@ static int api_snat_ipfix_enable_disable (vat_main_t * vam) mp->sw_if_index = ntohl(sw_if_index); mp->is_add = is_add; - S; W; + S(mp); + W; /* NOTREACHED */ return 0; } @@ -579,12 +585,12 @@ static int api_snat_interface_addr_dump(vat_main_t * vam) } M(SNAT_INTERFACE_ADDR_DUMP, mp); - S; + S(mp); /* Use a control ping for synchronization */ { vl_api_snat_control_ping_t *mp; M(SNAT_CONTROL_PING, mp); - S; + S(mp); } W; /* NOTREACHED */ @@ -620,7 +626,8 @@ static int api_snat_add_del_interface_addr (vat_main_t * vam) mp->src_port = htons((u16) src_port); mp->enable = enable; - S; W; + S(mp); + W; /* NOTREACHED */ return 0; } diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 02987eb9..b374b281 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -4608,7 +4608,7 @@ exec (vat_main_t * vam) pthread_mutex_unlock (&am->vlib_rp->mutex); mp->cmd_in_shmem = (u64) cmd; - S; + S (mp); timeout = vat_time_now (vam) + 10.0; while (vat_time_now (vam) < timeout) @@ -4667,7 +4667,7 @@ exec_inband (vat_main_t * vam) clib_memcpy (mp->cmd, vam->input->buffer, len); mp->length = htonl (len); - S; + S (mp); W2 (print (vam->ofp, "%s", vam->cmd_reply)); } @@ -4695,7 +4695,7 @@ api_create_loopback (vat_main_t * vam) if (mac_set) clib_memcpy (mp->mac_address, mac_address, sizeof (mac_address)); - S; + S (mp); W; } @@ -4725,7 +4725,7 @@ api_delete_loopback (vat_main_t * vam) M (DELETE_LOOPBACK, mp); mp->sw_if_index = ntohl (sw_if_index); - S; + S (mp); W; } @@ -4756,7 +4756,7 @@ api_want_stats (vat_main_t * vam) M (WANT_STATS, mp); mp->enable_disable = enable; - S; + S (mp); W; } @@ -4789,7 +4789,7 @@ api_want_interface_events (vat_main_t * vam) vam->interface_event_display = enable; - S; + S (mp); W; } @@ -4833,70 +4833,70 @@ api_sw_interface_dump (vat_main_t * vam) M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "Ether", sizeof (mp->name_filter) - 1); - S; + S (mp); /* and local / loopback interfaces */ M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "lo", sizeof (mp->name_filter) - 1); - S; + S (mp); /* and packet-generator interfaces */ M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "pg", sizeof (mp->name_filter) - 1); - S; + S (mp); /* and vxlan-gpe tunnel interfaces */ M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "vxlan_gpe", sizeof (mp->name_filter) - 1); - S; + S (mp); /* and vxlan tunnel interfaces */ M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "vxlan", sizeof (mp->name_filter) - 1); - S; + S (mp); /* and host (af_packet) interfaces */ M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "host", sizeof (mp->name_filter) - 1); - S; + S (mp); /* and l2tpv3 tunnel interfaces */ M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "l2tpv3_tunnel", sizeof (mp->name_filter) - 1); - S; + S (mp); /* and GRE tunnel interfaces */ M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "gre", sizeof (mp->name_filter) - 1); - S; + S (mp); /* and LISP-GPE interfaces */ M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "lisp_gpe", sizeof (mp->name_filter) - 1); - S; + S (mp); /* and IPSEC tunnel interfaces */ M (SW_INTERFACE_DUMP, mp); mp->name_filter_valid = 1; strncpy ((char *) mp->name_filter, "ipsec", sizeof (mp->name_filter) - 1); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -4944,7 +4944,7 @@ api_sw_interface_set_flags (vat_main_t * vam) mp->link_up_down = link_up; /* send it... */ - S; + S (mp); /* Wait for a reply, return the good/bad news... */ W; @@ -4979,7 +4979,7 @@ api_sw_interface_clear_stats (vat_main_t * vam) mp->sw_if_index = ~0; /* send it... */ - S; + S (mp); /* Wait for a reply, return the good/bad news... */ W; @@ -5053,7 +5053,7 @@ api_sw_interface_set_dpdk_hqos_pipe (vat_main_t * vam) mp->profile = ntohl (profile); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -5134,7 +5134,7 @@ api_sw_interface_set_dpdk_hqos_subport (vat_main_t * vam) mp->tc_rate[3] = ntohl (tc_rate[3]); mp->tc_period = ntohl (tc_period); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -5201,7 +5201,7 @@ api_sw_interface_set_dpdk_hqos_tctbl (vat_main_t * vam) mp->tc = ntohl (tc); mp->queue = ntohl (queue); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -5279,7 +5279,7 @@ api_sw_interface_add_del_address (vat_main_t * vam) mp->address_length = address_length; /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -5323,7 +5323,7 @@ api_sw_interface_set_mpls_enable (vat_main_t * vam) mp->enable = enable; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -5368,7 +5368,7 @@ api_sw_interface_set_table (vat_main_t * vam) mp->vrf_id = ntohl (vrf_id); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -5435,7 +5435,7 @@ api_sw_interface_get_table (vat_main_t * vam) mp->sw_if_index = htonl (sw_if_index); mp->is_ipv6 = is_ipv6; - S; + S (mp); W; } @@ -5477,7 +5477,7 @@ api_sw_interface_set_vpath (vat_main_t * vam) mp->enable = is_enable; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -5527,7 +5527,7 @@ api_sw_interface_set_vxlan_bypass (vat_main_t * vam) mp->is_ipv6 = is_ipv6; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -5600,7 +5600,7 @@ api_sw_interface_set_l2_xconnect (vat_main_t * vam) mp->tx_sw_if_index = ntohl (tx_sw_if_index); mp->enable = enable; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -5663,7 +5663,7 @@ api_sw_interface_set_l2_bridge (vat_main_t * vam) mp->bvi = bvi; mp->enable = enable; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -5688,13 +5688,13 @@ api_bridge_domain_dump (vat_main_t * vam) M (BRIDGE_DOMAIN_DUMP, mp); mp->bd_id = ntohl (bd_id); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; @@ -5762,7 +5762,7 @@ api_bridge_domain_add_del (vat_main_t * vam) mp->is_add = is_add; mp->mac_age = (u8) mac_age; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -5871,7 +5871,7 @@ api_l2fib_add_del (vat_main_t * vam) } increment_mac_address (&mac); /* send it... */ - S; + S (mp); } if (count > 1) @@ -5883,7 +5883,7 @@ api_l2fib_add_del (vat_main_t * vam) vam->async_mode = 0; M (CONTROL_PING, mp); - S; + S (mp); timeout = vat_time_now (vam) + 1.0; while (vat_time_now (vam) < timeout) @@ -5964,7 +5964,7 @@ api_l2_flags (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->feature_bitmap = ntohl (feature_bitmap); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -6016,7 +6016,7 @@ api_bridge_flags (vat_main_t * vam) mp->feature_bitmap = ntohl (flags); mp->is_set = is_set; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -6091,7 +6091,7 @@ api_bd_ip_mac_add_del (vat_main_t * vam) else clib_memcpy (mp->ip_address, &v4addr, sizeof (v4addr)); clib_memcpy (mp->mac_address, macaddr, 6); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -6184,7 +6184,7 @@ api_tap_connect (vat_main_t * vam) vec_free (tag); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -6250,7 +6250,7 @@ api_tap_modify (vat_main_t * vam) vec_free (tap_name); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -6288,7 +6288,7 @@ api_tap_delete (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -6538,7 +6538,7 @@ api_ip_add_del_route (vat_main_t * vam) increment_v4_address (&v4_dst_address); } /* send it... */ - S; + S (mp); /* If we receive SIGTERM, stop now... */ if (vam->do_exit) break; @@ -6554,7 +6554,7 @@ api_ip_add_del_route (vat_main_t * vam) vam->async_mode = 0; M (CONTROL_PING, mp); - S; + S (mp); timeout = vat_time_now (vam) + 1.0; while (vat_time_now (vam) < timeout) @@ -6703,7 +6703,7 @@ api_ip_mroute_add_del (vat_main_t * vam) } /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; } @@ -6876,7 +6876,7 @@ api_mpls_route_add_del (vat_main_t * vam) local_label++; /* send it... */ - S; + S (mp); /* If we receive SIGTERM, stop now... */ if (vam->do_exit) break; @@ -6892,7 +6892,7 @@ api_mpls_route_add_del (vat_main_t * vam) vam->async_mode = 0; M (CONTROL_PING, mp); - S; + S (mp); timeout = vat_time_now (vam) + 1.0; while (vat_time_now (vam) < timeout) @@ -7006,7 +7006,7 @@ api_mpls_ip_bind_unbind (vat_main_t * vam) clib_memcpy (mp->mb_address, &v6_address, sizeof (v6_address)); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -7052,7 +7052,7 @@ api_proxy_arp_add_del (vat_main_t * vam) clib_memcpy (mp->low_address, &lo, sizeof (mp->low_address)); clib_memcpy (mp->hi_address, &hi, sizeof (mp->hi_address)); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7096,7 +7096,7 @@ api_proxy_arp_intfc_enable_disable (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->enable_disable = enable; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7182,7 +7182,7 @@ api_mpls_tunnel_add_del (vat_main_t * vam) &v6_next_hop_address, sizeof (v6_next_hop_address)); } - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7228,7 +7228,7 @@ api_sw_interface_set_unnumbered (vat_main_t * vam) mp->unnumbered_sw_if_index = ntohl (unnum_sw_index); mp->is_add = is_add; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7320,7 +7320,7 @@ api_ip_neighbor_add_del (vat_main_t * vam) } /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -7363,7 +7363,7 @@ api_reset_vrf (vat_main_t * vam) mp->vrf_id = ntohl (vrf_id); mp->is_ipv6 = is_ipv6; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7412,7 +7412,7 @@ api_create_vlan_subif (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->vlan_id = ntohl (vlan_id); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7497,7 +7497,7 @@ api_create_subif (vat_main_t * vam) mp->outer_vlan_id = ntohs (outer_vlan_id); mp->inner_vlan_id = ntohs (inner_vlan_id); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7551,7 +7551,7 @@ api_oam_add_del (vat_main_t * vam) clib_memcpy (mp->src_address, &src, sizeof (mp->src_address)); clib_memcpy (mp->dst_address, &dst, sizeof (mp->dst_address)); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7591,7 +7591,7 @@ api_reset_fib (vat_main_t * vam) mp->vrf_id = ntohl (vrf_id); mp->is_ipv6 = is_ipv6; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7684,7 +7684,7 @@ api_dhcp_proxy_config (vat_main_t * vam) } /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -7783,7 +7783,7 @@ api_dhcp_proxy_config_2 (vat_main_t * vam) } /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -7849,7 +7849,7 @@ api_dhcp_proxy_set_vss (vat_main_t * vam) mp->is_ipv6 = is_ipv6; mp->is_add = is_add; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -7908,7 +7908,7 @@ api_dhcp_client_config (vat_main_t * vam) mp->pid = getpid (); /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -7974,7 +7974,7 @@ api_set_ip_flow_hash (vat_main_t * vam) mp->vrf_id = ntohl (vrf_id); mp->is_ipv6 = is_ipv6; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -8018,7 +8018,7 @@ api_sw_interface_ip6_enable_disable (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->enable = enable; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -8066,7 +8066,7 @@ api_sw_interface_ip6_set_link_local_address (vat_main_t * vam) clib_memcpy (mp->address, &v6address, sizeof (v6address)); /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -8156,7 +8156,7 @@ api_sw_interface_ip6nd_ra_prefix (vat_main_t * vam) mp->pref_lifetime = ntohl (pref_lifetime); /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -8253,7 +8253,7 @@ api_sw_interface_ip6nd_ra_config (vat_main_t * vam) mp->default_router = default_router; /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -8296,7 +8296,7 @@ api_set_arp_neighbor_limit (vat_main_t * vam) mp->arp_neighbor_limit = ntohl (arp_nbr_limit); mp->is_ipv6 = is_ipv6; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -8367,7 +8367,7 @@ api_l2_patch_add_del (vat_main_t * vam) mp->tx_sw_if_index = ntohl (tx_sw_if_index); mp->is_add = is_add; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -8405,7 +8405,7 @@ api_ioam_enable (vat_main_t * vam) mp->pot_enable = has_pot_option; mp->trace_enable = has_trace_option; - S; + S (mp); W; return (0); @@ -8420,7 +8420,7 @@ api_ioam_disable (vat_main_t * vam) f64 timeout; M (IOAM_DISABLE, mp); - S; + S (mp); W; return 0; } @@ -8553,7 +8553,7 @@ api_sr_tunnel_add_del (vat_main_t * vam) vec_free (segments); vec_free (tags); - S; + S (mp); W; /* NOTREACHED */ } @@ -8637,7 +8637,7 @@ api_sr_policy_add_del (vat_main_t * vam) vec_free (tunnel_names); vec_free (tunnel_name); - S; + S (mp); W; /* NOTREACHED */ } @@ -8690,7 +8690,7 @@ api_sr_multicast_map_add_del (vat_main_t * vam) vec_free (policy_name); - S; + S (mp); W; /* NOTREACHED */ } @@ -9406,7 +9406,7 @@ api_classify_add_del_table (vat_main_t * vam) vec_free (mask); - S; + S (mp); W; /* NOTREACHED */ } @@ -9936,7 +9936,7 @@ api_classify_add_del_session (vat_main_t * vam) clib_memcpy (mp->match, match, vec_len (match)); vec_free (match); - S; + S (mp); W; /* NOTREACHED */ } @@ -9980,7 +9980,7 @@ api_classify_set_interface_ip_table (vat_main_t * vam) mp->table_index = ntohl (table_index); mp->is_ipv6 = is_ipv6; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10035,7 +10035,7 @@ api_classify_set_interface_l2_tables (vat_main_t * vam) mp->other_table_index = ntohl (other_table_index); mp->is_input = (u8) is_input; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10102,7 +10102,7 @@ api_set_ipfix_exporter (vat_main_t * vam) mp->template_interval = htonl (template_interval); mp->udp_checksum = udp_checksum; - S; + S (mp); W; /* NOTREACHED */ } @@ -10134,7 +10134,7 @@ api_set_ipfix_classify_stream (vat_main_t * vam) mp->domain_id = htonl (domain_id); mp->src_port = htons ((u16) src_port); - S; + S (mp); W; /* NOTREACHED */ } @@ -10196,7 +10196,7 @@ api_ipfix_classify_table_add_del (vat_main_t * vam) mp->ip_version = ip_version; mp->transport_protocol = transport_protocol; - S; + S (mp); W; /* NOTREACHED */ } @@ -10231,7 +10231,7 @@ api_get_node_index (vat_main_t * vam) clib_memcpy (mp->node_name, name, vec_len (name)); vec_free (name); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10281,7 +10281,7 @@ api_get_next_index (vat_main_t * vam) vec_free (node_name); vec_free (next_node_name); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10332,7 +10332,7 @@ api_add_node_next (vat_main_t * vam) vec_free (name); vec_free (next); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10401,7 +10401,7 @@ api_l2tpv3_create_tunnel (vat_main_t * vam) mp->l2_sublayer_present = l2_sublayer_present; mp->is_ipv6 = 1; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10444,7 +10444,7 @@ api_l2tpv3_set_tunnel_cookies (vat_main_t * vam) mp->new_local_cookie = clib_host_to_net_u64 (new_local_cookie); mp->new_remote_cookie = clib_host_to_net_u64 (new_remote_cookie); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10485,7 +10485,7 @@ api_l2tpv3_interface_enable_disable (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->enable_disable = enable_disable; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10521,7 +10521,7 @@ api_l2tpv3_set_lookup_key (vat_main_t * vam) mp->key = key; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10598,13 +10598,13 @@ api_sw_if_l2tpv3_tunnel_dump (vat_main_t * vam) /* Get list of l2tpv3-tunnel interfaces */ M (SW_IF_L2TPV3_TUNNEL_DUMP, mp); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -10646,13 +10646,13 @@ api_sw_interface_tap_dump (vat_main_t * vam) print (vam->ofp, "\n%-16s %s", "dev_name", "sw_if_index"); /* Get list of tap interfaces */ M (SW_INTERFACE_TAP_DUMP, mp); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -10823,7 +10823,7 @@ api_vxlan_add_del_tunnel (vat_main_t * vam) mp->is_add = is_add; mp->is_ipv6 = ipv6_set; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -10924,13 +10924,13 @@ api_vxlan_tunnel_dump (vat_main_t * vam) mp->sw_if_index = htonl (sw_if_index); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -10987,7 +10987,7 @@ api_gre_add_del_tunnel (vat_main_t * vam) mp->is_add = is_add; mp->teb = teb; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11064,13 +11064,13 @@ api_gre_tunnel_dump (vat_main_t * vam) mp->sw_if_index = htonl (sw_if_index); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -11084,7 +11084,7 @@ api_l2_fib_clear_table (vat_main_t * vam) M (L2_FIB_CLEAR_TABLE, mp); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11128,7 +11128,7 @@ api_l2_interface_efp_filter (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->enable_disable = enable; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11196,7 +11196,7 @@ api_l2_interface_vlan_tag_rewrite (vat_main_t * vam) mp->tag1 = ntohl (tag1); mp->tag2 = ntohl (tag2); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11266,7 +11266,7 @@ api_create_vhost_user_if (vat_main_t * vam) strncpy ((char *) mp->tag, (char *) tag, ARRAY_LEN (mp->tag) - 1); vec_free (tag); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11334,7 +11334,7 @@ api_modify_vhost_user_if (vat_main_t * vam) mp->custom_dev_instance = ntohl (custom_dev_instance); } - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11370,7 +11370,7 @@ api_delete_vhost_user_if (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11426,13 +11426,13 @@ api_sw_interface_vhost_user_dump (vat_main_t * vam) /* Get list of vhost-user interfaces */ M (SW_INTERFACE_VHOST_USER_DUMP, mp); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -11445,7 +11445,7 @@ api_show_version (vat_main_t * vam) M (SHOW_VERSION, mp); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11562,7 +11562,7 @@ api_vxlan_gpe_add_del_tunnel (vat_main_t * vam) mp->is_add = is_add; mp->is_ipv6 = ipv6_set; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11655,13 +11655,13 @@ api_vxlan_gpe_tunnel_dump (vat_main_t * vam) mp->sw_if_index = htonl (sw_if_index); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -11739,13 +11739,13 @@ api_l2_fib_table_dump (vat_main_t * vam) M (L2_FIB_TABLE_DUMP, mp); mp->bd_id = ntohl (bd_id); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -11791,7 +11791,7 @@ api_interface_name_renumber (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->new_show_dev_instance = ntohl (new_show_dev_instance); - S; + S (mp); W; } @@ -11826,7 +11826,7 @@ api_want_ip4_arp_events (vat_main_t * vam) mp->pid = getpid (); mp->address = address.as_u32; - S; + S (mp); W; } @@ -11861,7 +11861,7 @@ api_want_ip6_nd_events (vat_main_t * vam) mp->pid = getpid (); clib_memcpy (mp->address, &address, sizeof (ip6_address_t)); - S; + S (mp); W; } @@ -11913,7 +11913,7 @@ api_input_acl_set_interface (vat_main_t * vam) mp->l2_table_index = ntohl (l2_table_index); mp->is_add = is_add; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -11969,13 +11969,13 @@ api_ip_address_dump (vat_main_t * vam) M (IP_ADDRESS_DUMP, mp); mp->sw_if_index = ntohl (sw_if_index); mp->is_ipv6 = ipv6_set; - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -12025,13 +12025,13 @@ api_ip_dump (vat_main_t * vam) M (IP_DUMP, mp); mp->is_ipv6 = ipv6_set; - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -12068,7 +12068,7 @@ api_ipsec_spd_add_del (vat_main_t * vam) mp->spd_id = ntohl (spd_id); mp->is_add = is_add; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12122,7 +12122,7 @@ api_ipsec_interface_add_del_spd (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->is_add = is_add; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12280,7 +12280,7 @@ api_ipsec_spd_add_del_entry (vat_main_t * vam) mp->sa_id = ntohl (sa_id); mp->is_add = is_add; mp->is_ip_any = is_ip_any; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12412,7 +12412,7 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam) } } - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12459,7 +12459,7 @@ api_ipsec_sa_set_key (vat_main_t * vam) if (ik) clib_memcpy (mp->integrity_key, ik, mp->integrity_key_length); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12507,7 +12507,7 @@ api_ikev2_profile_add_del (vat_main_t * vam) mp->is_add = is_add; vec_free (name); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12578,7 +12578,7 @@ api_ikev2_profile_set_auth (vat_main_t * vam) vec_free (name); vec_free (data); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12658,7 +12658,7 @@ api_ikev2_profile_set_id (vat_main_t * vam) vec_free (name); vec_free (data); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12729,7 +12729,7 @@ api_ikev2_profile_set_ts (vat_main_t * vam) clib_memcpy (mp->name, name, vec_len (name)); vec_free (name); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12771,7 +12771,7 @@ api_ikev2_set_local_key (vat_main_t * vam) clib_memcpy (mp->key_file, file, vec_len (file)); vec_free (file); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -12854,7 +12854,7 @@ api_map_add_domain (vat_main_t * vam) mp->mtu = htons (mtu); /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -12893,7 +12893,7 @@ api_map_del_domain (vat_main_t * vam) mp->index = ntohl (index); /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -12937,7 +12937,7 @@ api_map_add_del_rule (vat_main_t * vam) mp->psid = ntohs (psid); /* send it... */ - S; + S (mp); /* Wait for a reply, return good/bad news */ W; @@ -12953,13 +12953,13 @@ api_map_domain_dump (vat_main_t * vam) M (MAP_DOMAIN_DUMP, mp); /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -12992,13 +12992,13 @@ api_map_rule_dump (vat_main_t * vam) mp->domain_index = htonl (domain_index); /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -13069,7 +13069,7 @@ api_get_first_msg_id (vat_main_t * vam) M (GET_FIRST_MSG_ID, mp); clib_memcpy (mp->name, name, vec_len (name)); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -13111,7 +13111,7 @@ api_cop_interface_enable_disable (vat_main_t * vam) mp->enable_disable = enable_disable; /* send it... */ - S; + S (mp); /* Wait for the reply */ W; } @@ -13160,7 +13160,7 @@ api_cop_whitelist_enable_disable (vat_main_t * vam) mp->default_cop = default_cop; /* send it... */ - S; + S (mp); /* Wait for the reply */ W; } @@ -13174,7 +13174,7 @@ api_get_node_graph (vat_main_t * vam) M (GET_NODE_GRAPH, mp); /* send it... */ - S; + S (mp); /* Wait for the reply */ W; } @@ -13319,7 +13319,7 @@ api_lisp_add_del_locator_set (vat_main_t * vam) vec_free (locators); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -13434,7 +13434,7 @@ api_lisp_add_del_locator (vat_main_t * vam) vec_free (locator_set_name); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -13561,7 +13561,7 @@ api_lisp_add_del_local_eid (vat_main_t * vam) vec_free (key); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -13714,7 +13714,7 @@ api_lisp_gpe_add_del_fwd_entry (vat_main_t * vam) vec_free (rmt_locs); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -13782,7 +13782,7 @@ api_lisp_add_del_map_server (vat_main_t * vam) } /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -13850,7 +13850,7 @@ api_lisp_add_del_map_resolver (vat_main_t * vam) } /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -13897,7 +13897,7 @@ api_lisp_gpe_enable_disable (vat_main_t * vam) mp->is_en = is_en; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -13941,7 +13941,7 @@ api_lisp_rloc_probe_enable_disable (vat_main_t * vam) mp->is_enabled = is_en; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -13985,7 +13985,7 @@ api_lisp_map_register_enable_disable (vat_main_t * vam) mp->is_enabled = is_en; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -14031,7 +14031,7 @@ api_lisp_enable_disable (vat_main_t * vam) mp->is_en = is_en; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -14049,7 +14049,7 @@ api_show_lisp_map_register_state (vat_main_t * vam) M (SHOW_LISP_MAP_REGISTER_STATE, mp); /* send */ - S; + S (mp); /* wait for reply */ W; @@ -14066,7 +14066,7 @@ api_show_lisp_rloc_probe_state (vat_main_t * vam) M (SHOW_LISP_RLOC_PROBE_STATE, mp); /* send */ - S; + S (mp); /* wait for reply */ W; @@ -14083,7 +14083,7 @@ api_show_lisp_map_request_mode (vat_main_t * vam) M (SHOW_LISP_MAP_REQUEST_MODE, mp); /* send */ - S; + S (mp); /* wait for reply */ W; @@ -14118,7 +14118,7 @@ api_lisp_map_request_mode (vat_main_t * vam) mp->mode = mode; /* send */ - S; + S (mp); /* wait for reply */ W; @@ -14170,7 +14170,7 @@ api_lisp_pitr_set_locator_set (vat_main_t * vam) vec_free (ls_name); /* send */ - S; + S (mp); /* wait for reply */ W; @@ -14192,7 +14192,7 @@ api_show_lisp_pitr (vat_main_t * vam) M (SHOW_LISP_PITR, mp); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -14248,7 +14248,7 @@ api_lisp_eid_table_add_del_map (vat_main_t * vam) mp->is_l2 = bd_index_set; /* send */ - S; + S (mp); /* wait for reply */ W; @@ -14403,7 +14403,7 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam) vec_free (rlocs); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -14531,7 +14531,7 @@ api_lisp_add_del_adjacency (vat_main_t * vam) } /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -14599,7 +14599,7 @@ api_lisp_gpe_add_del_iface (vat_main_t * vam) mp->vni = vni; /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -14669,7 +14669,7 @@ api_lisp_add_del_map_request_itr_rlocs (vat_main_t * vam) vec_free (locator_set_name); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -14742,13 +14742,13 @@ api_lisp_locator_dump (vat_main_t * vam) } /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -14793,13 +14793,13 @@ api_lisp_locator_set_dump (vat_main_t * vam) mp->filter = filter; /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -14852,13 +14852,13 @@ api_lisp_eid_table_map_dump (vat_main_t * vam) mp->is_l2 = is_l2; /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -14881,13 +14881,13 @@ api_lisp_eid_table_vni_dump (vat_main_t * vam) M (LISP_EID_TABLE_VNI_DUMP, mp); /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -14981,13 +14981,13 @@ api_lisp_eid_table_dump (vat_main_t * vam) } /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ @@ -15035,7 +15035,7 @@ api_lisp_gpe_fwd_entries_get (vat_main_t * vam) mp->vni = clib_host_to_net_u32 (vni); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -15086,7 +15086,7 @@ api_lisp_adjacencies_get (vat_main_t * vam) mp->vni = clib_host_to_net_u32 (vni); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -15108,13 +15108,13 @@ api_lisp_map_server_dump (vat_main_t * vam) M (LISP_MAP_SERVER_DUMP, mp); /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -15136,13 +15136,13 @@ api_lisp_map_resolver_dump (vat_main_t * vam) M (LISP_MAP_RESOLVER_DUMP, mp); /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -15164,7 +15164,7 @@ api_show_lisp_status (vat_main_t * vam) M (SHOW_LISP_STATUS, mp); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -15202,12 +15202,12 @@ api_lisp_gpe_fwd_entry_path_dump (vat_main_t * vam) M (LISP_GPE_FWD_ENTRY_PATH_DUMP, mp); /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -15229,7 +15229,7 @@ api_lisp_get_map_request_itr_rlocs (vat_main_t * vam) M (LISP_GET_MAP_REQUEST_ITR_RLOCS, mp); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -15278,7 +15278,7 @@ api_af_packet_create (vat_main_t * vam) mp->use_random_hw_addr = random_hw_addr; vec_free (host_if_name); - S; + S (mp); W2 (fprintf (vam->ofp, " new sw_if_index = %d ", vam->sw_if_index)); /* NOTREACHED */ return 0; @@ -15317,7 +15317,7 @@ api_af_packet_delete (vat_main_t * vam) clib_memcpy (mp->host_if_name, host_if_name, vec_len (host_if_name)); vec_free (host_if_name); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -15417,7 +15417,7 @@ api_policer_add_del (vat_main_t * vam) mp->violate_dscp = violate_action.dscp; mp->color_aware = color_aware; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -15448,13 +15448,13 @@ api_policer_dump (vat_main_t * vam) clib_memcpy (mp->match_name, match_name, vec_len (match_name)); vec_free (match_name); /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -15511,7 +15511,7 @@ api_policer_classify_set_interface (vat_main_t * vam) mp->l2_table_index = ntohl (l2_table_index); mp->is_add = is_add; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -15541,13 +15541,13 @@ api_policer_classify_dump (vat_main_t * vam) M (POLICER_CLASSIFY_DUMP, mp); mp->type = type; /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -15607,7 +15607,7 @@ api_netmap_create (vat_main_t * vam) mp->is_master = is_master; vec_free (if_name); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -15646,7 +15646,7 @@ api_netmap_delete (vat_main_t * vam) clib_memcpy (mp->netmap_if_name, if_name, vec_len (if_name)); vec_free (if_name); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -15722,13 +15722,13 @@ api_mpls_tunnel_dump (vat_main_t * vam) M (MPLS_TUNNEL_DUMP, mp); mp->tunnel_index = htonl (index); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -15821,13 +15821,13 @@ api_mpls_fib_dump (vat_main_t * vam) f64 timeout; M (MPLS_FIB_DUMP, mp); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -15922,13 +15922,13 @@ api_ip_fib_dump (vat_main_t * vam) f64 timeout; M (IP_FIB_DUMP, mp); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -16013,13 +16013,13 @@ api_ip_neighbor_dump (vat_main_t * vam) M (IP_NEIGHBOR_DUMP, mp); mp->is_ipv6 = (u8) is_ipv6; mp->sw_if_index = ntohl (sw_if_index); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -16114,13 +16114,13 @@ api_ip6_fib_dump (vat_main_t * vam) f64 timeout; M (IP6_FIB_DUMP, mp); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -16135,7 +16135,7 @@ api_classify_table_ids (vat_main_t * vam) M (CLASSIFY_TABLE_IDS, mp); mp->context = 0; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16169,7 +16169,7 @@ api_classify_table_by_interface (vat_main_t * vam) mp->context = 0; mp->sw_if_index = ntohl (sw_if_index); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16201,7 +16201,7 @@ api_classify_table_info (vat_main_t * vam) mp->context = 0; mp->table_id = ntohl (table_id); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16232,13 +16232,13 @@ api_classify_session_dump (vat_main_t * vam) M (CLASSIFY_SESSION_DUMP, mp); mp->context = 0; mp->table_id = ntohl (table_id); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; /* NOTREACHED */ @@ -16302,7 +16302,7 @@ api_ipfix_exporter_dump (vat_main_t * vam) M (IPFIX_EXPORTER_DUMP, mp); mp->context = 0; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16318,7 +16318,7 @@ api_ipfix_classify_stream_dump (vat_main_t * vam) M (IPFIX_CLASSIFY_STREAM_DUMP, mp); mp->context = 0; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16368,13 +16368,13 @@ api_ipfix_classify_table_dump (vat_main_t * vam) M (IPFIX_CLASSIFY_TABLE_DUMP, mp); /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -16451,7 +16451,7 @@ api_sw_interface_span_enable_disable (vat_main_t * vam) mp->sw_if_index_to = htonl (dst_sw_if_index); mp->state = state; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16545,13 +16545,13 @@ api_sw_interface_span_dump (vat_main_t * vam) f64 timeout; M (SW_INTERFACE_SPAN_DUMP, mp); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -16582,7 +16582,7 @@ api_pg_create_interface (vat_main_t * vam) mp->context = 0; mp->interface_id = ntohl (if_id); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16641,7 +16641,7 @@ api_pg_capture (vat_main_t * vam) } vec_free (pcap_file); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16688,7 +16688,7 @@ api_pg_enable_disable (vat_main_t * vam) } vec_free (stream_name); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16819,7 +16819,7 @@ api_ip_source_and_port_range_check_add_del (vat_main_t * vam) mp->vrf_id = ntohl (vrf_id); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16888,7 +16888,7 @@ api_ip_source_and_port_range_check_interface_add_del (vat_main_t * vam) mp->udp_in_vrf_id = ntohl (udp_in_vrf_id); /* send it... */ - S; + S (mp); /* Wait for a reply... */ W; @@ -16933,7 +16933,7 @@ api_ipsec_gre_add_del_tunnel (vat_main_t * vam) clib_memcpy (mp->dst_address, &dst_address, sizeof (dst_address)); mp->is_add = is_add; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -16974,7 +16974,7 @@ api_punt (vat_main_t * vam) mp->l4_protocol = (u8) protocol; mp->l4_port = htons ((u16) port); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -17051,13 +17051,13 @@ api_ipsec_gre_tunnel_dump (vat_main_t * vam) mp->sw_if_index = htonl (sw_if_index); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -17090,7 +17090,7 @@ api_delete_subif (vat_main_t * vam) M (DELETE_SUBIF, mp); mp->sw_if_index = ntohl (sw_if_index); - S; + S (mp); W; } @@ -17179,7 +17179,7 @@ api_l2_interface_pbb_tag_rewrite (vat_main_t * vam) mp->b_vlanid = ntohs (vlanid); mp->i_sid = ntohl (sid); - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -17229,7 +17229,7 @@ api_flow_classify_set_interface (vat_main_t * vam) mp->ip6_table_index = ntohl (ip6_table_index); mp->is_add = is_add; - S; + S (mp); W; /* NOTREACHED */ return 0; @@ -17259,13 +17259,13 @@ api_flow_classify_dump (vat_main_t * vam) M (FLOW_CLASSIFY_DUMP, mp); mp->type = type; /* send it... */ - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } /* Wait for a reply... */ W; @@ -17337,7 +17337,7 @@ api_feature_enable_disable (vat_main_t * vam) vec_free (arc_name); vec_free (feature_name); - S; + S (mp); W; } @@ -17385,7 +17385,7 @@ api_sw_interface_tag_add_del (vat_main_t * vam) strncpy ((char *) mp->tag, (char *) tag, ARRAY_LEN (mp->tag) - 1); vec_free (tag); - S; + S (mp); W; } @@ -17431,13 +17431,13 @@ api_l2_xconnect_dump (vat_main_t * vam) M (L2_XCONNECT_DUMP, mp); - S; + S (mp); /* Use a control ping for synchronization */ { vl_api_control_ping_t *mp; M (CONTROL_PING, mp); - S; + S (mp); } W; } @@ -17480,7 +17480,7 @@ api_sw_interface_set_mtu (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->mtu = ntohs ((u16) mtu); - S; + S (mp); W; } diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h index b2fbb86d..172fe2db 100644 --- a/src/vlibapi/vat_helper_macros.h +++ b/src/vlibapi/vat_helper_macros.h @@ -39,7 +39,7 @@ do { \ } while(0); /* S: send a message */ -#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) +#define S(mp) (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) /* W: wait for results, with timeout */ #define W \ -- cgit 1.2.3-korg From 1f9191f6efa5f2e0284c194f920093201b27ef81 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Tue, 31 Jan 2017 15:27:19 -0600 Subject: Localize the timeout variable within the W message macro. Rather than rely on an unbound variable, explicitly introduce the timeout variable within the 'do { ... } while (0)' construct as a block-local variable. Change-Id: I6e78635290f9b5ab3f56b7f116c5fa762c88c9e9 Signed-off-by: Jon Loeliger --- build-root/emacs-lisp/plugin-test-skel.el | 3 +- src/plugins/acl/acl_test.c | 12 -- src/plugins/flowperpkt/flowperpkt_test.c | 1 - .../export-vxlan-gpe/vxlan_gpe_ioam_export_test.c | 1 - src/plugins/ioam/export/ioam_export_test.c | 1 - src/plugins/ioam/lib-pot/pot_test.c | 4 - src/plugins/ioam/lib-trace/trace_test.c | 4 +- src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c | 6 - src/plugins/lb/lb_test.c | 3 - src/plugins/snat/snat_test.c | 12 -- src/vat/api_format.c | 186 +-------------------- src/vlibapi/vat_helper_macros.h | 4 +- 12 files changed, 6 insertions(+), 231 deletions(-) (limited to 'src/plugins/ioam/lib-pot/pot_test.c') diff --git a/build-root/emacs-lisp/plugin-test-skel.el b/build-root/emacs-lisp/plugin-test-skel.el index 6d399468..116c420a 100644 --- a/build-root/emacs-lisp/plugin-test-skel.el +++ b/build-root/emacs-lisp/plugin-test-skel.el @@ -133,7 +133,7 @@ do { \\ /* W: wait for results, with timeout */ #define W \\ do { \\ - timeout = vat_time_now (vam) + 1.0; \\ + f64 timeout = vat_time_now (vam) + 1.0; \\ \\ while (vat_time_now (vam) < timeout) { \\ if (vam->result_ready == 1) { \\ @@ -147,7 +147,6 @@ static int api_" plugin-name "_enable_disable (vat_main_t * vam) { " plugin-name "_test_main_t * sm = &" plugin-name "_test_main; unformat_input_t * i = vam->input; - f64 timeout; int enable_disable = 1; u32 sw_if_index = ~0; vl_api_" plugin-name "_enable_disable_t * mp; diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c index 70fd6959..39d7e1c4 100644 --- a/src/plugins/acl/acl_test.c +++ b/src/plugins/acl/acl_test.c @@ -267,7 +267,6 @@ static int api_acl_plugin_get_version (vat_main_t * vam) acl_test_main_t * sm = &acl_test_main; vl_api_acl_plugin_get_version_t * mp; u32 msg_size = sizeof(*mp); - f64 timeout; vam->result_ready = 0; mp = vl_msg_api_alloc_as_if_client(msg_size); @@ -289,7 +288,6 @@ static int api_macip_acl_interface_get (vat_main_t * vam) acl_test_main_t * sm = &acl_test_main; vl_api_acl_plugin_get_version_t * mp; u32 msg_size = sizeof(*mp); - f64 timeout; vam->result_ready = 0; mp = vl_msg_api_alloc_as_if_client(msg_size); @@ -321,7 +319,6 @@ static int api_acl_add_replace (vat_main_t * vam) { acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_add_replace_t * mp; u32 acl_index = ~0; u32 msg_size = sizeof (*mp); /* without the rules */ @@ -488,7 +485,6 @@ static int api_acl_add_replace (vat_main_t * vam) static int api_acl_del (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_del_t * mp; u32 acl_index = ~0; @@ -511,7 +507,6 @@ static int api_acl_del (vat_main_t * vam) static int api_macip_acl_del (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_del_t * mp; u32 acl_index = ~0; @@ -534,7 +529,6 @@ static int api_macip_acl_del (vat_main_t * vam) static int api_acl_interface_add_del (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_interface_add_del_t * mp; u32 sw_if_index = ~0; u32 acl_index = ~0; @@ -601,7 +595,6 @@ static int api_acl_interface_add_del (vat_main_t * vam) static int api_macip_acl_interface_add_del (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_macip_acl_interface_add_del_t * mp; u32 sw_if_index = ~0; u32 acl_index = ~0; @@ -651,7 +644,6 @@ static int api_macip_acl_interface_add_del (vat_main_t * vam) static int api_acl_interface_set_acl_list (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_interface_set_acl_list_t * mp; u32 sw_if_index = ~0; u32 acl_index = ~0; @@ -709,7 +701,6 @@ static int api_acl_interface_set_acl_list (vat_main_t * vam) static int api_acl_interface_list_dump (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; u32 sw_if_index = ~0; vl_api_acl_interface_list_dump_t * mp; @@ -737,7 +728,6 @@ static int api_acl_interface_list_dump (vat_main_t * vam) static int api_acl_dump (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; u32 acl_index = ~0; vl_api_acl_dump_t * mp; @@ -763,7 +753,6 @@ static int api_acl_dump (vat_main_t * vam) static int api_macip_acl_dump (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; u32 acl_index = ~0; vl_api_acl_dump_t * mp; @@ -799,7 +788,6 @@ static int api_macip_acl_add (vat_main_t * vam) { acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; - f64 timeout; vl_api_macip_acl_add_t * mp; u32 msg_size = sizeof (*mp); /* without the rules */ diff --git a/src/plugins/flowperpkt/flowperpkt_test.c b/src/plugins/flowperpkt/flowperpkt_test.c index d5edc4ad..4cc1cfb7 100644 --- a/src/plugins/flowperpkt/flowperpkt_test.c +++ b/src/plugins/flowperpkt/flowperpkt_test.c @@ -95,7 +95,6 @@ static int api_flowperpkt_tx_interface_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; - f64 timeout; int enable_disable = 1; u8 which = 0; /* ipv4 by default */ u32 sw_if_index = ~0; diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c index 161b5241..a7938219 100644 --- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c +++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c @@ -92,7 +92,6 @@ static int api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam) { unformat_input_t *i = vam->input; - f64 timeout; int is_disable = 0; vl_api_vxlan_gpe_ioam_export_enable_disable_t *mp; diff --git a/src/plugins/ioam/export/ioam_export_test.c b/src/plugins/ioam/export/ioam_export_test.c index 45c4ca56..2cb036a5 100644 --- a/src/plugins/ioam/export/ioam_export_test.c +++ b/src/plugins/ioam/export/ioam_export_test.c @@ -94,7 +94,6 @@ static int api_ioam_export_ip6_enable_disable (vat_main_t * vam) { unformat_input_t *i = vam->input; - f64 timeout; int is_disable = 0; vl_api_ioam_export_ip6_enable_disable_t *mp; diff --git a/src/plugins/ioam/lib-pot/pot_test.c b/src/plugins/ioam/lib-pot/pot_test.c index 4f049be8..d896eb2f 100644 --- a/src/plugins/ioam/lib-pot/pot_test.c +++ b/src/plugins/ioam/lib-pot/pot_test.c @@ -132,7 +132,6 @@ static int api_pot_profile_add (vat_main_t *vam) u64 secret_key = 0; u32 bits = MAX_BITS; u64 lpc = 0, poly2 = 0; - f64 timeout; u8 id = 0; int rv = 0; @@ -204,7 +203,6 @@ static int api_pot_profile_activate (vat_main_t *vam) u8 *name = NULL; u8 id = 0; int rv = 0; - f64 timeout; while (unformat_check_input(input) != UNFORMAT_END_OF_INPUT) { @@ -241,7 +239,6 @@ OUT: static int api_pot_profile_del (vat_main_t *vam) { vl_api_pot_profile_del_t *mp; - f64 timeout; M(POT_PROFILE_DEL, mp); mp->list_name_len = 0; @@ -254,7 +251,6 @@ static int api_pot_profile_show_config_dump (vat_main_t *vam) { unformat_input_t *input = vam->input; vl_api_pot_profile_show_config_dump_t *mp; - f64 timeout; u8 id = 0; while(unformat_check_input(input) != UNFORMAT_END_OF_INPUT) diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c index 5093f330..d1fb7205 100644 --- a/src/plugins/ioam/lib-trace/trace_test.c +++ b/src/plugins/ioam/lib-trace/trace_test.c @@ -129,7 +129,6 @@ api_trace_profile_add (vat_main_t * vam) u32 node_id = 0; u32 app_data = 0; u8 trace_tsp = 0; - f64 timeout; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -169,7 +168,6 @@ static int api_trace_profile_del (vat_main_t * vam) { vl_api_trace_profile_del_t *mp; - f64 timeout; M (TRACE_PROFILE_DEL, mp); S (mp); @@ -181,7 +179,7 @@ static int api_trace_profile_show_config (vat_main_t * vam) { vl_api_trace_profile_show_config_t *mp; - f64 timeout; + M (TRACE_PROFILE_SHOW_CONFIG, mp); S (mp); W; diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c index ee25a874..3e7300f5 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c @@ -104,7 +104,6 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_vxlan_gpe_ioam_enable_t *mp; - f64 timeout; u32 id = 0; int has_trace_option = 0; int has_pow_option = 0; @@ -143,7 +142,6 @@ static int api_vxlan_gpe_ioam_disable (vat_main_t * vam) { vl_api_vxlan_gpe_ioam_disable_t *mp; - f64 timeout; M (VXLAN_GPE_IOAM_DISABLE, mp); S (mp); @@ -163,7 +161,6 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) u8 remote_set = 0; u32 vni; u8 vni_set = 0; - f64 timeout; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -258,7 +255,6 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) u8 remote_set = 0; u32 vni; u8 vni_set = 0; - f64 timeout; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -351,7 +347,6 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) u8 ipv4_set = 0, ipv6_set = 0; u8 local_set = 0; u32 outer_fib_index = 0; - f64 timeout; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -421,7 +416,6 @@ api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam) u8 ipv4_set = 0, ipv6_set = 0; u8 local_set = 0; u32 outer_fib_index = 0; - f64 timeout; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) diff --git a/src/plugins/lb/lb_test.c b/src/plugins/lb/lb_test.c index f553a93e..a811079e 100644 --- a/src/plugins/lb/lb_test.c +++ b/src/plugins/lb/lb_test.c @@ -133,7 +133,6 @@ foreach_standard_reply_retval_handler; static int api_lb_conf (vat_main_t * vam) { unformat_input_t *i = vam->input; - f64 timeout; vl_api_lb_conf_t mps, *mp; if (!unformat(i, "%U %U %u %u", @@ -156,7 +155,6 @@ static int api_lb_conf (vat_main_t * vam) static int api_lb_add_del_vip (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_lb_add_del_vip_t mps, *mp; mps.is_del = 0; mps.is_gre4 = 0; @@ -195,7 +193,6 @@ static int api_lb_add_del_vip (vat_main_t * vam) static int api_lb_add_del_as (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_lb_add_del_as_t mps, *mp; mps.is_del = 0; diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c index c0913f37..8bab00c1 100644 --- a/src/plugins/snat/snat_test.c +++ b/src/plugins/snat/snat_test.c @@ -109,7 +109,6 @@ _(SNAT_IPFIX_ENABLE_DISABLE_REPLY, \ static int api_snat_add_address_range (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; ip4_address_t start_addr, end_addr; u32 start_host_order, end_host_order; vl_api_snat_add_address_range_t * mp; @@ -169,7 +168,6 @@ static int api_snat_add_address_range (vat_main_t * vam) static int api_snat_interface_add_del_feature (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_interface_add_del_feature_t * mp; u32 sw_if_index; u8 sw_if_index_set = 0; @@ -215,7 +213,6 @@ static int api_snat_interface_add_del_feature (vat_main_t * vam) static int api_snat_add_static_mapping(vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_add_static_mapping_t * mp; u8 external_addr_set = 0; u8 local_addr_set; @@ -320,7 +317,6 @@ static void vl_api_snat_static_mapping_details_t_handler static int api_snat_static_mapping_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_static_mapping_dump_t * mp; if (vam->json_output) @@ -379,7 +375,6 @@ static void vl_api_snat_show_config_reply_t_handler static int api_snat_show_config(vat_main_t * vam) { - f64 timeout; vl_api_snat_show_config_t * mp; if (vam->json_output) @@ -406,7 +401,6 @@ static void vl_api_snat_address_details_t_handler static int api_snat_address_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_address_dump_t * mp; if (vam->json_output) @@ -440,7 +434,6 @@ static void vl_api_snat_interface_details_t_handler static int api_snat_interface_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_interface_dump_t * mp; if (vam->json_output) @@ -465,7 +458,6 @@ static int api_snat_interface_dump(vat_main_t * vam) static int api_snat_set_workers (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_set_workers_t * mp; uword *bitmap; @@ -502,7 +494,6 @@ static void vl_api_snat_worker_details_t_handler static int api_snat_worker_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_worker_dump_t * mp; if (vam->json_output) @@ -527,7 +518,6 @@ static int api_snat_worker_dump(vat_main_t * vam) static int api_snat_ipfix_enable_disable (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_add_del_interface_addr_t * mp; u32 sw_if_index; u8 sw_if_index_set = 0; @@ -575,7 +565,6 @@ static void vl_api_snat_interface_addr_details_t_handler static int api_snat_interface_addr_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_interface_addr_dump_t * mp; if (vam->json_output) @@ -600,7 +589,6 @@ static int api_snat_interface_addr_dump(vat_main_t * vam) static int api_snat_add_del_interface_addr (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_ipfix_enable_disable_t * mp; u32 domain_id = 0; u32 src_port = 0; diff --git a/src/vat/api_format.c b/src/vat/api_format.c index b374b281..8caa94f0 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -4640,7 +4640,6 @@ static int exec_inband (vat_main_t * vam) { vl_api_cli_inband_t *mp; - f64 timeout; unformat_input_t *i = vam->input; if (vec_len (i->buffer) == 0) @@ -4676,7 +4675,6 @@ api_create_loopback (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_create_loopback_t *mp; - f64 timeout; u8 mac_address[6]; u8 mac_set = 0; @@ -4704,7 +4702,6 @@ api_delete_loopback (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_delete_loopback_t *mp; - f64 timeout; u32 sw_if_index = ~0; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -4734,7 +4731,6 @@ api_want_stats (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_want_stats_t *mp; - f64 timeout; int enable = -1; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -4765,7 +4761,6 @@ api_want_interface_events (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_want_interface_events_t *mp; - f64 timeout; int enable = -1; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -4799,7 +4794,6 @@ int api_sw_interface_dump (vat_main_t * vam) { vl_api_sw_interface_dump_t *mp; - f64 timeout; hash_pair_t *p; name_sort_t *nses = 0, *ns; sw_interface_subif_t *sub = NULL; @@ -4906,7 +4900,6 @@ api_sw_interface_set_flags (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_flags_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 admin_up = 0, link_up = 0; @@ -4955,7 +4948,6 @@ api_sw_interface_clear_stats (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_clear_stats_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; @@ -4991,7 +4983,6 @@ api_sw_interface_set_dpdk_hqos_pipe (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_dpdk_hqos_pipe_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u32 subport; @@ -5064,7 +5055,6 @@ api_sw_interface_set_dpdk_hqos_subport (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_dpdk_hqos_subport_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u32 subport; @@ -5145,7 +5135,6 @@ api_sw_interface_set_dpdk_hqos_tctbl (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_dpdk_hqos_tctbl_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 entry_set = 0; @@ -5213,7 +5202,6 @@ api_sw_interface_add_del_address (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_add_del_address_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 is_add = 1, del_all = 0; @@ -5290,7 +5278,6 @@ api_sw_interface_set_mpls_enable (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_mpls_enable_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 enable = 1; @@ -5334,7 +5321,6 @@ api_sw_interface_set_table (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_table_t *mp; - f64 timeout; u32 sw_if_index, vrf_id = 0; u8 sw_if_index_set = 0; u8 is_ipv6 = 0; @@ -5411,7 +5397,6 @@ api_sw_interface_get_table (vat_main_t * vam) u32 sw_if_index; u8 sw_if_index_set = 0; u8 is_ipv6 = 0; - f64 timeout; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -5444,7 +5429,6 @@ api_sw_interface_set_vpath (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_vpath_t *mp; - f64 timeout; u32 sw_if_index = 0; u8 sw_if_index_set = 0; u8 is_enable = 0; @@ -5488,7 +5472,6 @@ api_sw_interface_set_vxlan_bypass (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_vxlan_bypass_t *mp; - f64 timeout; u32 sw_if_index = 0; u8 sw_if_index_set = 0; u8 is_enable = 1; @@ -5538,7 +5521,6 @@ api_sw_interface_set_l2_xconnect (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_l2_xconnect_t *mp; - f64 timeout; u32 rx_sw_if_index; u8 rx_sw_if_index_set = 0; u32 tx_sw_if_index; @@ -5611,7 +5593,6 @@ api_sw_interface_set_l2_bridge (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_l2_bridge_t *mp; - f64 timeout; u32 rx_sw_if_index; u8 rx_sw_if_index_set = 0; u32 bd_id; @@ -5674,7 +5655,6 @@ api_bridge_domain_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_bridge_domain_dump_t *mp; - f64 timeout; u32 bd_id = ~0; /* Parse args required to build the message */ @@ -5707,7 +5687,6 @@ api_bridge_domain_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_bridge_domain_add_del_t *mp; - f64 timeout; u32 bd_id = ~0; u8 is_add = 1; u32 flood = 1, forward = 1, learn = 1, uu_flood = 1, arp_term = 0; @@ -5920,7 +5899,6 @@ api_l2_flags (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_l2_flags_t *mp; - f64 timeout; u32 sw_if_index; u32 feature_bitmap = 0; u8 sw_if_index_set = 0; @@ -5975,7 +5953,6 @@ api_bridge_flags (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_bridge_flags_t *mp; - f64 timeout; u32 bd_id; u8 bd_id_set = 0; u8 is_set = 1; @@ -6027,7 +6004,6 @@ api_bd_ip_mac_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_bd_ip_mac_add_del_t *mp; - f64 timeout; u32 bd_id; u8 is_ipv6 = 0; u8 is_add = 1; @@ -6102,7 +6078,6 @@ api_tap_connect (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_tap_connect_t *mp; - f64 timeout; u8 mac_address[6]; u8 random_mac = 1; u8 name_set = 0; @@ -6195,7 +6170,6 @@ api_tap_modify (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_tap_modify_t *mp; - f64 timeout; u8 mac_address[6]; u8 random_mac = 1; u8 name_set = 0; @@ -6261,7 +6235,6 @@ api_tap_delete (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_tap_delete_t *mp; - f64 timeout; u32 sw_if_index = ~0; u8 sw_if_index_set = 0; @@ -6299,7 +6272,6 @@ api_ip_add_del_route (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ip_add_del_route_t *mp; - f64 timeout; u32 sw_if_index = ~0, vrf_id = 0; u8 is_ipv6 = 0; u8 is_local = 0, is_drop = 0; @@ -6549,6 +6521,7 @@ api_ip_add_del_route (vat_main_t * vam) { vl_api_control_ping_t *mp; f64 after; + f64 timeout; /* Shut off async mode */ vam->async_mode = 0; @@ -6596,7 +6569,6 @@ api_ip_mroute_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ip_mroute_add_del_t *mp; - f64 timeout; u32 sw_if_index = ~0, vrf_id = 0; u8 is_ipv6 = 0; u8 is_local = 0; @@ -6713,7 +6685,6 @@ api_mpls_route_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_mpls_route_add_del_t *mp; - f64 timeout; u32 sw_if_index = ~0, table_id = 0; u8 create_table_if_needed = 0; u8 is_add = 1; @@ -6887,6 +6858,7 @@ api_mpls_route_add_del (vat_main_t * vam) { vl_api_control_ping_t *mp; f64 after; + f64 timeout; /* Shut off async mode */ vam->async_mode = 0; @@ -6934,7 +6906,6 @@ api_mpls_ip_bind_unbind (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_mpls_ip_bind_unbind_t *mp; - f64 timeout; u32 ip_table_id = 0; u8 create_table_if_needed = 0; u8 is_bind = 1; @@ -7017,7 +6988,6 @@ api_proxy_arp_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_proxy_arp_add_del_t *mp; - f64 timeout; u32 vrf_id = 0; u8 is_add = 1; ip4_address_t lo, hi; @@ -7063,7 +7033,6 @@ api_proxy_arp_intfc_enable_disable (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_proxy_arp_intfc_enable_disable_t *mp; - f64 timeout; u32 sw_if_index; u8 enable = 1; u8 sw_if_index_set = 0; @@ -7107,7 +7076,6 @@ api_mpls_tunnel_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_mpls_tunnel_add_del_t *mp; - f64 timeout; u8 is_add = 1; u8 l2_only = 0; @@ -7193,7 +7161,6 @@ api_sw_interface_set_unnumbered (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_unnumbered_t *mp; - f64 timeout; u32 sw_if_index; u32 unnum_sw_index = ~0; u8 is_add = 1; @@ -7239,7 +7206,6 @@ api_ip_neighbor_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ip_neighbor_add_del_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u32 vrf_id = 0; @@ -7334,7 +7300,6 @@ api_reset_vrf (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_reset_vrf_t *mp; - f64 timeout; u32 vrf_id = 0; u8 is_ipv6 = 0; u8 vrf_id_set = 0; @@ -7374,7 +7339,6 @@ api_create_vlan_subif (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_create_vlan_subif_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u32 vlan_id; @@ -7433,7 +7397,6 @@ api_create_subif (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_create_subif_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u32 sub_id; @@ -7508,7 +7471,6 @@ api_oam_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_oam_add_del_t *mp; - f64 timeout; u32 vrf_id = 0; u8 is_add = 1; ip4_address_t src, dst; @@ -7562,7 +7524,6 @@ api_reset_fib (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_reset_fib_t *mp; - f64 timeout; u32 vrf_id = 0; u8 is_ipv6 = 0; u8 vrf_id_set = 0; @@ -7602,7 +7563,6 @@ api_dhcp_proxy_config (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_dhcp_proxy_config_t *mp; - f64 timeout; u32 vrf_id = 0; u8 is_add = 1; u8 insert_cid = 1; @@ -7697,7 +7657,6 @@ api_dhcp_proxy_config_2 (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_dhcp_proxy_config_2_t *mp; - f64 timeout; u32 rx_vrf_id = 0; u32 server_vrf_id = 0; u8 is_add = 1; @@ -7796,7 +7755,6 @@ api_dhcp_proxy_set_vss (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_dhcp_proxy_set_vss_t *mp; - f64 timeout; u8 is_ipv6 = 0; u8 is_add = 1; u32 tbl_id; @@ -7860,7 +7818,6 @@ api_dhcp_client_config (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_dhcp_client_config_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 is_add = 1; @@ -7921,7 +7878,6 @@ api_set_ip_flow_hash (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_set_ip_flow_hash_t *mp; - f64 timeout; u32 vrf_id = 0; u8 is_ipv6 = 0; u8 vrf_id_set = 0; @@ -7985,7 +7941,6 @@ api_sw_interface_ip6_enable_disable (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_ip6_enable_disable_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 enable = 0; @@ -8029,7 +7984,6 @@ api_sw_interface_ip6_set_link_local_address (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_ip6_set_link_local_address_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 v6_address_set = 0; @@ -8081,7 +8035,6 @@ api_sw_interface_ip6nd_ra_prefix (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_ip6nd_ra_prefix_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u32 address_length = 0; @@ -8170,7 +8123,6 @@ api_sw_interface_ip6nd_ra_config (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_ip6nd_ra_config_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 suppress = 0; @@ -8267,7 +8219,6 @@ api_set_arp_neighbor_limit (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_set_arp_neighbor_limit_t *mp; - f64 timeout; u32 arp_nbr_limit; u8 limit_set = 0; u8 is_ipv6 = 0; @@ -8307,7 +8258,6 @@ api_l2_patch_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_l2_patch_add_del_t *mp; - f64 timeout; u32 rx_sw_if_index; u8 rx_sw_if_index_set = 0; u32 tx_sw_if_index; @@ -8378,7 +8328,6 @@ api_ioam_enable (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_ioam_enable_t *mp; - f64 timeout; u32 id = 0; int has_trace_option = 0; int has_pot_option = 0; @@ -8417,7 +8366,6 @@ static int api_ioam_disable (vat_main_t * vam) { vl_api_ioam_disable_t *mp; - f64 timeout; M (IOAM_DISABLE, mp); S (mp); @@ -8430,7 +8378,6 @@ api_sr_tunnel_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sr_tunnel_add_del_t *mp; - f64 timeout; int is_del = 0; int pl_index; ip6_address_t src_address; @@ -8563,7 +8510,6 @@ api_sr_policy_add_del (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_sr_policy_add_del_t *mp; - f64 timeout; int is_del = 0; u8 *name = 0; u8 *tunnel_name = 0; @@ -8647,7 +8593,6 @@ api_sr_multicast_map_add_del (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_sr_multicast_map_add_del_t *mp; - f64 timeout; int is_del = 0; ip6_address_t multicast_address; u8 *policy_name = 0; @@ -9320,7 +9265,6 @@ api_classify_add_del_table (vat_main_t * vam) u32 miss_next_index = ~0; u32 memory_size = 32 << 20; u8 *mask = 0; - f64 timeout; u32 current_data_flag = 0; int current_data_offset = 0; @@ -9858,7 +9802,6 @@ api_classify_add_del_session (vat_main_t * vam) u32 opaque_index = ~0; u8 *match = 0; i32 advance = 0; - f64 timeout; u32 skip_n_vectors = 0; u32 match_n_vectors = 0; u32 action = 0; @@ -9946,7 +9889,6 @@ api_classify_set_interface_ip_table (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_classify_set_interface_ip_table_t *mp; - f64 timeout; u32 sw_if_index; int sw_if_index_set; u32 table_index = ~0; @@ -9991,7 +9933,6 @@ api_classify_set_interface_l2_tables (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_classify_set_interface_l2_tables_t *mp; - f64 timeout; u32 sw_if_index; int sw_if_index_set; u32 ip4_table_index = ~0; @@ -10055,7 +9996,6 @@ api_set_ipfix_exporter (vat_main_t * vam) u32 path_mtu = ~0; u32 template_interval = ~0; u8 udp_checksum = 0; - f64 timeout; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10114,7 +10054,6 @@ api_set_ipfix_classify_stream (vat_main_t * vam) vl_api_set_ipfix_classify_stream_t *mp; u32 domain_id = 0; u32 src_port = UDP_DST_PORT_ipfix; - f64 timeout; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10148,7 +10087,6 @@ api_ipfix_classify_table_add_del (vat_main_t * vam) u32 classify_table_index = ~0; u8 ip_version = 0; u8 transport_protocol = 255; - f64 timeout; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10206,7 +10144,6 @@ api_get_node_index (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_get_node_index_t *mp; - f64 timeout; u8 *name = 0; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -10242,7 +10179,6 @@ api_get_next_index (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_get_next_index_t *mp; - f64 timeout; u8 *node_name = 0, *next_node_name = 0; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -10292,7 +10228,6 @@ api_add_node_next (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_add_node_next_t *mp; - f64 timeout; u8 *name = 0; u8 *next = 0; @@ -10351,7 +10286,6 @@ api_l2tpv3_create_tunnel (vat_main_t * vam) u64 remote_cookie = 0; u8 l2_sublayer_present = 0; vl_api_l2tpv3_create_tunnel_t *mp; - f64 timeout; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10416,7 +10350,6 @@ api_l2tpv3_set_tunnel_cookies (vat_main_t * vam) u64 new_local_cookie = 0; u64 new_remote_cookie = 0; vl_api_l2tpv3_set_tunnel_cookies_t *mp; - f64 timeout; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10455,7 +10388,6 @@ api_l2tpv3_interface_enable_disable (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_l2tpv3_interface_enable_disable_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 enable_disable = 1; @@ -10496,7 +10428,6 @@ api_l2tpv3_set_lookup_key (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_l2tpv3_set_lookup_key_t *mp; - f64 timeout; u8 key = ~0; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -10594,7 +10525,6 @@ static int api_sw_if_l2tpv3_tunnel_dump (vat_main_t * vam) { vl_api_sw_if_l2tpv3_tunnel_dump_t *mp; - f64 timeout; /* Get list of l2tpv3-tunnel interfaces */ M (SW_IF_L2TPV3_TUNNEL_DUMP, mp); @@ -10641,7 +10571,6 @@ static int api_sw_interface_tap_dump (vat_main_t * vam) { vl_api_sw_interface_tap_dump_t *mp; - f64 timeout; print (vam->ofp, "\n%-16s %s", "dev_name", "sw_if_index"); /* Get list of tap interfaces */ @@ -10677,7 +10606,6 @@ api_vxlan_add_del_tunnel (vat_main_t * vam) { unformat_input_t *line_input = vam->input; vl_api_vxlan_add_del_tunnel_t *mp; - f64 timeout; ip46_address_t src, dst; u8 is_add = 1; u8 ipv4_set = 0, ipv6_set = 0; @@ -10894,7 +10822,6 @@ api_vxlan_tunnel_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_vxlan_tunnel_dump_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; @@ -10940,7 +10867,6 @@ api_gre_add_del_tunnel (vat_main_t * vam) { unformat_input_t *line_input = vam->input; vl_api_gre_add_del_tunnel_t *mp; - f64 timeout; ip4_address_t src4, dst4; u8 is_add = 1; u8 teb = 0; @@ -11034,7 +10960,6 @@ api_gre_tunnel_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_gre_tunnel_dump_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; @@ -11080,7 +11005,6 @@ api_l2_fib_clear_table (vat_main_t * vam) { // unformat_input_t * i = vam->input; vl_api_l2_fib_clear_table_t *mp; - f64 timeout; M (L2_FIB_CLEAR_TABLE, mp); @@ -11095,7 +11019,6 @@ api_l2_interface_efp_filter (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_l2_interface_efp_filter_t *mp; - f64 timeout; u32 sw_if_index; u8 enable = 1; u8 sw_if_index_set = 0; @@ -11150,7 +11073,6 @@ api_l2_interface_vlan_tag_rewrite (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_l2_interface_vlan_tag_rewrite_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u8 vtr_op_set = 0; @@ -11207,7 +11129,6 @@ api_create_vhost_user_if (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_create_vhost_user_if_t *mp; - f64 timeout; u8 *file_name; u8 is_server = 0; u8 file_name_set = 0; @@ -11277,7 +11198,6 @@ api_modify_vhost_user_if (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_modify_vhost_user_if_t *mp; - f64 timeout; u8 *file_name; u8 is_server = 0; u8 file_name_set = 0; @@ -11345,7 +11265,6 @@ api_delete_vhost_user_if (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_delete_vhost_user_if_t *mp; - f64 timeout; u32 sw_if_index = ~0; u8 sw_if_index_set = 0; @@ -11420,7 +11339,6 @@ static int api_sw_interface_vhost_user_dump (vat_main_t * vam) { vl_api_sw_interface_vhost_user_dump_t *mp; - f64 timeout; print (vam->ofp, "Interface name idx hdr_sz features server regions filename"); @@ -11441,7 +11359,6 @@ static int api_show_version (vat_main_t * vam) { vl_api_show_version_t *mp; - f64 timeout; M (SHOW_VERSION, mp); @@ -11457,7 +11374,6 @@ api_vxlan_gpe_add_del_tunnel (vat_main_t * vam) { unformat_input_t *line_input = vam->input; vl_api_vxlan_gpe_add_del_tunnel_t *mp; - f64 timeout; ip4_address_t local4, remote4; ip6_address_t local6, remote6; u8 is_add = 1; @@ -11625,7 +11541,6 @@ api_vxlan_gpe_tunnel_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_vxlan_gpe_tunnel_dump_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; @@ -11714,7 +11629,6 @@ api_l2_fib_table_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_l2_fib_table_dump_t *mp; - f64 timeout; u32 bd_id; u8 bd_id_set = 0; @@ -11757,7 +11671,6 @@ api_interface_name_renumber (vat_main_t * vam) unformat_input_t *line_input = vam->input; vl_api_interface_name_renumber_t *mp; u32 sw_if_index = ~0; - f64 timeout; u32 new_show_dev_instance = ~0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -11800,7 +11713,6 @@ api_want_ip4_arp_events (vat_main_t * vam) { unformat_input_t *line_input = vam->input; vl_api_want_ip4_arp_events_t *mp; - f64 timeout; ip4_address_t address; int address_set = 0; u32 enable_disable = 1; @@ -11835,7 +11747,6 @@ api_want_ip6_nd_events (vat_main_t * vam) { unformat_input_t *line_input = vam->input; vl_api_want_ip6_nd_events_t *mp; - f64 timeout; ip6_address_t address; int address_set = 0; u32 enable_disable = 1; @@ -11870,7 +11781,6 @@ api_input_acl_set_interface (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_input_acl_set_interface_t *mp; - f64 timeout; u32 sw_if_index; int sw_if_index_set; u32 ip4_table_index = ~0; @@ -11928,7 +11838,6 @@ api_ip_address_dump (vat_main_t * vam) u8 sw_if_index_set = 0; u8 ipv4_set = 0; u8 ipv6_set = 0; - f64 timeout; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -11988,7 +11897,6 @@ api_ip_dump (vat_main_t * vam) int ipv4_set = 0; int ipv6_set = 0; int is_ipv6; - f64 timeout; int i; while (unformat_check_input (in) != UNFORMAT_END_OF_INPUT) @@ -12041,7 +11949,6 @@ api_ipsec_spd_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ipsec_spd_add_del_t *mp; - f64 timeout; u32 spd_id = ~0; u8 is_add = 1; @@ -12079,7 +11986,6 @@ api_ipsec_interface_add_del_spd (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ipsec_interface_add_del_spd_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; u32 spd_id = (u32) ~ 0; @@ -12133,7 +12039,6 @@ api_ipsec_spd_add_del_entry (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ipsec_spd_add_del_entry_t *mp; - f64 timeout; u8 is_add = 1, is_outbound = 0, is_ipv6 = 0, is_ip_any = 1; u32 spd_id = 0, sa_id = 0, protocol = 0, policy = 0; i32 priority = 0; @@ -12291,7 +12196,6 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ipsec_sad_add_del_entry_t *mp; - f64 timeout; u32 sad_id = 0, spi = 0; u8 *ck = 0, *ik = 0; u8 is_add = 1; @@ -12423,7 +12327,6 @@ api_ipsec_sa_set_key (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ipsec_sa_set_key_t *mp; - f64 timeout; u32 sa_id; u8 *ck = 0, *ik = 0; @@ -12470,7 +12373,6 @@ api_ikev2_profile_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ikev2_profile_add_del_t *mp; - f64 timeout; u8 is_add = 1; u8 *name = 0; @@ -12518,7 +12420,6 @@ api_ikev2_profile_set_auth (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ikev2_profile_set_auth_t *mp; - f64 timeout; u8 *name = 0; u8 *data = 0; u32 auth_method = 0; @@ -12589,7 +12490,6 @@ api_ikev2_profile_set_id (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ikev2_profile_set_id_t *mp; - f64 timeout; u8 *name = 0; u8 *data = 0; u8 is_local = 0; @@ -12669,7 +12569,6 @@ api_ikev2_profile_set_ts (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ikev2_profile_set_ts_t *mp; - f64 timeout; u8 *name = 0; u8 is_local = 0; u32 proto = 0, start_port = 0, end_port = (u32) ~ 0; @@ -12740,7 +12639,6 @@ api_ikev2_set_local_key (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ikev2_set_local_key_t *mp; - f64 timeout; u8 *file = 0; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -12785,7 +12683,6 @@ api_map_add_domain (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_map_add_domain_t *mp; - f64 timeout; ip4_address_t ip4_prefix; ip6_address_t ip6_prefix; @@ -12865,7 +12762,6 @@ api_map_del_domain (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_map_del_domain_t *mp; - f64 timeout; u32 num_m_args = 0; u32 index; @@ -12904,7 +12800,6 @@ api_map_add_del_rule (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_map_add_del_rule_t *mp; - f64 timeout; u8 is_add = 1; ip6_address_t ip6_dst; u32 num_m_args = 0, index, psid = 0; @@ -12947,7 +12842,6 @@ static int api_map_domain_dump (vat_main_t * vam) { vl_api_map_domain_dump_t *mp; - f64 timeout; /* Construct the API message */ M (MAP_DOMAIN_DUMP, mp); @@ -12969,7 +12863,6 @@ api_map_rule_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_map_rule_dump_t *mp; - f64 timeout; u32 domain_index = ~0; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -13041,7 +12934,6 @@ static int api_get_first_msg_id (vat_main_t * vam) { vl_api_get_first_msg_id_t *mp; - f64 timeout; unformat_input_t *i = vam->input; u8 *name; u8 name_set = 0; @@ -13080,7 +12972,6 @@ api_cop_interface_enable_disable (vat_main_t * vam) { unformat_input_t *line_input = vam->input; vl_api_cop_interface_enable_disable_t *mp; - f64 timeout; u32 sw_if_index = ~0; u8 enable_disable = 1; @@ -13121,7 +13012,6 @@ api_cop_whitelist_enable_disable (vat_main_t * vam) { unformat_input_t *line_input = vam->input; vl_api_cop_whitelist_enable_disable_t *mp; - f64 timeout; u32 sw_if_index = ~0; u8 ip4 = 0, ip6 = 0, default_cop = 0; u32 fib_id = 0; @@ -13169,7 +13059,6 @@ static int api_get_node_graph (vat_main_t * vam) { vl_api_get_node_graph_t *mp; - f64 timeout; M (GET_NODE_GRAPH, mp); @@ -13246,7 +13135,6 @@ api_lisp_add_del_locator_set (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_add_del_locator_set_t *mp; - f64 timeout = ~0; u8 is_add = 1; u8 *locator_set_name = NULL; u8 locator_set_name_set = 0; @@ -13333,7 +13221,6 @@ api_lisp_add_del_locator (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_add_del_locator_t *mp; - f64 timeout = ~0; u32 tmp_if_index = ~0; u32 sw_if_index = ~0; u8 sw_if_index_set = 0; @@ -13473,7 +13360,6 @@ api_lisp_add_del_local_eid (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_add_del_local_eid_t *mp; - f64 timeout = ~0; u8 is_add = 1; u8 eid_set = 0; lisp_eid_vat_t _eid, *eid = &_eid; @@ -13587,7 +13473,6 @@ api_lisp_gpe_add_del_fwd_entry (vat_main_t * vam) u32 dp_table = 0, vni = 0;; unformat_input_t *input = vam->input; vl_api_lisp_gpe_add_del_fwd_entry_t *mp; - f64 timeout = ~0; u8 is_add = 1; lisp_eid_vat_t _rmt_eid, *rmt_eid = &_rmt_eid; lisp_eid_vat_t _lcl_eid, *lcl_eid = &_lcl_eid; @@ -13728,7 +13613,6 @@ api_lisp_add_del_map_server (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_add_del_map_server_t *mp; - f64 timeout = ~0; u8 is_add = 1; u8 ipv4_set = 0; u8 ipv6_set = 0; @@ -13796,7 +13680,6 @@ api_lisp_add_del_map_resolver (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_add_del_map_resolver_t *mp; - f64 timeout = ~0; u8 is_add = 1; u8 ipv4_set = 0; u8 ipv6_set = 0; @@ -13864,7 +13747,6 @@ api_lisp_gpe_enable_disable (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_gpe_enable_disable_t *mp; - f64 timeout = ~0; u8 is_set = 0; u8 is_en = 1; @@ -13911,7 +13793,6 @@ api_lisp_rloc_probe_enable_disable (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_rloc_probe_enable_disable_t *mp; - f64 timeout = ~0; u8 is_set = 0; u8 is_en = 0; @@ -13955,7 +13836,6 @@ api_lisp_map_register_enable_disable (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_map_register_enable_disable_t *mp; - f64 timeout = ~0; u8 is_set = 0; u8 is_en = 0; @@ -13999,7 +13879,6 @@ api_lisp_enable_disable (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_enable_disable_t *mp; - f64 timeout = ~0; u8 is_set = 0; u8 is_en = 0; @@ -14043,7 +13922,6 @@ api_lisp_enable_disable (vat_main_t * vam) static int api_show_lisp_map_register_state (vat_main_t * vam) { - f64 timeout = ~0; vl_api_show_lisp_map_register_state_t *mp; M (SHOW_LISP_MAP_REGISTER_STATE, mp); @@ -14060,7 +13938,6 @@ api_show_lisp_map_register_state (vat_main_t * vam) static int api_show_lisp_rloc_probe_state (vat_main_t * vam) { - f64 timeout = ~0; vl_api_show_lisp_rloc_probe_state_t *mp; M (SHOW_LISP_RLOC_PROBE_STATE, mp); @@ -14077,7 +13954,6 @@ api_show_lisp_rloc_probe_state (vat_main_t * vam) static int api_show_lisp_map_request_mode (vat_main_t * vam) { - f64 timeout = ~0; vl_api_show_lisp_map_request_mode_t *mp; M (SHOW_LISP_MAP_REQUEST_MODE, mp); @@ -14094,7 +13970,6 @@ api_show_lisp_map_request_mode (vat_main_t * vam) static int api_lisp_map_request_mode (vat_main_t * vam) { - f64 timeout = ~0; unformat_input_t *input = vam->input; vl_api_lisp_map_request_mode_t *mp; u8 mode = 0; @@ -14136,7 +14011,6 @@ api_lisp_map_request_mode (vat_main_t * vam) static int api_lisp_pitr_set_locator_set (vat_main_t * vam) { - f64 timeout = ~0; u8 ls_name_set = 0; unformat_input_t *input = vam->input; vl_api_lisp_pitr_set_locator_set_t *mp; @@ -14183,7 +14057,6 @@ static int api_show_lisp_pitr (vat_main_t * vam) { vl_api_show_lisp_pitr_t *mp; - f64 timeout = ~0; if (!vam->json_output) { @@ -14207,7 +14080,6 @@ api_show_lisp_pitr (vat_main_t * vam) static int api_lisp_eid_table_add_del_map (vat_main_t * vam) { - f64 timeout = ~0; unformat_input_t *input = vam->input; vl_api_lisp_eid_table_add_del_map_t *mp; u8 is_add = 1, vni_set = 0, vrf_set = 0, bd_index_set = 0; @@ -14297,7 +14169,6 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_add_del_remote_mapping_t *mp; - f64 timeout = ~0; u32 vni = 0; lisp_eid_vat_t _eid, *eid = &_eid; lisp_eid_vat_t _seid, *seid = &_seid; @@ -14424,7 +14295,6 @@ api_lisp_add_del_adjacency (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_add_del_adjacency_t *mp; - f64 timeout = ~0; u32 vni = 0; ip4_address_t leid4, reid4; ip6_address_t leid6, reid6; @@ -14545,7 +14415,6 @@ api_lisp_gpe_add_del_iface (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_gpe_add_del_iface_t *mp; - f64 timeout = ~0; u8 action_set = 0, is_add = 1, is_l2 = 0, dp_table_set = 0, vni_set = 0; u32 dp_table = 0, vni = 0; @@ -14619,7 +14488,6 @@ api_lisp_add_del_map_request_itr_rlocs (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_add_del_map_request_itr_rlocs_t *mp; - f64 timeout = ~0; u8 *locator_set_name = 0; u8 locator_set_name_set = 0; u8 is_add = 1; @@ -14683,7 +14551,6 @@ api_lisp_locator_dump (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_lisp_locator_dump_t *mp; - f64 timeout = ~0; u8 is_index_set = 0, is_name_set = 0; u8 *ls_name = 0; u32 ls_index = ~0; @@ -14762,7 +14629,6 @@ api_lisp_locator_set_dump (vat_main_t * vam) { vl_api_lisp_locator_set_dump_t *mp; unformat_input_t *input = vam->input; - f64 timeout = ~0; u8 filter = 0; /* Parse args required to build the message */ @@ -14815,7 +14681,6 @@ api_lisp_eid_table_map_dump (vat_main_t * vam) u8 mode_set = 0; unformat_input_t *input = vam->input; vl_api_lisp_eid_table_map_dump_t *mp; - f64 timeout = ~0; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -14871,7 +14736,6 @@ static int api_lisp_eid_table_vni_dump (vat_main_t * vam) { vl_api_lisp_eid_table_vni_dump_t *mp; - f64 timeout = ~0; if (!vam->json_output) { @@ -14901,7 +14765,6 @@ api_lisp_eid_table_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_lisp_eid_table_dump_t *mp; - f64 timeout = ~0; struct in_addr ip4; struct in6_addr ip6; u8 mac[6]; @@ -15002,7 +14865,6 @@ api_lisp_gpe_fwd_entries_get (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_lisp_gpe_fwd_entries_get_t *mp; - f64 timeout = ~0; u8 vni_set = 0; u32 vni = ~0; @@ -15054,7 +14916,6 @@ api_lisp_adjacencies_get (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_lisp_adjacencies_get_t *mp; - f64 timeout = ~0; u8 vni_set = 0; u32 vni = ~0; @@ -15099,7 +14960,6 @@ static int api_lisp_map_server_dump (vat_main_t * vam) { vl_api_lisp_map_server_dump_t *mp; - f64 timeout = ~0; if (!vam->json_output) { @@ -15127,7 +14987,6 @@ static int api_lisp_map_resolver_dump (vat_main_t * vam) { vl_api_lisp_map_resolver_dump_t *mp; - f64 timeout = ~0; if (!vam->json_output) { @@ -15155,7 +15014,6 @@ static int api_show_lisp_status (vat_main_t * vam) { vl_api_show_lisp_status_t *mp; - f64 timeout = ~0; if (!vam->json_output) { @@ -15176,7 +15034,6 @@ static int api_lisp_gpe_fwd_entry_path_dump (vat_main_t * vam) { vl_api_lisp_gpe_fwd_entry_path_dump_t *mp; - f64 timeout = ~0; unformat_input_t *i = vam->input; u32 fwd_entry_index = ~0; @@ -15220,7 +15077,6 @@ static int api_lisp_get_map_request_itr_rlocs (vat_main_t * vam) { vl_api_lisp_get_map_request_itr_rlocs_t *mp; - f64 timeout = ~0; if (!vam->json_output) { @@ -15242,7 +15098,6 @@ api_af_packet_create (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_af_packet_create_t *mp; - f64 timeout; u8 *host_if_name = 0; u8 hw_addr[6]; u8 random_hw_addr = 1; @@ -15289,7 +15144,6 @@ api_af_packet_delete (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_af_packet_delete_t *mp; - f64 timeout; u8 *host_if_name = 0; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -15328,7 +15182,6 @@ api_policer_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_policer_add_del_t *mp; - f64 timeout; u8 is_add = 1; u8 *name = 0; u32 cir = 0; @@ -15428,7 +15281,6 @@ api_policer_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_policer_dump_t *mp; - f64 timeout = ~0; u8 *match_name = 0; u8 match_name_valid = 0; @@ -15468,7 +15320,6 @@ api_policer_classify_set_interface (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_policer_classify_set_interface_t *mp; - f64 timeout; u32 sw_if_index; int sw_if_index_set; u32 ip4_table_index = ~0; @@ -15522,7 +15373,6 @@ api_policer_classify_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_policer_classify_dump_t *mp; - f64 timeout = ~0; u8 type = POLICER_CLASSIFY_N_TABLES; if (unformat (i, "type %U", unformat_policer_classify_table_type, &type)) @@ -15561,7 +15411,6 @@ api_netmap_create (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_netmap_create_t *mp; - f64 timeout; u8 *if_name = 0; u8 hw_addr[6]; u8 random_hw_addr = 1; @@ -15618,7 +15467,6 @@ api_netmap_delete (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_netmap_delete_t *mp; - f64 timeout; u8 *if_name = 0; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -15705,7 +15553,6 @@ static int api_mpls_tunnel_dump (vat_main_t * vam) { vl_api_mpls_tunnel_dump_t *mp; - f64 timeout; i32 index = -1; /* Parse args required to build the message */ @@ -15818,7 +15665,6 @@ static int api_mpls_fib_dump (vat_main_t * vam) { vl_api_mpls_fib_dump_t *mp; - f64 timeout; M (MPLS_FIB_DUMP, mp); S (mp); @@ -15919,7 +15765,6 @@ static int api_ip_fib_dump (vat_main_t * vam) { vl_api_ip_fib_dump_t *mp; - f64 timeout; M (IP_FIB_DUMP, mp); S (mp); @@ -15987,7 +15832,6 @@ api_ip_neighbor_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ip_neighbor_dump_t *mp; - f64 timeout; u8 is_ipv6 = 0; u32 sw_if_index = ~0; @@ -16111,7 +15955,6 @@ static int api_ip6_fib_dump (vat_main_t * vam) { vl_api_ip6_fib_dump_t *mp; - f64 timeout; M (IP6_FIB_DUMP, mp); S (mp); @@ -16129,7 +15972,6 @@ int api_classify_table_ids (vat_main_t * vam) { vl_api_classify_table_ids_t *mp; - f64 timeout; /* Construct the API message */ M (CLASSIFY_TABLE_IDS, mp); @@ -16146,7 +15988,6 @@ api_classify_table_by_interface (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_classify_table_by_interface_t *mp; - f64 timeout; u32 sw_if_index = ~0; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -16180,7 +16021,6 @@ api_classify_table_info (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_classify_table_info_t *mp; - f64 timeout; u32 table_id = ~0; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -16212,7 +16052,6 @@ api_classify_session_dump (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_classify_session_dump_t *mp; - f64 timeout; u32 table_id = ~0; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -16296,7 +16135,6 @@ int api_ipfix_exporter_dump (vat_main_t * vam) { vl_api_ipfix_exporter_dump_t *mp; - f64 timeout; /* Construct the API message */ M (IPFIX_EXPORTER_DUMP, mp); @@ -16312,7 +16150,6 @@ static int api_ipfix_classify_stream_dump (vat_main_t * vam) { vl_api_ipfix_classify_stream_dump_t *mp; - f64 timeout; /* Construct the API message */ M (IPFIX_CLASSIFY_STREAM_DUMP, mp); @@ -16356,7 +16193,6 @@ static int api_ipfix_classify_table_dump (vat_main_t * vam) { vl_api_ipfix_classify_table_dump_t *mp; - f64 timeout; if (!vam->json_output) { @@ -16415,7 +16251,6 @@ api_sw_interface_span_enable_disable (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_span_enable_disable_t *mp; - f64 timeout; u32 src_sw_if_index = ~0; u32 dst_sw_if_index = ~0; u8 state = 3; @@ -16542,7 +16377,6 @@ static int api_sw_interface_span_dump (vat_main_t * vam) { vl_api_sw_interface_span_dump_t *mp; - f64 timeout; M (SW_INTERFACE_SPAN_DUMP, mp); S (mp); @@ -16561,7 +16395,6 @@ api_pg_create_interface (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_pg_create_interface_t *mp; - f64 timeout; u32 if_id = ~0; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -16593,7 +16426,6 @@ api_pg_capture (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_pg_capture_t *mp; - f64 timeout; u32 if_id = ~0; u8 enable = 1; @@ -16652,7 +16484,6 @@ api_pg_enable_disable (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_pg_enable_disable_t *mp; - f64 timeout; u8 enable = 1; u8 stream_name_set = 0; @@ -16699,7 +16530,6 @@ api_ip_source_and_port_range_check_add_del (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_ip_source_and_port_range_check_add_del_t *mp; - f64 timeout; u16 *low_ports = 0; u16 *high_ports = 0; @@ -16830,7 +16660,6 @@ api_ip_source_and_port_range_check_interface_add_del (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_ip_source_and_port_range_check_interface_add_del_t *mp; - f64 timeout; u32 sw_if_index = ~0; int vrf_set = 0; u32 tcp_out_vrf_id = ~0, udp_out_vrf_id = ~0; @@ -16899,7 +16728,6 @@ api_ipsec_gre_add_del_tunnel (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ipsec_gre_add_del_tunnel_t *mp; - f64 timeout; u32 local_sa_id = 0; u32 remote_sa_id = 0; ip4_address_t src_address; @@ -16944,7 +16772,6 @@ api_punt (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_punt_t *mp; - f64 timeout; u32 ipv = ~0; u32 protocol = ~0; u32 port = ~0; @@ -17021,7 +16848,6 @@ api_ipsec_gre_tunnel_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_ipsec_gre_tunnel_dump_t *mp; - f64 timeout; u32 sw_if_index; u8 sw_if_index_set = 0; @@ -17067,7 +16893,6 @@ 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) @@ -17104,7 +16929,6 @@ api_l2_interface_pbb_tag_rewrite (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_l2_interface_pbb_tag_rewrite_t *mp; - f64 timeout; u32 sw_if_index = ~0, vtr_op = ~0; u16 outer_tag = ~0; u8 dmac[6], smac[6]; @@ -17190,7 +17014,6 @@ api_flow_classify_set_interface (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_flow_classify_set_interface_t *mp; - f64 timeout; u32 sw_if_index; int sw_if_index_set; u32 ip4_table_index = ~0; @@ -17240,7 +17063,6 @@ api_flow_classify_dump (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_flow_classify_dump_t *mp; - f64 timeout = ~0; u8 type = FLOW_CLASSIFY_N_TABLES; if (unformat (i, "type %U", unformat_flow_classify_table_type, &type)) @@ -17279,7 +17101,6 @@ api_feature_enable_disable (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_feature_enable_disable_t *mp; - f64 timeout; u8 *arc_name = 0; u8 *feature_name = 0; u32 sw_if_index = ~0; @@ -17346,7 +17167,6 @@ api_sw_interface_tag_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_tag_add_del_t *mp; - f64 timeout; u32 sw_if_index = ~0; u8 *tag = 0; u8 enable = 1; @@ -17422,7 +17242,6 @@ static int api_l2_xconnect_dump (vat_main_t * vam) { vl_api_l2_xconnect_dump_t *mp; - f64 timeout; if (!vam->json_output) { @@ -17447,7 +17266,6 @@ api_sw_interface_set_mtu (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_sw_interface_set_mtu_t *mp; - f64 timeout; u32 sw_if_index = ~0; u32 mtu = 0; diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h index 172fe2db..ffb74fe3 100644 --- a/src/vlibapi/vat_helper_macros.h +++ b/src/vlibapi/vat_helper_macros.h @@ -44,7 +44,7 @@ do { \ /* W: wait for results, with timeout */ #define W \ do { \ - timeout = vat_time_now (vam) + 1.0; \ + f64 timeout = vat_time_now (vam) + 1.0; \ \ while (vat_time_now (vam) < timeout) { \ if (vam->result_ready == 1) { \ @@ -58,7 +58,7 @@ do { \ /* W2: wait for results, with timeout */ #define W2(body) \ do { \ - timeout = vat_time_now (vam) + 1.0; \ + f64 timeout = vat_time_now (vam) + 1.0; \ \ while (vat_time_now (vam) < timeout) { \ if (vam->result_ready == 1) { \ -- cgit 1.2.3-korg From 56c7b01e163c233030359781d7e60f4553e90c51 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Wed, 1 Feb 2017 12:31:41 -0600 Subject: Refactor fragile msg macro W and W2 to not burry return control flow. Instead, have them accept and assign a return paramter leaving the return control flow up to the caller. Clean up otherwise misleading returns present even after "NOT REACHED" comments. Change-Id: I0861921f73ab65d55b95eabd27514f0129152723 Signed-off-by: Jon Loeliger --- build-root/emacs-lisp/plugin-test-skel.el | 4 +- src/examples/sample-plugin/sample/sample_test.c | 4 +- src/plugins/acl/acl_test.c | 52 +- src/plugins/flowperpkt/flowperpkt_test.c | 4 +- .../export-vxlan-gpe/vxlan_gpe_ioam_export_test.c | 4 +- src/plugins/ioam/export/ioam_export_test.c | 4 +- src/plugins/ioam/lib-pot/pot_test.c | 18 +- src/plugins/ioam/lib-trace/trace_test.c | 17 +- src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c | 36 +- src/plugins/lb/lb_test.c | 19 +- src/plugins/snat/snat_test.c | 74 +- src/vat/api_format.c | 1028 +++++++++++--------- src/vlibapi/vat_helper_macros.h | 12 +- 13 files changed, 699 insertions(+), 577 deletions(-) (limited to 'src/plugins/ioam/lib-pot/pot_test.c') diff --git a/build-root/emacs-lisp/plugin-test-skel.el b/build-root/emacs-lisp/plugin-test-skel.el index 116c420a..b546747f 100644 --- a/build-root/emacs-lisp/plugin-test-skel.el +++ b/build-root/emacs-lisp/plugin-test-skel.el @@ -150,6 +150,7 @@ static int api_" plugin-name "_enable_disable (vat_main_t * vam) int enable_disable = 1; u32 sw_if_index = ~0; vl_api_" plugin-name "_enable_disable_t * mp; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -177,7 +178,8 @@ static int api_" plugin-name "_enable_disable (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } /* diff --git a/src/examples/sample-plugin/sample/sample_test.c b/src/examples/sample-plugin/sample/sample_test.c index bf7a0590..6dd3a3e8 100644 --- a/src/examples/sample-plugin/sample/sample_test.c +++ b/src/examples/sample-plugin/sample/sample_test.c @@ -98,6 +98,7 @@ static int api_sample_macswap_enable_disable (vat_main_t * vam) int enable_disable = 1; u32 sw_if_index = ~0; vl_api_sample_macswap_enable_disable_t * mp; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -125,7 +126,8 @@ static int api_sample_macswap_enable_disable (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } /* diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c index 39d7e1c4..23dc6bc0 100644 --- a/src/plugins/acl/acl_test.c +++ b/src/plugins/acl/acl_test.c @@ -267,6 +267,7 @@ static int api_acl_plugin_get_version (vat_main_t * vam) acl_test_main_t * sm = &acl_test_main; vl_api_acl_plugin_get_version_t * mp; u32 msg_size = sizeof(*mp); + int ret; vam->result_ready = 0; mp = vl_msg_api_alloc_as_if_client(msg_size); @@ -278,9 +279,8 @@ static int api_acl_plugin_get_version (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; - - return 0; + W (ret); + return ret; } static int api_macip_acl_interface_get (vat_main_t * vam) @@ -288,6 +288,7 @@ static int api_macip_acl_interface_get (vat_main_t * vam) acl_test_main_t * sm = &acl_test_main; vl_api_acl_plugin_get_version_t * mp; u32 msg_size = sizeof(*mp); + int ret; vam->result_ready = 0; mp = vl_msg_api_alloc_as_if_client(msg_size); @@ -299,9 +300,8 @@ static int api_macip_acl_interface_get (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; - - return 0; + W (ret); + return ret; } #define vec_validate_acl_rules(v, idx) \ @@ -335,6 +335,7 @@ static int api_acl_add_replace (vat_main_t * vam) ip4_address_t src_v4address, dst_v4address; ip6_address_t src_v6address, dst_v6address; u8 *tag = 0; + int ret; if (!unformat (i, "%d", &acl_index)) { /* Just assume -1 */ @@ -479,7 +480,8 @@ static int api_acl_add_replace (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int api_acl_del (vat_main_t * vam) @@ -487,6 +489,7 @@ static int api_acl_del (vat_main_t * vam) unformat_input_t * i = vam->input; vl_api_acl_del_t * mp; u32 acl_index = ~0; + int ret; if (!unformat (i, "%d", &acl_index)) { errmsg ("missing acl index\n"); @@ -501,7 +504,8 @@ static int api_acl_del (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int api_macip_acl_del (vat_main_t * vam) @@ -509,6 +513,7 @@ static int api_macip_acl_del (vat_main_t * vam) unformat_input_t * i = vam->input; vl_api_acl_del_t * mp; u32 acl_index = ~0; + int ret; if (!unformat (i, "%d", &acl_index)) { errmsg ("missing acl index\n"); @@ -523,7 +528,8 @@ static int api_macip_acl_del (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int api_acl_interface_add_del (vat_main_t * vam) @@ -534,6 +540,7 @@ static int api_acl_interface_add_del (vat_main_t * vam) u32 acl_index = ~0; u8 is_input = 0; u8 is_add = 0; + int ret; // acl_interface_add_del | sw_if_index acl_index [out] [del] @@ -589,7 +596,8 @@ static int api_acl_interface_add_del (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int api_macip_acl_interface_add_del (vat_main_t * vam) @@ -599,6 +607,7 @@ static int api_macip_acl_interface_add_del (vat_main_t * vam) u32 sw_if_index = ~0; u32 acl_index = ~0; u8 is_add = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -638,7 +647,8 @@ static int api_macip_acl_interface_add_del (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int api_acl_interface_set_acl_list (vat_main_t * vam) @@ -650,6 +660,7 @@ static int api_acl_interface_set_acl_list (vat_main_t * vam) u32 *inacls = 0; u32 *outacls = 0; u8 is_input = 0; + int ret; // acl_interface_set_acl_list | sw_if_index input [acl-idx list] output [acl-idx list] @@ -694,7 +705,8 @@ static int api_acl_interface_set_acl_list (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } @@ -703,6 +715,7 @@ static int api_acl_interface_list_dump (vat_main_t * vam) unformat_input_t * i = vam->input; u32 sw_if_index = ~0; vl_api_acl_interface_list_dump_t * mp; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -722,7 +735,8 @@ static int api_acl_interface_list_dump (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int api_acl_dump (vat_main_t * vam) @@ -730,6 +744,7 @@ static int api_acl_dump (vat_main_t * vam) unformat_input_t * i = vam->input; u32 acl_index = ~0; vl_api_acl_dump_t * mp; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -747,7 +762,8 @@ static int api_acl_dump (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int api_macip_acl_dump (vat_main_t * vam) @@ -755,6 +771,7 @@ static int api_macip_acl_dump (vat_main_t * vam) unformat_input_t * i = vam->input; u32 acl_index = ~0; vl_api_acl_dump_t * mp; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -772,7 +789,8 @@ static int api_macip_acl_dump (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } #define vec_validate_macip_acl_rules(v, idx) \ @@ -801,6 +819,7 @@ static int api_macip_acl_add (vat_main_t * vam) u8 src_mac[6]; u8 *tag = 0; u8 mac_mask_all_1[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -903,7 +922,8 @@ static int api_macip_acl_add (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } /* diff --git a/src/plugins/flowperpkt/flowperpkt_test.c b/src/plugins/flowperpkt/flowperpkt_test.c index 4cc1cfb7..972a3b07 100644 --- a/src/plugins/flowperpkt/flowperpkt_test.c +++ b/src/plugins/flowperpkt/flowperpkt_test.c @@ -99,6 +99,7 @@ api_flowperpkt_tx_interface_add_del (vat_main_t * vam) u8 which = 0; /* ipv4 by default */ u32 sw_if_index = ~0; vl_api_flowperpkt_tx_interface_add_del_t *mp; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -131,7 +132,8 @@ api_flowperpkt_tx_interface_add_del (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } /* diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c index a7938219..17d31c95 100644 --- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c +++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c @@ -94,6 +94,7 @@ api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam) unformat_input_t *i = vam->input; int is_disable = 0; vl_api_vxlan_gpe_ioam_export_enable_disable_t *mp; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -112,7 +113,8 @@ api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } /* diff --git a/src/plugins/ioam/export/ioam_export_test.c b/src/plugins/ioam/export/ioam_export_test.c index 2cb036a5..5023afd7 100644 --- a/src/plugins/ioam/export/ioam_export_test.c +++ b/src/plugins/ioam/export/ioam_export_test.c @@ -96,6 +96,7 @@ api_ioam_export_ip6_enable_disable (vat_main_t * vam) unformat_input_t *i = vam->input; int is_disable = 0; vl_api_ioam_export_ip6_enable_disable_t *mp; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -114,7 +115,8 @@ api_ioam_export_ip6_enable_disable (vat_main_t * vam) S(mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } /* diff --git a/src/plugins/ioam/lib-pot/pot_test.c b/src/plugins/ioam/lib-pot/pot_test.c index d896eb2f..1c6dd02d 100644 --- a/src/plugins/ioam/lib-pot/pot_test.c +++ b/src/plugins/ioam/lib-pot/pot_test.c @@ -134,6 +134,7 @@ static int api_pot_profile_add (vat_main_t *vam) u64 lpc = 0, poly2 = 0; u8 id = 0; int rv = 0; + int ret; while (unformat_check_input(input) != UNFORMAT_END_OF_INPUT) { @@ -188,7 +189,8 @@ static int api_pot_profile_add (vat_main_t *vam) mp->max_bits = bits; S(mp); - W; + W (ret); + return ret; OUT: vec_free(name); @@ -203,6 +205,7 @@ static int api_pot_profile_activate (vat_main_t *vam) u8 *name = NULL; u8 id = 0; int rv = 0; + int ret; while (unformat_check_input(input) != UNFORMAT_END_OF_INPUT) { @@ -228,7 +231,8 @@ static int api_pot_profile_activate (vat_main_t *vam) mp->id = id; S(mp); - W; + W (ret); + return ret; OUT: vec_free(name); @@ -239,12 +243,13 @@ OUT: static int api_pot_profile_del (vat_main_t *vam) { vl_api_pot_profile_del_t *mp; + int ret; M(POT_PROFILE_DEL, mp); mp->list_name_len = 0; S(mp); - W; - return 0; + W (ret); + return ret; } static int api_pot_profile_show_config_dump (vat_main_t *vam) @@ -252,6 +257,7 @@ static int api_pot_profile_show_config_dump (vat_main_t *vam) unformat_input_t *input = vam->input; vl_api_pot_profile_show_config_dump_t *mp; u8 id = 0; + int ret; while(unformat_check_input(input) != UNFORMAT_END_OF_INPUT) { @@ -264,8 +270,8 @@ static int api_pot_profile_show_config_dump (vat_main_t *vam) mp->id = id; S(mp); - W; - return 0; + W (ret); + return ret; } /* diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c index d1fb7205..1e287dee 100644 --- a/src/plugins/ioam/lib-trace/trace_test.c +++ b/src/plugins/ioam/lib-trace/trace_test.c @@ -125,10 +125,10 @@ api_trace_profile_add (vat_main_t * vam) vl_api_trace_profile_add_t *mp; u8 trace_type = 0; u8 num_elts = 0; - int rv = 0; u32 node_id = 0; u32 app_data = 0; u8 trace_tsp = 0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -157,9 +157,8 @@ api_trace_profile_add (vat_main_t * vam) mp->num_elts = num_elts; S (mp); - W; - - return (rv); + W (ret); + return ret; } @@ -168,22 +167,24 @@ static int api_trace_profile_del (vat_main_t * vam) { vl_api_trace_profile_del_t *mp; + int ret; M (TRACE_PROFILE_DEL, mp); S (mp); - W; - return 0; + W (ret); + return ret; } static int api_trace_profile_show_config (vat_main_t * vam) { vl_api_trace_profile_show_config_t *mp; + int ret; M (TRACE_PROFILE_SHOW_CONFIG, mp); S (mp); - W; - return 0; + W (ret); + return ret; } /* diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c index 3e7300f5..80e65644 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c @@ -108,6 +108,7 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam) int has_trace_option = 0; int has_pow_option = 0; int has_ppc_option = 0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -132,9 +133,8 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam) S (mp); - W; - - return (0); + W (ret); + return ret; } @@ -142,11 +142,12 @@ static int api_vxlan_gpe_ioam_disable (vat_main_t * vam) { vl_api_vxlan_gpe_ioam_disable_t *mp; + int ret; M (VXLAN_GPE_IOAM_DISABLE, mp); S (mp); - W; - return 0; + W (ret); + return ret; } static int @@ -161,6 +162,7 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) u8 remote_set = 0; u32 vni; u8 vni_set = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -238,9 +240,8 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - - return (0); + W (ret); + return ret; } static int @@ -255,6 +256,7 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) u8 remote_set = 0; u32 vni; u8 vni_set = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -332,9 +334,8 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - - return 0; + W (ret); + return ret; } static int @@ -347,6 +348,7 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) u8 ipv4_set = 0, ipv6_set = 0; u8 local_set = 0; u32 outer_fib_index = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -401,9 +403,8 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - - return (0); + W (ret); + return ret; } static int @@ -416,6 +417,7 @@ api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam) u8 ipv4_set = 0, ipv6_set = 0; u8 local_set = 0; u32 outer_fib_index = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -469,10 +471,8 @@ api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - - - return (0); + W (ret); + return ret; } /* diff --git a/src/plugins/lb/lb_test.c b/src/plugins/lb/lb_test.c index a811079e..9b30c18d 100644 --- a/src/plugins/lb/lb_test.c +++ b/src/plugins/lb/lb_test.c @@ -134,6 +134,7 @@ static int api_lb_conf (vat_main_t * vam) { unformat_input_t *i = vam->input; vl_api_lb_conf_t mps, *mp; + int ret; if (!unformat(i, "%U %U %u %u", unformat_ip4_address, &mps.ip4_src_address, @@ -146,16 +147,15 @@ static int api_lb_conf (vat_main_t * vam) M(LB_CONF, mp); S(mp); - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_lb_add_del_vip (vat_main_t * vam) { unformat_input_t * i = vam->input; vl_api_lb_add_del_vip_t mps, *mp; + int ret; mps.is_del = 0; mps.is_gre4 = 0; @@ -185,15 +185,15 @@ static int api_lb_add_del_vip (vat_main_t * vam) M(LB_ADD_DEL_VIP, mp); S(mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_lb_add_del_as (vat_main_t * vam) { unformat_input_t * i = vam->input; vl_api_lb_add_del_as_t mps, *mp; + int ret; mps.is_del = 0; if (!unformat(i, "%U %U", @@ -209,9 +209,8 @@ static int api_lb_add_del_as (vat_main_t * vam) M(LB_ADD_DEL_AS, mp); S(mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } /* diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c index 8bab00c1..086059a3 100644 --- a/src/plugins/snat/snat_test.c +++ b/src/plugins/snat/snat_test.c @@ -114,6 +114,7 @@ static int api_snat_add_address_range (vat_main_t * vam) vl_api_snat_add_address_range_t * mp; u8 is_add = 1; int count; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -159,10 +160,8 @@ static int api_snat_add_address_range (vat_main_t * vam) mp->is_add = is_add; S(mp); - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_snat_interface_add_del_feature (vat_main_t * vam) @@ -173,6 +172,7 @@ static int api_snat_interface_add_del_feature (vat_main_t * vam) u8 sw_if_index_set = 0; u8 is_inside = 1; u8 is_add = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -205,9 +205,8 @@ static int api_snat_interface_add_del_feature (vat_main_t * vam) mp->is_inside = is_inside; S(mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_snat_add_static_mapping(vat_main_t * vam) @@ -222,6 +221,7 @@ static int api_snat_add_static_mapping(vat_main_t * vam) u32 local_port = 0, external_port = 0, vrf_id = ~0; u32 sw_if_index = ~0; u8 sw_if_index_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -273,9 +273,8 @@ static int api_snat_add_static_mapping(vat_main_t * vam) memcpy (mp->external_ip_address, &external_addr, 4); S(mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_snat_control_ping_reply_t_handler @@ -318,6 +317,7 @@ static void vl_api_snat_static_mapping_details_t_handler static int api_snat_static_mapping_dump(vat_main_t * vam) { vl_api_snat_static_mapping_dump_t * mp; + int ret; if (vam->json_output) { @@ -337,9 +337,8 @@ static int api_snat_static_mapping_dump(vat_main_t * vam) M(SNAT_CONTROL_PING, mp); S(mp); } - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_snat_show_config_reply_t_handler @@ -376,6 +375,7 @@ static void vl_api_snat_show_config_reply_t_handler static int api_snat_show_config(vat_main_t * vam) { vl_api_snat_show_config_t * mp; + int ret; if (vam->json_output) { @@ -385,9 +385,8 @@ static int api_snat_show_config(vat_main_t * vam) M(SNAT_SHOW_CONFIG, mp); S(mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_snat_address_details_t_handler @@ -402,6 +401,7 @@ static void vl_api_snat_address_details_t_handler static int api_snat_address_dump(vat_main_t * vam) { vl_api_snat_address_dump_t * mp; + int ret; if (vam->json_output) { @@ -417,9 +417,8 @@ static int api_snat_address_dump(vat_main_t * vam) M(SNAT_CONTROL_PING, mp); S(mp); } - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_snat_interface_details_t_handler @@ -435,6 +434,7 @@ static void vl_api_snat_interface_details_t_handler static int api_snat_interface_dump(vat_main_t * vam) { vl_api_snat_interface_dump_t * mp; + int ret; if (vam->json_output) { @@ -450,9 +450,8 @@ static int api_snat_interface_dump(vat_main_t * vam) M(SNAT_CONTROL_PING, mp); S(mp); } - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_snat_set_workers (vat_main_t * vam) @@ -460,6 +459,7 @@ static int api_snat_set_workers (vat_main_t * vam) unformat_input_t * i = vam->input; vl_api_snat_set_workers_t * mp; uword *bitmap; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -476,10 +476,8 @@ static int api_snat_set_workers (vat_main_t * vam) mp->worker_mask = clib_host_to_net_u64 (bitmap[0]); S(mp); - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_snat_worker_details_t_handler @@ -495,6 +493,7 @@ static void vl_api_snat_worker_details_t_handler static int api_snat_worker_dump(vat_main_t * vam) { vl_api_snat_worker_dump_t * mp; + int ret; if (vam->json_output) { @@ -510,9 +509,8 @@ static int api_snat_worker_dump(vat_main_t * vam) M(SNAT_CONTROL_PING, mp); S(mp); } - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_snat_ipfix_enable_disable (vat_main_t * vam) @@ -522,6 +520,7 @@ static int api_snat_ipfix_enable_disable (vat_main_t * vam) u32 sw_if_index; u8 sw_if_index_set = 0; u8 is_add = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -549,9 +548,8 @@ static int api_snat_ipfix_enable_disable (vat_main_t * vam) mp->is_add = is_add; S(mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_snat_interface_addr_details_t_handler @@ -566,6 +564,7 @@ static void vl_api_snat_interface_addr_details_t_handler static int api_snat_interface_addr_dump(vat_main_t * vam) { vl_api_snat_interface_addr_dump_t * mp; + int ret; if (vam->json_output) { @@ -581,9 +580,8 @@ static int api_snat_interface_addr_dump(vat_main_t * vam) M(SNAT_CONTROL_PING, mp); S(mp); } - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_snat_add_del_interface_addr (vat_main_t * vam) @@ -593,6 +591,7 @@ static int api_snat_add_del_interface_addr (vat_main_t * vam) u32 domain_id = 0; u32 src_port = 0; u8 enable = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -615,9 +614,8 @@ static int api_snat_add_del_interface_addr (vat_main_t * vam) mp->enable = enable; S(mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } /* diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 8caa94f0..db5478ca 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -4641,6 +4641,7 @@ exec_inband (vat_main_t * vam) { vl_api_cli_inband_t *mp; unformat_input_t *i = vam->input; + int ret; if (vec_len (i->buffer) == 0) return -1; @@ -4667,7 +4668,8 @@ exec_inband (vat_main_t * vam) mp->length = htonl (len); S (mp); - W2 (print (vam->ofp, "%s", vam->cmd_reply)); + W2 (ret, print (vam->ofp, "%s", vam->cmd_reply)); + return ret; } static int @@ -4677,6 +4679,7 @@ api_create_loopback (vat_main_t * vam) vl_api_create_loopback_t *mp; u8 mac_address[6]; u8 mac_set = 0; + int ret; memset (mac_address, 0, sizeof (mac_address)); @@ -4694,7 +4697,8 @@ api_create_loopback (vat_main_t * vam) clib_memcpy (mp->mac_address, mac_address, sizeof (mac_address)); S (mp); - W; + W (ret); + return ret; } static int @@ -4703,6 +4707,7 @@ api_delete_loopback (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_delete_loopback_t *mp; u32 sw_if_index = ~0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -4723,7 +4728,8 @@ api_delete_loopback (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); S (mp); - W; + W (ret); + return ret; } static int @@ -4732,6 +4738,7 @@ api_want_stats (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_want_stats_t *mp; int enable = -1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -4753,7 +4760,8 @@ api_want_stats (vat_main_t * vam) mp->enable_disable = enable; S (mp); - W; + W (ret); + return ret; } static int @@ -4762,6 +4770,7 @@ api_want_interface_events (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_want_interface_events_t *mp; int enable = -1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -4785,7 +4794,8 @@ api_want_interface_events (vat_main_t * vam) vam->interface_event_display = enable; S (mp); - W; + W (ret); + return ret; } @@ -4797,6 +4807,7 @@ api_sw_interface_dump (vat_main_t * vam) hash_pair_t *p; name_sort_t *nses = 0, *ns; sw_interface_subif_t *sub = NULL; + int ret; /* Toss the old name table */ /* *INDENT-OFF* */ @@ -4892,7 +4903,8 @@ api_sw_interface_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static int @@ -4903,6 +4915,7 @@ api_sw_interface_set_flags (vat_main_t * vam) u32 sw_if_index; u8 sw_if_index_set = 0; u8 admin_up = 0, link_up = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -4940,7 +4953,8 @@ api_sw_interface_set_flags (vat_main_t * vam) S (mp); /* Wait for a reply, return the good/bad news... */ - W; + W (ret); + return ret; } static int @@ -4950,6 +4964,7 @@ api_sw_interface_clear_stats (vat_main_t * vam) vl_api_sw_interface_clear_stats_t *mp; u32 sw_if_index; u8 sw_if_index_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -4974,7 +4989,8 @@ api_sw_interface_clear_stats (vat_main_t * vam) S (mp); /* Wait for a reply, return the good/bad news... */ - W; + W (ret); + return ret; } #if DPDK >0 @@ -4991,6 +5007,7 @@ api_sw_interface_set_dpdk_hqos_pipe (vat_main_t * vam) u8 pipe_set = 0; u32 profile; u8 profile_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5045,9 +5062,8 @@ api_sw_interface_set_dpdk_hqos_pipe (vat_main_t * vam) S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -5063,6 +5079,7 @@ api_sw_interface_set_dpdk_hqos_subport (vat_main_t * vam) u32 tb_size = 1000000; u32 tc_rate[] = { 1250000000, 1250000000, 1250000000, 1250000000 }; u32 tc_period = 10; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5125,9 +5142,8 @@ api_sw_interface_set_dpdk_hqos_subport (vat_main_t * vam) mp->tc_period = ntohl (tc_period); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -5141,6 +5157,7 @@ api_sw_interface_set_dpdk_hqos_tctbl (vat_main_t * vam) u8 tc_set = 0; u8 queue_set = 0; u32 entry, tc, queue; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5191,9 +5208,8 @@ api_sw_interface_set_dpdk_hqos_tctbl (vat_main_t * vam) mp->queue = ntohl (queue); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } #endif @@ -5210,6 +5226,7 @@ api_sw_interface_add_del_address (vat_main_t * vam) u8 v6_address_set = 0; ip4_address_t v4address; ip6_address_t v6address; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5270,7 +5287,8 @@ api_sw_interface_add_del_address (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; + W (ret); + return ret; } static int @@ -5281,6 +5299,7 @@ api_sw_interface_set_mpls_enable (vat_main_t * vam) u32 sw_if_index; u8 sw_if_index_set = 0; u8 enable = 1; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5313,7 +5332,8 @@ api_sw_interface_set_mpls_enable (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int @@ -5324,6 +5344,7 @@ api_sw_interface_set_table (vat_main_t * vam) u32 sw_if_index, vrf_id = 0; u8 sw_if_index_set = 0; u8 is_ipv6 = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5357,7 +5378,8 @@ api_sw_interface_set_table (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static void vl_api_sw_interface_get_table_reply_t_handler @@ -5397,6 +5419,7 @@ api_sw_interface_get_table (vat_main_t * vam) u32 sw_if_index; u8 sw_if_index_set = 0; u8 is_ipv6 = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -5421,7 +5444,8 @@ api_sw_interface_get_table (vat_main_t * vam) mp->is_ipv6 = is_ipv6; S (mp); - W; + W (ret); + return ret; } static int @@ -5432,6 +5456,7 @@ api_sw_interface_set_vpath (vat_main_t * vam) u32 sw_if_index = 0; u8 sw_if_index_set = 0; u8 is_enable = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5464,7 +5489,8 @@ api_sw_interface_set_vpath (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int @@ -5476,6 +5502,7 @@ api_sw_interface_set_vxlan_bypass (vat_main_t * vam) u8 sw_if_index_set = 0; u8 is_enable = 1; u8 is_ipv6 = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5513,7 +5540,8 @@ api_sw_interface_set_vxlan_bypass (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int @@ -5526,6 +5554,7 @@ api_sw_interface_set_l2_xconnect (vat_main_t * vam) u32 tx_sw_if_index; u8 tx_sw_if_index_set = 0; u8 enable = 1; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5583,9 +5612,8 @@ api_sw_interface_set_l2_xconnect (vat_main_t * vam) mp->enable = enable; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -5600,6 +5628,7 @@ api_sw_interface_set_l2_bridge (vat_main_t * vam) u8 bvi = 0; u32 shg = 0; u8 enable = 1; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5645,9 +5674,8 @@ api_sw_interface_set_l2_bridge (vat_main_t * vam) mp->enable = enable; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -5656,6 +5684,7 @@ api_bridge_domain_dump (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_bridge_domain_dump_t *mp; u32 bd_id = ~0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5677,9 +5706,8 @@ api_bridge_domain_dump (vat_main_t * vam) S (mp); } - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -5691,6 +5719,7 @@ api_bridge_domain_add_del (vat_main_t * vam) u8 is_add = 1; u32 flood = 1, forward = 1, learn = 1, uu_flood = 1, arp_term = 0; u32 mac_age = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5742,9 +5771,8 @@ api_bridge_domain_add_del (vat_main_t * vam) mp->mac_age = (u8) mac_age; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -5887,8 +5915,11 @@ api_l2fib_add_del (vat_main_t * vam) } else { + int ret; + /* Wait for a reply... */ - W; + W (ret); + return ret; } /* Return the good/bad news */ return (vam->retval); @@ -5902,6 +5933,7 @@ api_l2_flags (vat_main_t * vam) u32 sw_if_index; u32 feature_bitmap = 0; u8 sw_if_index_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5943,9 +5975,8 @@ api_l2_flags (vat_main_t * vam) mp->feature_bitmap = ntohl (feature_bitmap); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -5957,6 +5988,7 @@ api_bridge_flags (vat_main_t * vam) u8 bd_id_set = 0; u8 is_set = 1; u32 flags = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -5994,9 +6026,8 @@ api_bridge_flags (vat_main_t * vam) mp->is_set = is_set; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -6013,6 +6044,7 @@ api_bd_ip_mac_add_del (vat_main_t * vam) ip4_address_t v4addr; ip6_address_t v6addr; u8 macaddr[6]; + int ret; /* Parse args required to build the message */ @@ -6068,9 +6100,8 @@ api_bd_ip_mac_add_del (vat_main_t * vam) clib_memcpy (mp->ip_address, &v4addr, sizeof (v4addr)); clib_memcpy (mp->mac_address, macaddr, 6); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -6089,6 +6120,7 @@ api_tap_connect (vat_main_t * vam) ip6_address_t ip6_address; u32 ip6_mask_width; int ip6_address_set = 0; + int ret; memset (mac_address, 0, sizeof (mac_address)); @@ -6162,7 +6194,8 @@ api_tap_connect (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int @@ -6176,6 +6209,7 @@ api_tap_modify (vat_main_t * vam) u8 *tap_name; u32 sw_if_index = ~0; u8 sw_if_index_set = 0; + int ret; memset (mac_address, 0, sizeof (mac_address)); @@ -6227,7 +6261,8 @@ api_tap_modify (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int @@ -6237,6 +6272,7 @@ api_tap_delete (vat_main_t * vam) vl_api_tap_delete_t *mp; u32 sw_if_index = ~0; u8 sw_if_index_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -6264,7 +6300,8 @@ api_tap_delete (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int @@ -6556,8 +6593,11 @@ api_ip_add_del_route (vat_main_t * vam) } else { + int ret; + /* Wait for a reply... */ - W; + W (ret); + return ret; } /* Return the good/bad news */ @@ -6580,6 +6620,7 @@ api_ip_mroute_add_del (vat_main_t * vam) ip6_address_t v6_grp_address, v6_src_address; mfib_itf_flags_t iflags = 0; mfib_entry_flags_t eflags = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -6677,7 +6718,8 @@ api_ip_mroute_add_del (vat_main_t * vam) /* send it... */ S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int @@ -6893,8 +6935,11 @@ api_mpls_route_add_del (vat_main_t * vam) } else { + int ret; + /* Wait for a reply... */ - W; + W (ret); + return ret; } /* Return the good/bad news */ @@ -6915,6 +6960,7 @@ api_mpls_ip_bind_unbind (vat_main_t * vam) u32 address_length; u8 address_set = 0; mpls_label_t local_label = MPLS_LABEL_INVALID; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -6980,7 +7026,8 @@ api_mpls_ip_bind_unbind (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int @@ -6992,6 +7039,7 @@ api_proxy_arp_add_del (vat_main_t * vam) u8 is_add = 1; ip4_address_t lo, hi; u8 range_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7023,9 +7071,8 @@ api_proxy_arp_add_del (vat_main_t * vam) clib_memcpy (mp->hi_address, &hi, sizeof (mp->hi_address)); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7036,6 +7083,7 @@ api_proxy_arp_intfc_enable_disable (vat_main_t * vam) u32 sw_if_index; u8 enable = 1; u8 sw_if_index_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7066,9 +7114,8 @@ api_proxy_arp_intfc_enable_disable (vat_main_t * vam) mp->enable_disable = enable; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7089,6 +7136,7 @@ api_mpls_tunnel_add_del (vat_main_t * vam) }; ip6_address_t v6_next_hop_address = { {0} }; mpls_label_t next_hop_out_label = MPLS_LABEL_INVALID, *labels = NULL; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7151,9 +7199,8 @@ api_mpls_tunnel_add_del (vat_main_t * vam) } S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7165,6 +7212,7 @@ api_sw_interface_set_unnumbered (vat_main_t * vam) u32 unnum_sw_index = ~0; u8 is_add = 1; u8 sw_if_index_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7196,9 +7244,8 @@ api_sw_interface_set_unnumbered (vat_main_t * vam) mp->is_add = is_add; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7217,6 +7264,7 @@ api_ip_neighbor_add_del (vat_main_t * vam) u8 v6_address_set = 0; ip4_address_t v4address; ip6_address_t v6address; + int ret; memset (mac_address, 0, sizeof (mac_address)); @@ -7289,10 +7337,8 @@ api_ip_neighbor_add_del (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7303,6 +7349,7 @@ api_reset_vrf (vat_main_t * vam) u32 vrf_id = 0; u8 is_ipv6 = 0; u8 vrf_id_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7329,9 +7376,8 @@ api_reset_vrf (vat_main_t * vam) mp->is_ipv6 = is_ipv6; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7343,6 +7389,7 @@ api_create_vlan_subif (vat_main_t * vam) u8 sw_if_index_set = 0; u32 vlan_id; u8 vlan_id_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7377,9 +7424,8 @@ api_create_vlan_subif (vat_main_t * vam) mp->vlan_id = ntohl (vlan_id); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } #define foreach_create_subif_bit \ @@ -7412,6 +7458,7 @@ api_create_subif (vat_main_t * vam) u32 tmp; u16 outer_vlan_id = 0; u16 inner_vlan_id = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7461,9 +7508,8 @@ api_create_subif (vat_main_t * vam) mp->inner_vlan_id = ntohs (inner_vlan_id); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7476,6 +7522,7 @@ api_oam_add_del (vat_main_t * vam) ip4_address_t src, dst; u8 src_set = 0; u8 dst_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7514,9 +7561,8 @@ api_oam_add_del (vat_main_t * vam) clib_memcpy (mp->dst_address, &dst, sizeof (mp->dst_address)); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7528,6 +7574,7 @@ api_reset_fib (vat_main_t * vam) u8 is_ipv6 = 0; u8 vrf_id_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { if (unformat (i, "vrf %d", &vrf_id)) @@ -7553,9 +7600,8 @@ api_reset_fib (vat_main_t * vam) mp->is_ipv6 = is_ipv6; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7574,6 +7620,7 @@ api_dhcp_proxy_config (vat_main_t * vam) u8 v6_src_address_set = 0; ip4_address_t v4srcaddress; ip6_address_t v6srcaddress; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -7647,9 +7694,8 @@ api_dhcp_proxy_config (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7669,6 +7715,7 @@ api_dhcp_proxy_config_2 (vat_main_t * vam) u8 v6_src_address_set = 0; ip4_address_t v4srcaddress; ip6_address_t v6srcaddress; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -7745,9 +7792,8 @@ api_dhcp_proxy_config_2 (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7763,6 +7809,7 @@ api_dhcp_proxy_set_vss (vat_main_t * vam) u8 oui_set = 0; u32 fib_id; u8 fib_id_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7808,9 +7855,8 @@ api_dhcp_proxy_set_vss (vat_main_t * vam) mp->is_add = is_add; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7823,6 +7869,7 @@ api_dhcp_client_config (vat_main_t * vam) u8 is_add = 1; u8 *hostname = 0; u8 disable_event = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -7868,9 +7915,8 @@ api_dhcp_client_config (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7887,6 +7933,7 @@ api_set_ip_flow_hash (vat_main_t * vam) u8 dport = 0; u8 proto = 0; u8 reverse = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7931,9 +7978,8 @@ api_set_ip_flow_hash (vat_main_t * vam) mp->is_ipv6 = is_ipv6; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7944,6 +7990,7 @@ api_sw_interface_ip6_enable_disable (vat_main_t * vam) u32 sw_if_index; u8 sw_if_index_set = 0; u8 enable = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -7974,9 +8021,8 @@ api_sw_interface_ip6_enable_disable (vat_main_t * vam) mp->enable = enable; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -7988,6 +8034,7 @@ api_sw_interface_ip6_set_link_local_address (vat_main_t * vam) u8 sw_if_index_set = 0; u8 v6_address_set = 0; ip6_address_t v6address; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -8023,10 +8070,8 @@ api_sw_interface_ip6_set_link_local_address (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } @@ -8048,6 +8093,7 @@ api_sw_interface_ip6nd_ra_prefix (vat_main_t * vam) u8 is_no = 0; u32 val_lifetime = 0; u32 pref_lifetime = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -8112,10 +8158,8 @@ api_sw_interface_ip6nd_ra_prefix (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -8138,6 +8182,7 @@ api_sw_interface_ip6nd_ra_config (vat_main_t * vam) u32 lifetime = 0; u32 initial_count = 0; u32 initial_interval = 0; + int ret; /* Parse args required to build the message */ @@ -8208,10 +8253,8 @@ api_sw_interface_ip6nd_ra_config (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -8222,6 +8265,7 @@ api_set_arp_neighbor_limit (vat_main_t * vam) u32 arp_nbr_limit; u8 limit_set = 0; u8 is_ipv6 = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -8248,9 +8292,8 @@ api_set_arp_neighbor_limit (vat_main_t * vam) mp->is_ipv6 = is_ipv6; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -8263,6 +8306,7 @@ api_l2_patch_add_del (vat_main_t * vam) u32 tx_sw_if_index; u8 tx_sw_if_index_set = 0; u8 is_add = 1; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -8318,9 +8362,8 @@ api_l2_patch_add_del (vat_main_t * vam) mp->is_add = is_add; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -8333,6 +8376,7 @@ api_ioam_enable (vat_main_t * vam) int has_pot_option = 0; int has_seqno_option = 0; int has_analyse_option = 0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -8355,10 +8399,8 @@ api_ioam_enable (vat_main_t * vam) mp->trace_enable = has_trace_option; S (mp); - W; - - return (0); - + W (ret); + return ret; } @@ -8366,11 +8408,12 @@ static int api_ioam_disable (vat_main_t * vam) { vl_api_ioam_disable_t *mp; + int ret; M (IOAM_DISABLE, mp); S (mp); - W; - return 0; + W (ret); + return ret; } static int @@ -8395,6 +8438,7 @@ api_sr_tunnel_add_del (vat_main_t * vam) ip6_address_t next_address, tag; u8 *name = 0; u8 *policy_name = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -8501,8 +8545,8 @@ api_sr_tunnel_add_del (vat_main_t * vam) vec_free (tags); S (mp); - W; - /* NOTREACHED */ + W (ret); + return ret; } static int @@ -8520,6 +8564,7 @@ api_sr_policy_add_del (vat_main_t * vam) int j = 0; int tunnel_names_length = 1; // Init to 1 to offset the #tunnel_names counter byte int tun_name_len = 0; // Different naming convention used as confusing these would be "bad" (TM) + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -8584,8 +8629,8 @@ api_sr_policy_add_del (vat_main_t * vam) vec_free (tunnel_name); S (mp); - W; - /* NOTREACHED */ + W (ret); + return ret; } static int @@ -8597,6 +8642,7 @@ api_sr_multicast_map_add_del (vat_main_t * vam) ip6_address_t multicast_address; u8 *policy_name = 0; int multicast_address_set = 0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -8636,8 +8682,8 @@ api_sr_multicast_map_add_del (vat_main_t * vam) vec_free (policy_name); S (mp); - W; - /* NOTREACHED */ + W (ret); + return ret; } @@ -9267,6 +9313,7 @@ api_classify_add_del_table (vat_main_t * vam) u8 *mask = 0; u32 current_data_flag = 0; int current_data_offset = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -9351,8 +9398,8 @@ api_classify_add_del_table (vat_main_t * vam) vec_free (mask); S (mp); - W; - /* NOTREACHED */ + W (ret); + return ret; } uword @@ -9806,6 +9853,7 @@ api_classify_add_del_session (vat_main_t * vam) u32 match_n_vectors = 0; u32 action = 0; u32 metadata = 0; + int ret; /* * Warning: you have to supply skip_n and match_n @@ -9880,8 +9928,8 @@ api_classify_add_del_session (vat_main_t * vam) vec_free (match); S (mp); - W; - /* NOTREACHED */ + W (ret); + return ret; } static int @@ -9893,6 +9941,7 @@ api_classify_set_interface_ip_table (vat_main_t * vam) int sw_if_index_set; u32 table_index = ~0; u8 is_ipv6 = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -9923,9 +9972,8 @@ api_classify_set_interface_ip_table (vat_main_t * vam) mp->is_ipv6 = is_ipv6; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -9939,6 +9987,7 @@ api_classify_set_interface_l2_tables (vat_main_t * vam) u32 ip6_table_index = ~0; u32 other_table_index = ~0; u32 is_input = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -9977,9 +10026,8 @@ api_classify_set_interface_l2_tables (vat_main_t * vam) mp->is_input = (u8) is_input; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -9996,6 +10044,7 @@ api_set_ipfix_exporter (vat_main_t * vam) u32 path_mtu = ~0; u32 template_interval = ~0; u8 udp_checksum = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10043,8 +10092,8 @@ api_set_ipfix_exporter (vat_main_t * vam) mp->udp_checksum = udp_checksum; S (mp); - W; - /* NOTREACHED */ + W (ret); + return ret; } static int @@ -10054,6 +10103,7 @@ api_set_ipfix_classify_stream (vat_main_t * vam) vl_api_set_ipfix_classify_stream_t *mp; u32 domain_id = 0; u32 src_port = UDP_DST_PORT_ipfix; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10074,8 +10124,8 @@ api_set_ipfix_classify_stream (vat_main_t * vam) mp->src_port = htons ((u16) src_port); S (mp); - W; - /* NOTREACHED */ + W (ret); + return ret; } static int @@ -10087,6 +10137,7 @@ api_ipfix_classify_table_add_del (vat_main_t * vam) u32 classify_table_index = ~0; u8 ip_version = 0; u8 transport_protocol = 255; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10135,8 +10186,8 @@ api_ipfix_classify_table_add_del (vat_main_t * vam) mp->transport_protocol = transport_protocol; S (mp); - W; - /* NOTREACHED */ + W (ret); + return ret; } static int @@ -10145,6 +10196,7 @@ api_get_node_index (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_get_node_index_t *mp; u8 *name = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10169,9 +10221,8 @@ api_get_node_index (vat_main_t * vam) vec_free (name); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -10180,6 +10231,7 @@ api_get_next_index (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_get_next_index_t *mp; u8 *node_name = 0, *next_node_name = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10218,9 +10270,8 @@ api_get_next_index (vat_main_t * vam) vec_free (next_node_name); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -10230,6 +10281,7 @@ api_add_node_next (vat_main_t * vam) vl_api_add_node_next_t *mp; u8 *name = 0; u8 *next = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10268,9 +10320,8 @@ api_add_node_next (vat_main_t * vam) vec_free (next); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -10286,6 +10337,7 @@ api_l2tpv3_create_tunnel (vat_main_t * vam) u64 remote_cookie = 0; u8 l2_sublayer_present = 0; vl_api_l2tpv3_create_tunnel_t *mp; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10336,9 +10388,8 @@ api_l2tpv3_create_tunnel (vat_main_t * vam) mp->is_ipv6 = 1; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -10350,6 +10401,7 @@ api_l2tpv3_set_tunnel_cookies (vat_main_t * vam) u64 new_local_cookie = 0; u64 new_remote_cookie = 0; vl_api_l2tpv3_set_tunnel_cookies_t *mp; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10378,9 +10430,8 @@ api_l2tpv3_set_tunnel_cookies (vat_main_t * vam) mp->new_remote_cookie = clib_host_to_net_u64 (new_remote_cookie); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -10391,6 +10442,7 @@ api_l2tpv3_interface_enable_disable (vat_main_t * vam) u32 sw_if_index; u8 sw_if_index_set = 0; u8 enable_disable = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10418,9 +10470,8 @@ api_l2tpv3_interface_enable_disable (vat_main_t * vam) mp->enable_disable = enable_disable; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -10429,6 +10480,7 @@ api_l2tpv3_set_lookup_key (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_l2tpv3_set_lookup_key_t *mp; u8 key = ~0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -10453,9 +10505,8 @@ api_l2tpv3_set_lookup_key (vat_main_t * vam) mp->key = key; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_sw_if_l2tpv3_tunnel_details_t_handler @@ -10525,6 +10576,7 @@ static int api_sw_if_l2tpv3_tunnel_dump (vat_main_t * vam) { vl_api_sw_if_l2tpv3_tunnel_dump_t *mp; + int ret; /* Get list of l2tpv3-tunnel interfaces */ M (SW_IF_L2TPV3_TUNNEL_DUMP, mp); @@ -10536,7 +10588,8 @@ api_sw_if_l2tpv3_tunnel_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } @@ -10571,6 +10624,7 @@ static int api_sw_interface_tap_dump (vat_main_t * vam) { vl_api_sw_interface_tap_dump_t *mp; + int ret; print (vam->ofp, "\n%-16s %s", "dev_name", "sw_if_index"); /* Get list of tap interfaces */ @@ -10583,7 +10637,8 @@ api_sw_interface_tap_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static uword unformat_vxlan_decap_next @@ -10616,6 +10671,7 @@ api_vxlan_add_del_tunnel (vat_main_t * vam) u32 encap_vrf_id = 0; u32 decap_next_index = ~0; u32 vni = 0; + int ret; /* Can't "universally zero init" (={0}) due to GCC bug 53119 */ memset (&src, 0, sizeof src); @@ -10752,9 +10808,8 @@ api_vxlan_add_del_tunnel (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_vxlan_tunnel_details_t_handler @@ -10824,6 +10879,7 @@ api_vxlan_tunnel_dump (vat_main_t * vam) vl_api_vxlan_tunnel_dump_t *mp; u32 sw_if_index; u8 sw_if_index_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -10859,7 +10915,8 @@ api_vxlan_tunnel_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static int @@ -10873,6 +10930,7 @@ api_gre_add_del_tunnel (vat_main_t * vam) u8 src_set = 0; u8 dst_set = 0; u32 outer_fib_id = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { @@ -10914,9 +10972,8 @@ api_gre_add_del_tunnel (vat_main_t * vam) mp->teb = teb; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_gre_tunnel_details_t_handler @@ -10962,6 +11019,7 @@ api_gre_tunnel_dump (vat_main_t * vam) vl_api_gre_tunnel_dump_t *mp; u32 sw_if_index; u8 sw_if_index_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -10997,7 +11055,8 @@ api_gre_tunnel_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static int @@ -11005,13 +11064,13 @@ api_l2_fib_clear_table (vat_main_t * vam) { // unformat_input_t * i = vam->input; vl_api_l2_fib_clear_table_t *mp; + int ret; M (L2_FIB_CLEAR_TABLE, mp); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -11022,6 +11081,7 @@ api_l2_interface_efp_filter (vat_main_t * vam) u32 sw_if_index; u8 enable = 1; u8 sw_if_index_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -11052,9 +11112,8 @@ api_l2_interface_efp_filter (vat_main_t * vam) mp->enable_disable = enable; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } #define foreach_vtr_op \ @@ -11080,6 +11139,7 @@ api_l2_interface_vlan_tag_rewrite (vat_main_t * vam) u32 push_dot1q = 1; u32 tag1 = ~0; u32 tag2 = ~0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -11119,9 +11179,8 @@ api_l2_interface_vlan_tag_rewrite (vat_main_t * vam) mp->tag2 = ntohl (tag2); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -11136,6 +11195,7 @@ api_create_vhost_user_if (vat_main_t * vam) u8 hwaddr[6]; u8 use_custom_mac = 0; u8 *tag = 0; + int ret; /* Shut up coverity */ memset (hwaddr, 0, sizeof (hwaddr)); @@ -11188,9 +11248,8 @@ api_create_vhost_user_if (vat_main_t * vam) vec_free (tag); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -11204,6 +11263,7 @@ api_modify_vhost_user_if (vat_main_t * vam) u32 custom_dev_instance = ~0; u8 sw_if_index_set = 0; u32 sw_if_index = (u32) ~ 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -11255,9 +11315,8 @@ api_modify_vhost_user_if (vat_main_t * vam) } S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -11267,6 +11326,7 @@ api_delete_vhost_user_if (vat_main_t * vam) vl_api_delete_vhost_user_if_t *mp; u32 sw_if_index = ~0; u8 sw_if_index_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -11290,9 +11350,8 @@ api_delete_vhost_user_if (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_sw_interface_vhost_user_details_t_handler @@ -11339,6 +11398,7 @@ static int api_sw_interface_vhost_user_dump (vat_main_t * vam) { vl_api_sw_interface_vhost_user_dump_t *mp; + int ret; print (vam->ofp, "Interface name idx hdr_sz features server regions filename"); @@ -11352,20 +11412,21 @@ api_sw_interface_vhost_user_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static int api_show_version (vat_main_t * vam) { vl_api_show_version_t *mp; + int ret; M (SHOW_VERSION, mp); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } @@ -11385,6 +11446,7 @@ api_vxlan_gpe_add_del_tunnel (vat_main_t * vam) u8 protocol = ~0; u32 vni; u8 vni_set = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { @@ -11479,9 +11541,8 @@ api_vxlan_gpe_add_del_tunnel (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_vxlan_gpe_tunnel_details_t_handler @@ -11543,6 +11604,7 @@ api_vxlan_gpe_tunnel_dump (vat_main_t * vam) vl_api_vxlan_gpe_tunnel_dump_t *mp; u32 sw_if_index; u8 sw_if_index_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -11578,7 +11640,8 @@ api_vxlan_gpe_tunnel_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } u8 * @@ -11631,6 +11694,7 @@ api_l2_fib_table_dump (vat_main_t * vam) vl_api_l2_fib_table_dump_t *mp; u32 bd_id; u8 bd_id_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -11661,7 +11725,8 @@ api_l2_fib_table_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } @@ -11672,6 +11737,7 @@ api_interface_name_renumber (vat_main_t * vam) vl_api_interface_name_renumber_t *mp; u32 sw_if_index = ~0; u32 new_show_dev_instance = ~0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { @@ -11705,7 +11771,8 @@ api_interface_name_renumber (vat_main_t * vam) mp->new_show_dev_instance = ntohl (new_show_dev_instance); S (mp); - W; + W (ret); + return ret; } static int @@ -11716,6 +11783,7 @@ api_want_ip4_arp_events (vat_main_t * vam) ip4_address_t address; int address_set = 0; u32 enable_disable = 1; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { @@ -11739,7 +11807,8 @@ api_want_ip4_arp_events (vat_main_t * vam) mp->address = address.as_u32; S (mp); - W; + W (ret); + return ret; } static int @@ -11750,6 +11819,7 @@ api_want_ip6_nd_events (vat_main_t * vam) ip6_address_t address; int address_set = 0; u32 enable_disable = 1; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { @@ -11773,7 +11843,8 @@ api_want_ip6_nd_events (vat_main_t * vam) clib_memcpy (mp->address, &address, sizeof (ip6_address_t)); S (mp); - W; + W (ret); + return ret; } static int @@ -11787,6 +11858,7 @@ api_input_acl_set_interface (vat_main_t * vam) u32 ip6_table_index = ~0; u32 l2_table_index = ~0; u8 is_add = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -11824,9 +11896,8 @@ api_input_acl_set_interface (vat_main_t * vam) mp->is_add = is_add; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -11838,6 +11909,7 @@ api_ip_address_dump (vat_main_t * vam) u8 sw_if_index_set = 0; u8 ipv4_set = 0; u8 ipv6_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -11886,7 +11958,8 @@ api_ip_address_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static int @@ -11898,6 +11971,7 @@ api_ip_dump (vat_main_t * vam) int ipv6_set = 0; int is_ipv6; int i; + int ret; while (unformat_check_input (in) != UNFORMAT_END_OF_INPUT) { @@ -11941,7 +12015,8 @@ api_ip_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static int @@ -11951,6 +12026,7 @@ api_ipsec_spd_add_del (vat_main_t * vam) vl_api_ipsec_spd_add_del_t *mp; u32 spd_id = ~0; u8 is_add = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -11976,9 +12052,8 @@ api_ipsec_spd_add_del (vat_main_t * vam) mp->is_add = is_add; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -11990,6 +12065,7 @@ api_ipsec_interface_add_del_spd (vat_main_t * vam) u8 sw_if_index_set = 0; u32 spd_id = (u32) ~ 0; u8 is_add = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -12029,9 +12105,8 @@ api_ipsec_interface_add_del_spd (vat_main_t * vam) mp->is_add = is_add; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -12046,6 +12121,7 @@ api_ipsec_spd_add_del_entry (vat_main_t * vam) u32 lport_start = 0, lport_stop = (u32) ~ 0; ip4_address_t laddr4_start, laddr4_stop, raddr4_start, raddr4_stop; ip6_address_t laddr6_start, laddr6_stop, raddr6_start, raddr6_stop; + int ret; laddr4_start.as_u32 = raddr4_start.as_u32 = 0; laddr4_stop.as_u32 = raddr4_stop.as_u32 = (u32) ~ 0; @@ -12186,9 +12262,8 @@ api_ipsec_spd_add_del_entry (vat_main_t * vam) mp->is_add = is_add; mp->is_ip_any = is_ip_any; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -12207,6 +12282,7 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam) ip4_address_t tun_dst4; ip6_address_t tun_src6; ip6_address_t tun_dst6; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -12317,9 +12393,8 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam) } S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -12329,6 +12404,7 @@ api_ipsec_sa_set_key (vat_main_t * vam) vl_api_ipsec_sa_set_key_t *mp; u32 sa_id; u8 *ck = 0, *ik = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -12363,9 +12439,8 @@ api_ipsec_sa_set_key (vat_main_t * vam) clib_memcpy (mp->integrity_key, ik, mp->integrity_key_length); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -12375,6 +12450,7 @@ api_ikev2_profile_add_del (vat_main_t * vam) vl_api_ikev2_profile_add_del_t *mp; u8 is_add = 1; u8 *name = 0; + int ret; const char *valid_chars = "a-zA-Z0-9_"; @@ -12410,9 +12486,8 @@ api_ikev2_profile_add_del (vat_main_t * vam) vec_free (name); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -12424,6 +12499,7 @@ api_ikev2_profile_set_auth (vat_main_t * vam) u8 *data = 0; u32 auth_method = 0; u8 is_hex = 0; + int ret; const char *valid_chars = "a-zA-Z0-9_"; @@ -12480,9 +12556,8 @@ api_ikev2_profile_set_auth (vat_main_t * vam) vec_free (data); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -12495,6 +12570,7 @@ api_ikev2_profile_set_id (vat_main_t * vam) u8 is_local = 0; u32 id_type = 0; ip4_address_t ip4; + int ret; const char *valid_chars = "a-zA-Z0-9_"; @@ -12559,9 +12635,8 @@ api_ikev2_profile_set_id (vat_main_t * vam) vec_free (data); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -12575,6 +12650,7 @@ api_ikev2_profile_set_ts (vat_main_t * vam) ip4_address_t start_addr, end_addr; const char *valid_chars = "a-zA-Z0-9_"; + int ret; start_addr.as_u32 = 0; end_addr.as_u32 = (u32) ~ 0; @@ -12629,9 +12705,8 @@ api_ikev2_profile_set_ts (vat_main_t * vam) vec_free (name); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -12640,6 +12715,7 @@ api_ikev2_set_local_key (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_ikev2_set_local_key_t *mp; u8 *file = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -12670,9 +12746,8 @@ api_ikev2_set_local_key (vat_main_t * vam) vec_free (file); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } /* @@ -12693,6 +12768,7 @@ api_map_add_domain (vat_main_t * vam) u8 is_translation = 0; u32 mtu = 0; u32 ip6_src_len = 128; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -12754,7 +12830,8 @@ api_map_add_domain (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; + W (ret); + return ret; } static int @@ -12765,6 +12842,7 @@ api_map_del_domain (vat_main_t * vam) u32 num_m_args = 0; u32 index; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -12792,7 +12870,8 @@ api_map_del_domain (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; + W (ret); + return ret; } static int @@ -12803,6 +12882,7 @@ api_map_add_del_rule (vat_main_t * vam) u8 is_add = 1; ip6_address_t ip6_dst; u32 num_m_args = 0, index, psid = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -12835,13 +12915,15 @@ api_map_add_del_rule (vat_main_t * vam) S (mp); /* Wait for a reply, return good/bad news */ - W; + W (ret); + return ret; } static int api_map_domain_dump (vat_main_t * vam) { vl_api_map_domain_dump_t *mp; + int ret; /* Construct the API message */ M (MAP_DOMAIN_DUMP, mp); @@ -12855,7 +12937,8 @@ api_map_domain_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static int @@ -12864,6 +12947,7 @@ api_map_rule_dump (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_map_rule_dump_t *mp; u32 domain_index = ~0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -12893,7 +12977,8 @@ api_map_rule_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static void vl_api_map_add_domain_reply_t_handler @@ -12937,6 +13022,7 @@ api_get_first_msg_id (vat_main_t * vam) unformat_input_t *i = vam->input; u8 *name; u8 name_set = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -12962,9 +13048,8 @@ api_get_first_msg_id (vat_main_t * vam) M (GET_FIRST_MSG_ID, mp); clib_memcpy (mp->name, name, vec_len (name)); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -12974,6 +13059,7 @@ api_cop_interface_enable_disable (vat_main_t * vam) vl_api_cop_interface_enable_disable_t *mp; u32 sw_if_index = ~0; u8 enable_disable = 1; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { @@ -13004,7 +13090,8 @@ api_cop_interface_enable_disable (vat_main_t * vam) /* send it... */ S (mp); /* Wait for the reply */ - W; + W (ret); + return ret; } static int @@ -13015,6 +13102,7 @@ api_cop_whitelist_enable_disable (vat_main_t * vam) u32 sw_if_index = ~0; u8 ip4 = 0, ip6 = 0, default_cop = 0; u32 fib_id = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { @@ -13052,20 +13140,23 @@ api_cop_whitelist_enable_disable (vat_main_t * vam) /* send it... */ S (mp); /* Wait for the reply */ - W; + W (ret); + return ret; } static int api_get_node_graph (vat_main_t * vam) { vl_api_get_node_graph_t *mp; + int ret; M (GET_NODE_GRAPH, mp); /* send it... */ S (mp); /* Wait for the reply */ - W; + W (ret); + return ret; } /* *INDENT-OFF* */ @@ -13142,6 +13233,7 @@ api_lisp_add_del_locator_set (vat_main_t * vam) u32 sw_if_index, priority, weight; u32 data_len = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -13210,10 +13302,8 @@ api_lisp_add_del_locator_set (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -13232,6 +13322,7 @@ api_lisp_add_del_locator (vat_main_t * vam) u8 is_add = 1; u8 *locator_set_name = NULL; u8 locator_set_name_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -13324,10 +13415,8 @@ api_lisp_add_del_locator (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } uword @@ -13368,6 +13457,7 @@ api_lisp_add_del_local_eid (vat_main_t * vam) u32 vni = 0; u16 key_id = 0; u8 *key = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -13450,10 +13540,8 @@ api_lisp_add_del_local_eid (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } /* *INDENT-OFF* */ @@ -13482,6 +13570,7 @@ api_lisp_gpe_add_del_fwd_entry (vat_main_t * vam) ip6_address_t rmt_rloc6, lcl_rloc6; vl_api_lisp_gpe_locator_t *rmt_locs = 0, *lcl_locs = 0, rloc, *curr_rloc = 0; + int ret; memset (&rloc, 0, sizeof (rloc)); @@ -13602,10 +13691,8 @@ api_lisp_gpe_add_del_fwd_entry (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -13618,6 +13705,7 @@ api_lisp_add_del_map_server (vat_main_t * vam) u8 ipv6_set = 0; ip4_address_t ipv4; ip6_address_t ipv6; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -13669,10 +13757,8 @@ api_lisp_add_del_map_server (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -13685,6 +13771,7 @@ api_lisp_add_del_map_resolver (vat_main_t * vam) u8 ipv6_set = 0; ip4_address_t ipv4; ip6_address_t ipv6; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -13736,10 +13823,8 @@ api_lisp_add_del_map_resolver (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -13749,6 +13834,7 @@ api_lisp_gpe_enable_disable (vat_main_t * vam) vl_api_lisp_gpe_enable_disable_t *mp; u8 is_set = 0; u8 is_en = 1; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -13782,10 +13868,8 @@ api_lisp_gpe_enable_disable (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -13795,6 +13879,7 @@ api_lisp_rloc_probe_enable_disable (vat_main_t * vam) vl_api_lisp_rloc_probe_enable_disable_t *mp; u8 is_set = 0; u8 is_en = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -13825,10 +13910,8 @@ api_lisp_rloc_probe_enable_disable (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -13838,6 +13921,7 @@ api_lisp_map_register_enable_disable (vat_main_t * vam) vl_api_lisp_map_register_enable_disable_t *mp; u8 is_set = 0; u8 is_en = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -13868,10 +13952,8 @@ api_lisp_map_register_enable_disable (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -13881,6 +13963,7 @@ api_lisp_enable_disable (vat_main_t * vam) vl_api_lisp_enable_disable_t *mp; u8 is_set = 0; u8 is_en = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -13913,16 +13996,15 @@ api_lisp_enable_disable (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_show_lisp_map_register_state (vat_main_t * vam) { vl_api_show_lisp_map_register_state_t *mp; + int ret; M (SHOW_LISP_MAP_REGISTER_STATE, mp); @@ -13930,15 +14012,15 @@ api_show_lisp_map_register_state (vat_main_t * vam) S (mp); /* wait for reply */ - W; - - return 0; + W (ret); + return ret; } static int api_show_lisp_rloc_probe_state (vat_main_t * vam) { vl_api_show_lisp_rloc_probe_state_t *mp; + int ret; M (SHOW_LISP_RLOC_PROBE_STATE, mp); @@ -13946,15 +14028,15 @@ api_show_lisp_rloc_probe_state (vat_main_t * vam) S (mp); /* wait for reply */ - W; - - return 0; + W (ret); + return ret; } static int api_show_lisp_map_request_mode (vat_main_t * vam) { vl_api_show_lisp_map_request_mode_t *mp; + int ret; M (SHOW_LISP_MAP_REQUEST_MODE, mp); @@ -13962,9 +14044,8 @@ api_show_lisp_map_request_mode (vat_main_t * vam) S (mp); /* wait for reply */ - W; - - return 0; + W (ret); + return ret; } static int @@ -13973,6 +14054,7 @@ api_lisp_map_request_mode (vat_main_t * vam) unformat_input_t *input = vam->input; vl_api_lisp_map_request_mode_t *mp; u8 mode = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -13996,10 +14078,8 @@ api_lisp_map_request_mode (vat_main_t * vam) S (mp); /* wait for reply */ - W; - - /* notreached */ - return 0; + W (ret); + return ret; } /** @@ -14016,6 +14096,7 @@ api_lisp_pitr_set_locator_set (vat_main_t * vam) vl_api_lisp_pitr_set_locator_set_t *mp; u8 is_add = 1; u8 *ls_name = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -14047,16 +14128,15 @@ api_lisp_pitr_set_locator_set (vat_main_t * vam) S (mp); /* wait for reply */ - W; - - /* notreached */ - return 0; + W (ret); + return ret; } static int api_show_lisp_pitr (vat_main_t * vam) { vl_api_show_lisp_pitr_t *mp; + int ret; if (!vam->json_output) { @@ -14068,10 +14148,8 @@ api_show_lisp_pitr (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } /** @@ -14084,6 +14162,7 @@ api_lisp_eid_table_add_del_map (vat_main_t * vam) vl_api_lisp_eid_table_add_del_map_t *mp; u8 is_add = 1, vni_set = 0, vrf_set = 0, bd_index_set = 0; u32 vni, vrf, bd_index; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -14123,10 +14202,8 @@ api_lisp_eid_table_add_del_map (vat_main_t * vam) S (mp); /* wait for reply */ - W; - - /* notreached */ - return 0; + W (ret); + return ret; } uword @@ -14177,6 +14254,7 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam) ip4_address_t rloc4; ip6_address_t rloc6; vl_api_remote_locator_t *rlocs = 0, rloc, *curr_rloc = 0; + int ret; memset (&rloc, 0, sizeof (rloc)); @@ -14277,10 +14355,8 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } /** @@ -14303,6 +14379,7 @@ api_lisp_add_del_adjacency (vat_main_t * vam) u8 reid_type, leid_type; u32 leid_len = 0, reid_len = 0, len; u8 is_add = 1; + int ret; leid_type = reid_type = (u8) ~ 0; @@ -14404,10 +14481,8 @@ api_lisp_add_del_adjacency (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -14417,6 +14492,7 @@ api_lisp_gpe_add_del_iface (vat_main_t * vam) vl_api_lisp_gpe_add_del_iface_t *mp; u8 action_set = 0, is_add = 1, is_l2 = 0, dp_table_set = 0, vni_set = 0; u32 dp_table = 0, vni = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -14471,10 +14547,8 @@ api_lisp_gpe_add_del_iface (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } /** @@ -14491,6 +14565,7 @@ api_lisp_add_del_map_request_itr_rlocs (vat_main_t * vam) u8 *locator_set_name = 0; u8 locator_set_name_set = 0; u8 is_add = 1; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -14540,10 +14615,8 @@ api_lisp_add_del_map_request_itr_rlocs (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -14554,6 +14627,7 @@ api_lisp_locator_dump (vat_main_t * vam) u8 is_index_set = 0, is_name_set = 0; u8 *ls_name = 0; u32 ls_index = ~0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -14618,10 +14692,8 @@ api_lisp_locator_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -14630,6 +14702,7 @@ api_lisp_locator_set_dump (vat_main_t * vam) vl_api_lisp_locator_set_dump_t *mp; unformat_input_t *input = vam->input; u8 filter = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -14668,10 +14741,8 @@ api_lisp_locator_set_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -14681,6 +14752,7 @@ api_lisp_eid_table_map_dump (vat_main_t * vam) u8 mode_set = 0; unformat_input_t *input = vam->input; vl_api_lisp_eid_table_map_dump_t *mp; + int ret; /* Parse args required to build the message */ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -14726,16 +14798,15 @@ api_lisp_eid_table_map_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_lisp_eid_table_vni_dump (vat_main_t * vam) { vl_api_lisp_eid_table_vni_dump_t *mp; + int ret; if (!vam->json_output) { @@ -14754,10 +14825,8 @@ api_lisp_eid_table_vni_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -14771,6 +14840,7 @@ api_lisp_eid_table_dump (vat_main_t * vam) u8 eid_type = ~0, eid_set = 0; u32 prefix_length = ~0, t, vni = 0; u8 filter = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -14854,10 +14924,8 @@ api_lisp_eid_table_dump (vat_main_t * vam) } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -14867,6 +14935,7 @@ api_lisp_gpe_fwd_entries_get (vat_main_t * vam) vl_api_lisp_gpe_fwd_entries_get_t *mp; u8 vni_set = 0; u32 vni = ~0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -14900,10 +14969,8 @@ api_lisp_gpe_fwd_entries_get (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } #define vl_api_lisp_gpe_fwd_entries_get_reply_t_endian vl_noop_handler @@ -14918,6 +14985,7 @@ api_lisp_adjacencies_get (vat_main_t * vam) vl_api_lisp_adjacencies_get_t *mp; u8 vni_set = 0; u32 vni = ~0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -14950,16 +15018,15 @@ api_lisp_adjacencies_get (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_lisp_map_server_dump (vat_main_t * vam) { vl_api_lisp_map_server_dump_t *mp; + int ret; if (!vam->json_output) { @@ -14977,16 +15044,15 @@ api_lisp_map_server_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_lisp_map_resolver_dump (vat_main_t * vam) { vl_api_lisp_map_resolver_dump_t *mp; + int ret; if (!vam->json_output) { @@ -15004,16 +15070,15 @@ api_lisp_map_resolver_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_show_lisp_status (vat_main_t * vam) { vl_api_show_lisp_status_t *mp; + int ret; if (!vam->json_output) { @@ -15024,10 +15089,8 @@ api_show_lisp_status (vat_main_t * vam) /* send it... */ S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -15036,6 +15099,7 @@ api_lisp_gpe_fwd_entry_path_dump (vat_main_t * vam) vl_api_lisp_gpe_fwd_entry_path_dump_t *mp; unformat_input_t *i = vam->input; u32 fwd_entry_index = ~0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -15067,16 +15131,15 @@ api_lisp_gpe_fwd_entry_path_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_lisp_get_map_request_itr_rlocs (vat_main_t * vam) { vl_api_lisp_get_map_request_itr_rlocs_t *mp; + int ret; if (!vam->json_output) { @@ -15087,10 +15150,8 @@ api_lisp_get_map_request_itr_rlocs (vat_main_t * vam) /* send it... */ S (mp); /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -15101,6 +15162,7 @@ api_af_packet_create (vat_main_t * vam) u8 *host_if_name = 0; u8 hw_addr[6]; u8 random_hw_addr = 1; + int ret; memset (hw_addr, 0, sizeof (hw_addr)); @@ -15134,9 +15196,8 @@ api_af_packet_create (vat_main_t * vam) vec_free (host_if_name); S (mp); - W2 (fprintf (vam->ofp, " new sw_if_index = %d ", vam->sw_if_index)); - /* NOTREACHED */ - return 0; + W2 (ret, fprintf (vam->ofp, " new sw_if_index = %d ", vam->sw_if_index)); + return ret; } static int @@ -15145,6 +15206,7 @@ api_af_packet_delete (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_af_packet_delete_t *mp; u8 *host_if_name = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -15172,9 +15234,8 @@ api_af_packet_delete (vat_main_t * vam) vec_free (host_if_name); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -15193,6 +15254,7 @@ api_policer_add_del (vat_main_t * vam) u8 type = 0; u8 color_aware = 0; sse2_qos_pol_action_params_st conform_action, exceed_action, violate_action; + int ret; conform_action.action_type = SSE2_QOS_ACTION_TRANSMIT; conform_action.dscp = 0; @@ -15271,9 +15333,8 @@ api_policer_add_del (vat_main_t * vam) mp->color_aware = color_aware; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -15283,6 +15344,7 @@ api_policer_dump (vat_main_t * vam) vl_api_policer_dump_t *mp; u8 *match_name = 0; u8 match_name_valid = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -15309,10 +15371,8 @@ api_policer_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -15326,6 +15386,7 @@ api_policer_classify_set_interface (vat_main_t * vam) u32 ip6_table_index = ~0; u32 l2_table_index = ~0; u8 is_add = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -15363,9 +15424,8 @@ api_policer_classify_set_interface (vat_main_t * vam) mp->is_add = is_add; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -15374,6 +15434,7 @@ api_policer_classify_dump (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_policer_classify_dump_t *mp; u8 type = POLICER_CLASSIFY_N_TABLES; + int ret; if (unformat (i, "type %U", unformat_policer_classify_table_type, &type)) ; @@ -15400,10 +15461,8 @@ api_policer_classify_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -15416,6 +15475,7 @@ api_netmap_create (vat_main_t * vam) u8 random_hw_addr = 1; u8 is_pipe = 0; u8 is_master = 0; + int ret; memset (hw_addr, 0, sizeof (hw_addr)); @@ -15457,9 +15517,8 @@ api_netmap_create (vat_main_t * vam) vec_free (if_name); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -15468,6 +15527,7 @@ api_netmap_delete (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_netmap_delete_t *mp; u8 *if_name = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -15495,9 +15555,8 @@ api_netmap_delete (vat_main_t * vam) vec_free (if_name); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_mpls_tunnel_details_t_handler @@ -15554,6 +15613,7 @@ api_mpls_tunnel_dump (vat_main_t * vam) { vl_api_mpls_tunnel_dump_t *mp; i32 index = -1; + int ret; /* Parse args required to build the message */ while (unformat_check_input (vam->input) != UNFORMAT_END_OF_INPUT) @@ -15577,7 +15637,8 @@ api_mpls_tunnel_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } #define vl_api_mpls_fib_details_t_endian vl_noop_handler @@ -15665,6 +15726,7 @@ static int api_mpls_fib_dump (vat_main_t * vam) { vl_api_mpls_fib_dump_t *mp; + int ret; M (MPLS_FIB_DUMP, mp); S (mp); @@ -15675,7 +15737,8 @@ api_mpls_fib_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } #define vl_api_ip_fib_details_t_endian vl_noop_handler @@ -15765,6 +15828,7 @@ static int api_ip_fib_dump (vat_main_t * vam) { vl_api_ip_fib_dump_t *mp; + int ret; M (IP_FIB_DUMP, mp); S (mp); @@ -15775,7 +15839,8 @@ api_ip_fib_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static void vl_api_ip_neighbor_details_t_handler @@ -15834,6 +15899,7 @@ api_ip_neighbor_dump (vat_main_t * vam) vl_api_ip_neighbor_dump_t *mp; u8 is_ipv6 = 0; u32 sw_if_index = ~0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -15865,7 +15931,8 @@ api_ip_neighbor_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } #define vl_api_ip6_fib_details_t_endian vl_noop_handler @@ -15955,6 +16022,7 @@ static int api_ip6_fib_dump (vat_main_t * vam) { vl_api_ip6_fib_dump_t *mp; + int ret; M (IP6_FIB_DUMP, mp); S (mp); @@ -15965,22 +16033,23 @@ api_ip6_fib_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } int api_classify_table_ids (vat_main_t * vam) { vl_api_classify_table_ids_t *mp; + int ret; /* Construct the API message */ M (CLASSIFY_TABLE_IDS, mp); mp->context = 0; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } int @@ -15990,6 +16059,7 @@ api_classify_table_by_interface (vat_main_t * vam) vl_api_classify_table_by_interface_t *mp; u32 sw_if_index = ~0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "%U", api_unformat_sw_if_index, vam, &sw_if_index)) @@ -16011,9 +16081,8 @@ api_classify_table_by_interface (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } int @@ -16023,6 +16092,7 @@ api_classify_table_info (vat_main_t * vam) vl_api_classify_table_info_t *mp; u32 table_id = ~0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "table_id %d", &table_id)) @@ -16042,9 +16112,8 @@ api_classify_table_info (vat_main_t * vam) mp->table_id = ntohl (table_id); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } int @@ -16054,6 +16123,7 @@ api_classify_session_dump (vat_main_t * vam) vl_api_classify_session_dump_t *mp; u32 table_id = ~0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "table_id %d", &table_id)) @@ -16079,9 +16149,8 @@ api_classify_session_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void @@ -16135,28 +16204,30 @@ int api_ipfix_exporter_dump (vat_main_t * vam) { vl_api_ipfix_exporter_dump_t *mp; + int ret; /* Construct the API message */ M (IPFIX_EXPORTER_DUMP, mp); mp->context = 0; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int api_ipfix_classify_stream_dump (vat_main_t * vam) { vl_api_ipfix_classify_stream_dump_t *mp; + int ret; /* Construct the API message */ M (IPFIX_CLASSIFY_STREAM_DUMP, mp); mp->context = 0; S (mp); - W; + W (ret); + return ret; /* NOTREACHED */ return 0; } @@ -16193,6 +16264,7 @@ static int api_ipfix_classify_table_dump (vat_main_t * vam) { vl_api_ipfix_classify_table_dump_t *mp; + int ret; if (!vam->json_output) { @@ -16212,7 +16284,8 @@ api_ipfix_classify_table_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static void @@ -16254,6 +16327,7 @@ api_sw_interface_span_enable_disable (vat_main_t * vam) u32 src_sw_if_index = ~0; u32 dst_sw_if_index = ~0; u8 state = 3; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -16287,9 +16361,8 @@ api_sw_interface_span_enable_disable (vat_main_t * vam) mp->state = state; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void @@ -16377,6 +16450,7 @@ static int api_sw_interface_span_dump (vat_main_t * vam) { vl_api_sw_interface_span_dump_t *mp; + int ret; M (SW_INTERFACE_SPAN_DUMP, mp); S (mp); @@ -16387,7 +16461,8 @@ api_sw_interface_span_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } int @@ -16397,6 +16472,7 @@ api_pg_create_interface (vat_main_t * vam) vl_api_pg_create_interface_t *mp; u32 if_id = ~0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "if_id %d", &if_id)) @@ -16416,9 +16492,8 @@ api_pg_create_interface (vat_main_t * vam) mp->interface_id = ntohl (if_id); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } int @@ -16432,6 +16507,7 @@ api_pg_capture (vat_main_t * vam) u32 count = 1; u8 pcap_file_set = 0; u8 *pcap_file = 0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "if_id %d", &if_id)) @@ -16474,9 +16550,8 @@ api_pg_capture (vat_main_t * vam) vec_free (pcap_file); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } int @@ -16488,6 +16563,7 @@ api_pg_enable_disable (vat_main_t * vam) u8 enable = 1; u8 stream_name_set = 0; u8 *stream_name = 0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "stream %s", &stream_name)) @@ -16520,9 +16596,8 @@ api_pg_enable_disable (vat_main_t * vam) vec_free (stream_name); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } int @@ -16543,6 +16618,7 @@ api_ip_source_and_port_range_check_add_del (vat_main_t * vam) u32 vrf_id = ~0; u8 is_add = 1; u8 is_ipv6 = 0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -16650,9 +16726,8 @@ api_ip_source_and_port_range_check_add_del (vat_main_t * vam) mp->vrf_id = ntohl (vrf_id); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } int @@ -16665,6 +16740,7 @@ api_ip_source_and_port_range_check_interface_add_del (vat_main_t * vam) u32 tcp_out_vrf_id = ~0, udp_out_vrf_id = ~0; u32 tcp_in_vrf_id = ~0, udp_in_vrf_id = ~0; u8 is_add = 1; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -16720,7 +16796,8 @@ api_ip_source_and_port_range_check_interface_add_del (vat_main_t * vam) S (mp); /* Wait for a reply... */ - W; + W (ret); + return ret; } static int @@ -16733,6 +16810,7 @@ api_ipsec_gre_add_del_tunnel (vat_main_t * vam) ip4_address_t src_address; ip4_address_t dst_address; u8 is_add = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -16762,9 +16840,8 @@ api_ipsec_gre_add_del_tunnel (vat_main_t * vam) mp->is_add = is_add; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -16776,6 +16853,7 @@ api_punt (vat_main_t * vam) u32 protocol = ~0; u32 port = ~0; int is_add = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -16802,9 +16880,8 @@ api_punt (vat_main_t * vam) mp->l4_port = htons ((u16) port); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static void vl_api_ipsec_gre_tunnel_details_t_handler @@ -16850,6 +16927,7 @@ api_ipsec_gre_tunnel_dump (vat_main_t * vam) vl_api_ipsec_gre_tunnel_dump_t *mp; u32 sw_if_index; u8 sw_if_index_set = 0; + int ret; /* Parse args required to build the message */ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) @@ -16885,7 +16963,8 @@ api_ipsec_gre_tunnel_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static int @@ -16894,6 +16973,7 @@ api_delete_subif (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_delete_subif_t *mp; u32 sw_if_index = ~0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -16916,7 +16996,8 @@ api_delete_subif (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); S (mp); - W; + W (ret); + return ret; } #define foreach_pbb_vtr_op \ @@ -16936,6 +17017,7 @@ api_l2_interface_pbb_tag_rewrite (vat_main_t * vam) u16 vlanid = 0; u32 sid = ~0; u32 tmp; + int ret; /* Shut up coverity */ memset (dmac, 0, sizeof (dmac)); @@ -17004,9 +17086,8 @@ api_l2_interface_pbb_tag_rewrite (vat_main_t * vam) mp->i_sid = ntohl (sid); S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -17019,6 +17100,7 @@ api_flow_classify_set_interface (vat_main_t * vam) u32 ip4_table_index = ~0; u32 ip6_table_index = ~0; u8 is_add = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -17053,9 +17135,8 @@ api_flow_classify_set_interface (vat_main_t * vam) mp->is_add = is_add; S (mp); - W; - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -17064,6 +17145,7 @@ api_flow_classify_dump (vat_main_t * vam) unformat_input_t *i = vam->input; vl_api_flow_classify_dump_t *mp; u8 type = FLOW_CLASSIFY_N_TABLES; + int ret; if (unformat (i, "type %U", unformat_flow_classify_table_type, &type)) ; @@ -17090,10 +17172,8 @@ api_flow_classify_dump (vat_main_t * vam) S (mp); } /* Wait for a reply... */ - W; - - /* NOTREACHED */ - return 0; + W (ret); + return ret; } static int @@ -17105,6 +17185,7 @@ api_feature_enable_disable (vat_main_t * vam) u8 *feature_name = 0; u32 sw_if_index = ~0; u8 enable = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -17159,7 +17240,8 @@ api_feature_enable_disable (vat_main_t * vam) vec_free (feature_name); S (mp); - W; + W (ret); + return ret; } static int @@ -17170,6 +17252,7 @@ api_sw_interface_tag_add_del (vat_main_t * vam) u32 sw_if_index = ~0; u8 *tag = 0; u8 enable = 1; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -17206,7 +17289,8 @@ api_sw_interface_tag_add_del (vat_main_t * vam) vec_free (tag); S (mp); - W; + W (ret); + return ret; } static void vl_api_l2_xconnect_details_t_handler @@ -17242,6 +17326,7 @@ static int api_l2_xconnect_dump (vat_main_t * vam) { vl_api_l2_xconnect_dump_t *mp; + int ret; if (!vam->json_output) { @@ -17258,7 +17343,8 @@ api_l2_xconnect_dump (vat_main_t * vam) M (CONTROL_PING, mp); S (mp); } - W; + W (ret); + return ret; } static int @@ -17268,6 +17354,7 @@ api_sw_interface_set_mtu (vat_main_t * vam) vl_api_sw_interface_set_mtu_t *mp; u32 sw_if_index = ~0; u32 mtu = 0; + int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { @@ -17299,7 +17386,8 @@ api_sw_interface_set_mtu (vat_main_t * vam) mp->mtu = ntohs ((u16) mtu); S (mp); - W; + W (ret); + return ret; } diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h index ffb74fe3..57722338 100644 --- a/src/vlibapi/vat_helper_macros.h +++ b/src/vlibapi/vat_helper_macros.h @@ -42,32 +42,32 @@ do { \ #define S(mp) (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp)) /* W: wait for results, with timeout */ -#define W \ +#define W(ret) \ do { \ f64 timeout = vat_time_now (vam) + 1.0; \ \ while (vat_time_now (vam) < timeout) { \ if (vam->result_ready == 1) { \ - return (vam->retval); \ + ret = vam->retval; \ } \ vat_suspend (vam->vlib_main, 1e-5); \ } \ - return -99; \ + ret = -99; \ } while(0); /* W2: wait for results, with timeout */ -#define W2(body) \ +#define W2(ret, body) \ do { \ f64 timeout = vat_time_now (vam) + 1.0; \ \ while (vat_time_now (vam) < timeout) { \ if (vam->result_ready == 1) { \ (body); \ - return (vam->retval); \ + ret = vam->retval; \ } \ vat_suspend (vam->vlib_main, 1e-5); \ } \ - return -99; \ + ret = -99; \ } while(0); -- cgit 1.2.3-korg