aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibmemory
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-04-26 13:59:20 -0700
committerDave Barach <openvpp@barachs.net>2017-05-03 12:35:05 +0000
commite72be39cd0f498178fd62dfc0a0b0daa2b633f62 (patch)
tree7b18cfecc33966c9fcb7a8daf3743d97a72332c6 /src/vlibmemory
parent9e355523f30e46efd2b1550ae029b544dfe866c4 (diff)
A sprinkling of const in vlibmemory/api.h and friends
Change-Id: I953ebb37eeec7de0c4a6b00258c3c67a83cbc020 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vlibmemory')
-rw-r--r--src/vlibmemory/api.h20
-rw-r--r--src/vlibmemory/memory_client.c16
-rw-r--r--src/vlibmemory/memory_shared.c4
-rw-r--r--src/vlibmemory/memory_vlib.c4
4 files changed, 23 insertions, 21 deletions
diff --git a/src/vlibmemory/api.h b/src/vlibmemory/api.h
index 8e44c20d..c195e181 100644
--- a/src/vlibmemory/api.h
+++ b/src/vlibmemory/api.h
@@ -123,20 +123,20 @@ void *vl_msg_api_alloc_or_null (int nbytes);
void *vl_msg_api_alloc_as_if_client (int nbytes);
void *vl_msg_api_alloc_as_if_client_or_null (int nbytes);
void vl_msg_api_free (void *a);
-int vl_map_shmem (char *region_name, int is_vlib);
+int vl_map_shmem (const char *region_name, int is_vlib);
void vl_register_mapped_shmem_region (svm_region_t * rp);
void vl_unmap_shmem (void);
void vl_msg_api_send_shmem (unix_shared_memory_queue_t * q, u8 * elem);
void vl_msg_api_send_shmem_nolock (unix_shared_memory_queue_t * q, u8 * elem);
void vl_msg_api_send (vl_api_registration_t * rp, u8 * elem);
-int vl_client_connect (char *name, int ctx_quota, int input_queue_size);
+int vl_client_connect (const char *name, int ctx_quota, int input_queue_size);
void vl_client_disconnect (void);
unix_shared_memory_queue_t *vl_api_client_index_to_input_queue (u32 index);
vl_api_registration_t *vl_api_client_index_to_registration (u32 index);
-int vl_client_api_map (char *region_name);
+int vl_client_api_map (const char *region_name);
void vl_client_api_unmap (void);
-void vl_set_memory_region_name (char *name);
-void vl_set_memory_root_path (char *root_path);
+void vl_set_memory_region_name (const char *name);
+void vl_set_memory_root_path (const char *root_path);
void vl_set_memory_uid (int uid);
void vl_set_memory_gid (int gid);
void vl_set_global_memory_baseva (u64 baseva);
@@ -146,12 +146,12 @@ void vl_set_global_pvt_heap_size (u64 size);
void vl_set_api_pvt_heap_size (u64 size);
void vl_enable_disable_memory_api (vlib_main_t * vm, int yesno);
void vl_client_disconnect_from_vlib (void);
-int vl_client_connect_to_vlib (char *svm_name, char *client_name,
- int rx_queue_size);
-int vl_client_connect_to_vlib_no_rx_pthread (char *svm_name,
- char *client_name,
+int vl_client_connect_to_vlib (const char *svm_name,
+ const char *client_name, int rx_queue_size);
+int vl_client_connect_to_vlib_no_rx_pthread (const char *svm_name,
+ const char *client_name,
int rx_queue_size);
-u16 vl_client_get_first_plugin_msg_id (char *plugin_name);
+u16 vl_client_get_first_plugin_msg_id (const char *plugin_name);
void vl_api_rpc_call_main_thread (void *fp, u8 * data, u32 data_length);
diff --git a/src/vlibmemory/memory_client.c b/src/vlibmemory/memory_client.c
index 25b06f65..d48a4fa1 100644
--- a/src/vlibmemory/memory_client.c
+++ b/src/vlibmemory/memory_client.c
@@ -155,7 +155,7 @@ noop_handler (void *notused)
}
int
-vl_client_connect (char *name, int ctx_quota, int input_queue_size)
+vl_client_connect (const char *name, int ctx_quota, int input_queue_size)
{
svm_region_t *svm;
vl_api_memclnt_create_t *mp;
@@ -326,7 +326,7 @@ _(MEMCLNT_DELETE_REPLY, memclnt_delete_reply)
int
-vl_client_api_map (char *region_name)
+vl_client_api_map (const char *region_name)
{
int rv;
@@ -354,7 +354,8 @@ vl_client_api_unmap (void)
}
static int
-connect_to_vlib_internal (char *svm_name, char *client_name,
+connect_to_vlib_internal (const char *svm_name,
+ const char *client_name,
int rx_queue_size, int want_pthread)
{
int rv = 0;
@@ -388,15 +389,16 @@ connect_to_vlib_internal (char *svm_name, char *client_name,
}
int
-vl_client_connect_to_vlib (char *svm_name, char *client_name,
- int rx_queue_size)
+vl_client_connect_to_vlib (const char *svm_name,
+ const char *client_name, int rx_queue_size)
{
return connect_to_vlib_internal (svm_name, client_name, rx_queue_size,
1 /* want pthread */ );
}
int
-vl_client_connect_to_vlib_no_rx_pthread (char *svm_name, char *client_name,
+vl_client_connect_to_vlib_no_rx_pthread (const char *svm_name,
+ const char *client_name,
int rx_queue_size)
{
return connect_to_vlib_internal (svm_name, client_name, rx_queue_size,
@@ -437,7 +439,7 @@ static void vl_api_get_first_msg_id_reply_t_handler
}
u16
-vl_client_get_first_plugin_msg_id (char *plugin_name)
+vl_client_get_first_plugin_msg_id (const char *plugin_name)
{
vl_api_get_first_msg_id_t *mp;
api_main_t *am = &api_main;
diff --git a/src/vlibmemory/memory_shared.c b/src/vlibmemory/memory_shared.c
index 6cea5df9..aea90330 100644
--- a/src/vlibmemory/memory_shared.c
+++ b/src/vlibmemory/memory_shared.c
@@ -257,7 +257,7 @@ vl_msg_api_free_nolock (void *a)
}
void
-vl_set_memory_root_path (char *name)
+vl_set_memory_root_path (const char *name)
{
api_main_t *am = &api_main;
@@ -321,7 +321,7 @@ vl_set_api_pvt_heap_size (u64 size)
}
int
-vl_map_shmem (char *region_name, int is_vlib)
+vl_map_shmem (const char *region_name, int is_vlib)
{
svm_map_region_args_t _a, *a = &_a;
svm_region_t *vlib_rp, *root_rp;
diff --git a/src/vlibmemory/memory_vlib.c b/src/vlibmemory/memory_vlib.c
index 43574dea..29a5c2c2 100644
--- a/src/vlibmemory/memory_vlib.c
+++ b/src/vlibmemory/memory_vlib.c
@@ -361,7 +361,7 @@ _(GET_FIRST_MSG_ID, get_first_msg_id)
* vl_api_init
*/
static int
-memory_api_init (char *region_name)
+memory_api_init (const char *region_name)
{
int rv;
vl_msg_api_msg_config_t cfg;
@@ -1202,7 +1202,7 @@ vlibmemory_init (vlib_main_t * vm)
VLIB_INIT_FUNCTION (vlibmemory_init);
void
-vl_set_memory_region_name (char *name)
+vl_set_memory_region_name (const char *name)
{
api_main_t *am = &api_main;