summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-05-20 20:06:01 +0200
committerOle Tr�an <otroan@employees.org>2022-09-29 15:36:00 +0000
commita2eb507055c9467997711548d63420216ab7b4e9 (patch)
treebf6a60bf55d9c537f1a9498ae6be545d2d09e6bb /src/tools
parent95875774bc69a81b1a17963642fc574070ba37d0 (diff)
api: deprecate vl_msg_api_set_handlers
Type: refactor Change-Id: I7b7ca9ec62cb70243c5b7e87968eab1338d67ec8 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/vppapigen/vppapigen_c.py46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py
index b9f9e070e4a..5ca2ed51ff6 100644
--- a/src/tools/vppapigen/vppapigen_c.py
+++ b/src/tools/vppapigen/vppapigen_c.py
@@ -1669,17 +1669,18 @@ def generate_c_test_boilerplate(services, defines, file_crc, module, plugin, str
write("setup_message_id_table (vat_main_t * vam, u16 msg_id_base) {\n")
for s in services:
write(
- " vl_msg_api_set_handlers(VL_API_{ID} + msg_id_base, "
- ' "{n}",\n'
- " vl_api_{n}_t_handler, "
- " vl_api_{n}_t_endian, "
- " vl_api_{n}_t_format,\n"
- " sizeof(vl_api_{n}_t), 1,\n"
- " vl_api_{n}_t_tojson,\n"
- " vl_api_{n}_t_fromjson,\n"
- " vl_api_{n}_t_calc_size);\n".format(
- n=s.reply, ID=s.reply.upper()
- )
+ " vl_msg_api_config (&(vl_msg_api_msg_config_t){{\n"
+ " .id = VL_API_{ID} + msg_id_base,\n"
+ ' .name = "{n}",\n'
+ " .handler = vl_api_{n}_t_handler,\n"
+ " .endian = vl_api_{n}_t_endian,\n"
+ " .format_fn = vl_api_{n}_t_format,\n"
+ " .size = sizeof(vl_api_{n}_t),\n"
+ " .traced = 1,\n"
+ " .tojson = vl_api_{n}_t_tojson,\n"
+ " .fromjson = vl_api_{n}_t_fromjson,\n"
+ " .calc_size = vl_api_{n}_t_calc_size,\n"
+ " }});".format(n=s.reply, ID=s.reply.upper())
)
write(
' hash_set_mem (vam->function_by_name, "{n}", api_{n});\n'.format(
@@ -1698,17 +1699,18 @@ def generate_c_test_boilerplate(services, defines, file_crc, module, plugin, str
# Events
for e in s.events:
write(
- " vl_msg_api_set_handlers(VL_API_{ID} + msg_id_base, "
- ' "{n}",\n'
- " vl_api_{n}_t_handler, "
- " vl_api_{n}_t_endian, "
- " vl_api_{n}_t_format,\n"
- " sizeof(vl_api_{n}_t), 1,\n"
- " vl_api_{n}_t_tojson,\n"
- " vl_api_{n}_t_fromjson,\n"
- " vl_api_{n}_t_calc_size);\n".format(
- n=e, ID=e.upper()
- )
+ " vl_msg_api_config (&(vl_msg_api_msg_config_t){{\n"
+ " .id = VL_API_{ID} + msg_id_base,\n"
+ ' .name = "{n}",\n'
+ " .handler = vl_api_{n}_t_handler,\n"
+ " .endian = vl_api_{n}_t_endian,\n"
+ " .format_fn = vl_api_{n}_t_format,\n"
+ " .size = sizeof(vl_api_{n}_t),\n"
+ " .traced = 1,\n"
+ " .tojson = vl_api_{n}_t_tojson,\n"
+ " .fromjson = vl_api_{n}_t_fromjson,\n"
+ " .calc_size = vl_api_{n}_t_calc_size,\n"
+ " }});".format(n=e, ID=e.upper())
)
write("}\n")