diff options
author | Dave Barach <dave@barachs.net> | 2019-11-27 11:42:13 -0500 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-12-10 01:13:05 +0000 |
commit | 39d69112fcec114fde34955ceb41555221d3ba11 (patch) | |
tree | 156f21a0e66bf596b2c1e5184d82c80d99ea0a79 /src/vpp-api/vapi/vapi.c | |
parent | 6b3f25caff262b536a5449ac5461dd041c92a655 (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/vapi/vapi.c')
-rw-r--r-- | src/vpp-api/vapi/vapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vpp-api/vapi/vapi.c b/src/vpp-api/vapi/vapi.c index 859a811d178..8a9c8e3b450 100644 --- a/src/vpp-api/vapi/vapi.c +++ b/src/vpp-api/vapi/vapi.c @@ -447,7 +447,7 @@ vapi_send (vapi_ctx_t ctx, void *msg) goto out; } int tmp; - svm_queue_t *q = api_main.shmem_hdr->vl_input_queue; + svm_queue_t *q = vlibapi_get_main ()->shmem_hdr->vl_input_queue; #if VAPI_DEBUG unsigned msgid = be16toh (*(u16 *) msg); if (msgid <= ctx->vl_msg_id_max) @@ -490,7 +490,7 @@ vapi_send2 (vapi_ctx_t ctx, void *msg1, void *msg2) rv = VAPI_EINVAL; goto out; } - svm_queue_t *q = api_main.shmem_hdr->vl_input_queue; + svm_queue_t *q = vlibapi_get_main ()->shmem_hdr->vl_input_queue; #if VAPI_DEBUG unsigned msgid1 = be16toh (*(u16 *) msg1); unsigned msgid2 = be16toh (*(u16 *) msg2); @@ -536,7 +536,7 @@ vapi_recv (vapi_ctx_t ctx, void **msg, size_t * msg_size, return VAPI_EINVAL; } vapi_error_e rv = VAPI_OK; - api_main_t *am = &api_main; + api_main_t *am = vlibapi_get_main (); uword data; if (am->our_pid == 0) @@ -860,7 +860,7 @@ vapi_lookup_vl_msg_id (vapi_ctx_t ctx, vapi_msg_id_t id) int vapi_get_client_index (vapi_ctx_t ctx) { - return api_main.my_client_index; + return vlibapi_get_main ()->my_client_index; } bool |