summaryrefslogtreecommitdiffstats
path: root/src/tools/vppapigen/vppapigen_c.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/vppapigen/vppapigen_c.py')
-rw-r--r--src/tools/vppapigen/vppapigen_c.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py
index bab255c58a2..e85a8980592 100644
--- a/src/tools/vppapigen/vppapigen_c.py
+++ b/src/tools/vppapigen/vppapigen_c.py
@@ -673,6 +673,15 @@ def generate_c_test_plugin_boilerplate(services, defines, file_crc, module, stre
write(' }\n')
write('}\n')
+ for e in s.events:
+ if define_hash[e].manual_print:
+ continue
+ write('static void\n')
+ write('vl_api_{n}_t_handler (vl_api_{n}_t * mp) {{\n'.format(n=e))
+ write(' vl_print(0, "{n} event called:");\n'.format(n=e))
+ write(' vl_api_{n}_t_print(mp, 0);\n'.format(n=e))
+ write('}\n')
+
write('static void\n')
write('setup_message_id_table (vat_main_t * vam, u16 msg_id_base) {\n')
for s in services:
@@ -688,6 +697,14 @@ def generate_c_test_plugin_boilerplate(services, defines, file_crc, module, stre
except:
pass
+ # 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_noop_handler,\n'
+ ' vl_api_{n}_t_endian, vl_api_{n}_t_print,\n'
+ ' sizeof(vl_api_{n}_t), 1);\n'
+ .format(n=e, ID=e.upper()))
+
write('}\n')
write('clib_error_t * vat_plugin_register (vat_main_t *vam)\n')