From e796a18734fae0783a226c38550796260f0acfec Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Mon, 18 May 2020 11:14:05 +0200 Subject: api: make vpp api handlers endian independent Add a new boolean to signal that the API infrastructure should performan any required endian conversions for the API handler. am->is_autoendian[mm->msg_id_base + VL_API_MAP_ADD_DOMAIN] = 1; Similarly add new REPLY_ macros that perform endian conversion. These changes do not change the on-the-wire encoding of the API messages, and therefore the API CRC is not changed. Type: feature Signed-off-by: Ole Troan Change-Id: I7588f8ccb38b2d1e8d85ea17be99bac43f756267 Signed-off-by: Ole Troan --- src/plugins/map/map_api.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/map/map_api.c b/src/plugins/map/map_api.c index 13f05526afa..94d2458dd79 100644 --- a/src/plugins/map/map_api.c +++ b/src/plugins/map/map_api.c @@ -48,14 +48,14 @@ vl_api_map_add_domain_t_handler (vl_api_map_add_domain_t * mp) mp->ip6_prefix.len, (ip6_address_t *) & mp->ip6_src.address, mp->ip6_src.len, mp->ea_bits_len, mp->psid_offset, - mp->psid_length, &index, ntohs (mp->mtu), flags, - mp->tag); + mp->psid_length, &index, mp->mtu, flags, mp->tag); /* *INDENT-OFF* */ - REPLY_MACRO2(VL_API_MAP_ADD_DOMAIN_REPLY, + REPLY_MACRO2_END(VL_API_MAP_ADD_DOMAIN_REPLY, ({ - rmp->index = ntohl(index); + rmp->index = index; })); + /* *INDENT-ON* */ } @@ -556,6 +556,9 @@ map_plugin_api_hookup (vlib_main_t * vm) map_main_t *mm = &map_main; mm->msg_id_base = setup_message_id_table (); + + api_main_t *am = vlibapi_get_main (); + am->is_autoendian[mm->msg_id_base + VL_API_MAP_ADD_DOMAIN] = 1; return 0; } -- cgit 1.2.3-korg