summaryrefslogtreecommitdiffstats
path: root/plugins/sample-plugin/sample/sample.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sample-plugin/sample/sample.c')
-rw-r--r--plugins/sample-plugin/sample/sample.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/sample-plugin/sample/sample.c b/plugins/sample-plugin/sample/sample.c
index 321b66c0fb1..603cb2d0ee4 100644
--- a/plugins/sample-plugin/sample/sample.c
+++ b/plugins/sample-plugin/sample/sample.c
@@ -210,6 +210,19 @@ sample_plugin_api_hookup (vlib_main_t *vm)
return 0;
}
+#define vl_msg_name_crc_list
+#include <sample/sample_all_api_h.h>
+#undef vl_msg_name_crc_list
+
+static void
+setup_message_id_table (sample_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_sample;
+#undef _
+}
+
static clib_error_t * sample_init (vlib_main_t * vm)
{
sample_main_t * sm = &sample_main;
@@ -224,6 +237,9 @@ static clib_error_t * sample_init (vlib_main_t * vm)
error = sample_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;