summaryrefslogtreecommitdiffstats
path: root/vlib-api/vlibapi/api_shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'vlib-api/vlibapi/api_shared.c')
-rw-r--r--vlib-api/vlibapi/api_shared.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/vlib-api/vlibapi/api_shared.c b/vlib-api/vlibapi/api_shared.c
index 511f693849d..2b2d81c2735 100644
--- a/vlib-api/vlibapi/api_shared.c
+++ b/vlib-api/vlibapi/api_shared.c
@@ -1312,6 +1312,25 @@ vl_msg_api_get_msg_ids (char *name, int n)
return rv;
}
+void
+vl_msg_api_add_msg_name_crc (api_main_t * am, char *string, u32 id)
+{
+ uword *p;
+
+ if (am->msg_index_by_name_and_crc == 0)
+ am->msg_index_by_name_and_crc = hash_create_string (0, sizeof (uword));
+
+ p = hash_get_mem (am->msg_index_by_name_and_crc, string);
+ if (p)
+ {
+ clib_warning ("attempt to redefine '%s' ignored...", string);
+ return;
+ }
+
+ hash_set_mem (am->msg_index_by_name_and_crc, string, id);
+}
+
+
/*
* fd.io coding-style-patch-verification: ON
*