summaryrefslogtreecommitdiffstats
path: root/plugins/ioam-plugin/ioam/lib-trace/trace_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ioam-plugin/ioam/lib-trace/trace_api.c')
-rw-r--r--plugins/ioam-plugin/ioam/lib-trace/trace_api.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/ioam-plugin/ioam/lib-trace/trace_api.c b/plugins/ioam-plugin/ioam/lib-trace/trace_api.c
index b98e65fb320..32c8e23fae3 100644
--- a/plugins/ioam-plugin/ioam/lib-trace/trace_api.c
+++ b/plugins/ioam-plugin/ioam/lib-trace/trace_api.c
@@ -178,6 +178,19 @@ trace_plugin_api_hookup (vlib_main_t * vm)
return 0;
}
+#define vl_msg_name_crc_list
+#include <ioam/lib-trace/trace_all_api_h.h>
+#undef vl_msg_name_crc_list
+
+static void
+setup_message_id_table (trace_main_t * sm, api_main_t * am)
+{
+#define _(id,n,crc) \
+ vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base);
+ foreach_vl_msg_name_crc_trace;
+#undef _
+}
+
static clib_error_t *
trace_init (vlib_main_t * vm)
{
@@ -195,6 +208,9 @@ trace_init (vlib_main_t * vm)
error = trace_plugin_api_hookup (vm);
+ /* Add our API messages to the global name_crc hash table */
+ setup_message_id_table (sm, &api_main);
+
vec_free (name);
return error;