summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/client
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-11-27 11:42:13 -0500
committerFlorin Coras <florin.coras@gmail.com>2019-12-10 01:13:05 +0000
commit39d69112fcec114fde34955ceb41555221d3ba11 (patch)
tree156f21a0e66bf596b2c1e5184d82c80d99ea0a79 /src/vpp-api/client
parent6b3f25caff262b536a5449ac5461dd041c92a655 (diff)
api: multiple connections per process
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
Diffstat (limited to 'src/vpp-api/client')
-rw-r--r--src/vpp-api/client/client.c20
-rw-r--r--src/vpp-api/client/test.c2
2 files changed, 11 insertions, 11 deletions
diff --git a/src/vpp-api/client/client.c b/src/vpp-api/client/client.c
index fa83696ec34..057909514d8 100644
--- a/src/vpp-api/client/client.c
+++ b/src/vpp-api/client/client.c
@@ -177,7 +177,7 @@ vac_rx_thread_fn (void *arg)
vl_api_memclnt_keepalive_t *mp;
vl_api_memclnt_keepalive_reply_t *rmp;
vac_main_t *pm = &vac_main;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main();
vl_shmem_hdr_t *shmem_hdr;
uword msg;
@@ -237,7 +237,7 @@ vac_timeout_thread_fn (void *arg)
{
vl_api_memclnt_read_timeout_t *ep;
vac_main_t *pm = &vac_main;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main();
struct timespec ts;
struct timeval tv;
int rv;
@@ -272,7 +272,7 @@ vac_timeout_thread_fn (void *arg)
void
vac_rx_suspend (void)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main();
vac_main_t *pm = &vac_main;
vl_api_memclnt_rx_thread_suspend_t *ep;
@@ -306,14 +306,14 @@ vac_rx_resume (void)
static uword *
vac_msg_table_get_hash (void)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main();
return (am->msg_index_by_name_and_crc);
}
int
vac_msg_table_size(void)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main();
return hash_elts(am->msg_index_by_name_and_crc);
}
@@ -390,7 +390,7 @@ unset_timeout (void)
int
vac_disconnect (void)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main();
vac_main_t *pm = &vac_main;
uword junk;
int rv = 0;
@@ -442,7 +442,7 @@ int
vac_read (char **p, int *l, u16 timeout)
{
svm_queue_t *q;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main();
vac_main_t *pm = &vac_main;
vl_api_memclnt_keepalive_t *mp;
vl_api_memclnt_keepalive_reply_t *rmp;
@@ -489,7 +489,7 @@ vac_read (char **p, int *l, u16 timeout)
shmem_hdr = am->shmem_hdr;
vl_msg_api_send_shmem(shmem_hdr->vl_input_queue, (u8 *)&rmp);
vl_msg_api_free((void *) msg);
- /*
+ /*
* Python code is blissfully unaware of these pings, so
* act as if it never happened...
*/
@@ -535,14 +535,14 @@ typedef VL_API_PACKED(struct _vl_api_header {
static u32
vac_client_index (void)
{
- return (api_main.my_client_index);
+ return (vlibapi_get_main()->my_client_index);
}
int
vac_write (char *p, int l)
{
int rv = -1;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main();
vl_api_header_t *mp = vl_msg_api_alloc(l);
svm_queue_t *q;
vac_main_t *pm = &vac_main;
diff --git a/src/vpp-api/client/test.c b/src/vpp-api/client/test.c
index da2211b6459..308492d5f11 100644
--- a/src/vpp-api/client/test.c
+++ b/src/vpp-api/client/test.c
@@ -87,7 +87,7 @@ test_connect ()
static void
test_messages (void)
{
- api_main_t * am = &api_main;
+ api_main_t * am = vlibapi_get_main();
vl_api_show_version_t message;
vl_api_show_version_t *mp;
int async = 1;