summaryrefslogtreecommitdiffstats
path: root/src/vlibapi/api_shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlibapi/api_shared.c')
-rw-r--r--src/vlibapi/api_shared.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/vlibapi/api_shared.c b/src/vlibapi/api_shared.c
index 4d11b519cf2..d4196264064 100644
--- a/src/vlibapi/api_shared.c
+++ b/src/vlibapi/api_shared.c
@@ -754,11 +754,11 @@ vl_msg_api_set_cleanup_handler (int msg_id, void *fp)
}
void
-vl_msg_api_queue_handler (unix_shared_memory_queue_t * q)
+vl_msg_api_queue_handler (svm_queue_t * q)
{
uword msg;
- while (!unix_shared_memory_queue_sub (q, (u8 *) & msg, 0))
+ while (!svm_queue_sub (q, (u8 *) & msg, 0))
vl_msg_api_handler ((void *) msg);
}
@@ -940,6 +940,21 @@ vl_msg_api_add_version (api_main_t * am, const char *string,
vec_add1 (am->api_version_list, version);
}
+u32
+vl_msg_api_get_msg_index (u8 * name_and_crc)
+{
+ api_main_t *am = &api_main;
+ uword *p;
+
+ if (am->msg_index_by_name_and_crc)
+ {
+ p = hash_get_mem (am->msg_index_by_name_and_crc, name_and_crc);
+ if (p)
+ return p[0];
+ }
+ return ~0;
+}
+
/*
* fd.io coding-style-patch-verification: ON
*