X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vpp%2Fvpp-api%2Fapi.c;h=330b9159e19401fd1a1b8c770fec71a3ad9108e6;hb=ed1c1835043a1d266a5928c40f41b340f6c968d7;hp=b2b639a718c381f4eb2227151ee1ff00bfc347cf;hpb=7490a752814187ed03c0deca4d836b0dca09fb4b;p=vpp.git diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index b2b639a718c..330b9159e19 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -4329,7 +4329,7 @@ send_ip_address_details (vpe_api_main_t * am, else { u32 *tp = (u32 *) mp->ip; - *tp = ntohl (*(u32 *) ip); + *tp = *(u32 *) ip; } mp->prefix_length = prefix_length; mp->context = context; @@ -8628,6 +8628,9 @@ vl_api_sw_interface_span_dump_t_handler (vl_api_sw_interface_span_dump_t * mp) u32 src_sw_if_index = 0, *dst_sw_if_index; q = vl_api_client_index_to_input_queue (mp->client_index); + if (!q) + return; + vec_foreach (dst_sw_if_index, sm->dst_by_src_sw_if_index) { if (*dst_sw_if_index > 0) @@ -9184,7 +9187,6 @@ vl_api_feature_enable_disable_t_handler (vl_api_feature_enable_disable_t * mp) u8 *arc_name = format (0, "%s%c", mp->arc_name, 0); u8 *feature_name = format (0, "%s%c", mp->feature_name, 0); - u32 sw_if_index = ntohl (mp->sw_if_index); vnet_feature_registration_t *reg; reg = @@ -9194,8 +9196,10 @@ vl_api_feature_enable_disable_t_handler (vl_api_feature_enable_disable_t * mp) rv = VNET_API_ERROR_INVALID_VALUE; else { + u32 sw_if_index; clib_error_t *error = 0; + sw_if_index = ntohl (mp->sw_if_index); if (reg->enable_disable_cb) error = reg->enable_disable_cb (sw_if_index, mp->enable); if (!error) @@ -9245,6 +9249,8 @@ static void vl_api_##nn##_t_handler ( \ vl_msg_api_free (mp); \ } +static void setup_message_id_table (api_main_t * am); + /* * vpe_api_hookup * Add vpe's API message handlers to the table. @@ -9252,7 +9258,6 @@ static void vl_api_##nn##_t_handler ( \ * added the client registration handlers. * See .../open-repo/vlib/memclnt_vlib.c:memclnt_process() */ - static clib_error_t * vpe_api_hookup (vlib_main_t * vm) { @@ -9306,6 +9311,11 @@ vpe_api_hookup (vlib_main_t * vm) am->is_mp_safe[VL_API_IP_ADD_DEL_ROUTE] = 1; am->is_mp_safe[VL_API_GET_NODE_GRAPH] = 1; + /* + * Set up the (msg_name, crc, message-id) table + */ + setup_message_id_table (am); + return 0; } @@ -9459,24 +9469,6 @@ get_unformat_vnet_sw_interface (void) return (void *) &unformat_vnet_sw_interface; } -#undef vl_api_version -#define vl_api_version(n,v) static u32 vpe_api_version = v; -#include -#undef vl_api_version - -int -vl_msg_api_version_check (vl_api_memclnt_create_t * mp) -{ - if (clib_host_to_net_u32 (mp->api_versions[0]) != vpe_api_version) - { - clib_warning ("vpe API mismatch: 0x%08x instead of 0x%08x", - clib_host_to_net_u32 (mp->api_versions[0]), - vpe_api_version); - return -1; - } - return 0; -} - static u8 * format_arp_event (u8 * s, va_list * args) { @@ -9540,6 +9532,20 @@ VLIB_CLI_COMMAND (show_ip_arp_nd_events, static) = { }; /* *INDENT-ON* */ +#define vl_msg_name_crc_list +#include +#undef vl_msg_name_crc_list + +static void +setup_message_id_table (api_main_t * am) +{ +#define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); + foreach_vl_msg_name_crc_memclnt; + foreach_vl_msg_name_crc_vpe; +#undef _ +} + + /* * fd.io coding-style-patch-verification: ON *