aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2020-05-18 11:14:05 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-05-27 08:30:38 +0000
commite796a18734fae0783a226c38550796260f0acfec (patch)
treeeb6e2d17b2c2cbc6f2b3ed9ad781428b6ab9b392 /src/plugins
parent0ab36f55753d3d1417c41f8a3aec5e79a882555c (diff)
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 <ot@cisco.com> Change-Id: I7588f8ccb38b2d1e8d85ea17be99bac43f756267 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/map/map_api.c11
1 files changed, 7 insertions, 4 deletions
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;
}