summaryrefslogtreecommitdiffstats
path: root/plugins/ioam-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ioam-plugin')
-rw-r--r--plugins/ioam-plugin/ioam/export/ioam_export.c16
-rw-r--r--plugins/ioam-plugin/ioam/lib-pot/pot_api.c16
-rw-r--r--plugins/ioam-plugin/ioam/lib-trace/trace_api.c16
3 files changed, 48 insertions, 0 deletions
diff --git a/plugins/ioam-plugin/ioam/export/ioam_export.c b/plugins/ioam-plugin/ioam/export/ioam_export.c
index 9efcab05487..e51c43eb4c1 100644
--- a/plugins/ioam-plugin/ioam/export/ioam_export.c
+++ b/plugins/ioam-plugin/ioam/export/ioam_export.c
@@ -176,6 +176,19 @@ ioam_export_plugin_api_hookup (vlib_main_t * vm)
return 0;
}
+#define vl_msg_name_crc_list
+#include <ioam/export/ioam_export_all_api_h.h>
+#undef vl_msg_name_crc_list
+
+static void
+setup_message_id_table (ioam_export_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_ioam_export;
+#undef _
+}
+
static clib_error_t *
set_ioam_export_ipfix_command_fn (vlib_main_t * vm,
unformat_input_t * input,
@@ -247,6 +260,9 @@ ioam_export_init (vlib_main_t * vm)
error = ioam_export_plugin_api_hookup (vm);
+ /* Add our API messages to the global name_crc hash table */
+ setup_message_id_table (em, &api_main);
+
/* Hook this export node to ip6-hop-by-hop */
ip6_hbyh_node = vlib_get_node_by_name (vm, (u8 *) "ip6-hop-by-hop");
em->my_hbh_slot = vlib_node_add_next (vm, ip6_hbyh_node->index, node_index);
diff --git a/plugins/ioam-plugin/ioam/lib-pot/pot_api.c b/plugins/ioam-plugin/ioam/lib-pot/pot_api.c
index 95be9e02adf..484f223603e 100644
--- a/plugins/ioam-plugin/ioam/lib-pot/pot_api.c
+++ b/plugins/ioam-plugin/ioam/lib-pot/pot_api.c
@@ -206,6 +206,19 @@ pot_plugin_api_hookup (vlib_main_t *vm)
return 0;
}
+#define vl_msg_name_crc_list
+#include <ioam/lib-pot/pot_all_api_h.h>
+#undef vl_msg_name_crc_list
+
+static void
+setup_message_id_table (pot_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_pot;
+#undef _
+}
+
static clib_error_t * pot_init (vlib_main_t * vm)
{
pot_main_t * sm = &pot_main;
@@ -222,6 +235,9 @@ static clib_error_t * pot_init (vlib_main_t * vm)
error = pot_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;
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;