diff options
author | Ole Troan <ot@cisco.com> | 2018-08-02 11:58:12 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-10-02 21:10:20 +0000 |
commit | 94495f2a6a68ac2202b7715ce09620f1ba6fe673 (patch) | |
tree | b87604a42f7cacedff6c82f7d8fc68adc8348a5f /src/vlibmemory/api.h | |
parent | 84db4087fa38b8d4c62cbb0787d600950638034c (diff) |
PAPI: Use UNIX domain sockets instead of shared memory
Adds support for running the API purely across Unix domain sockets.
Usage: vpp = VPP(use_socket=True)
Change-Id: Iafc1301e03dd3edc3f4d702dd6c0b98d3b50b69e
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vlibmemory/api.h')
-rw-r--r-- | src/vlibmemory/api.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vlibmemory/api.h b/src/vlibmemory/api.h index 2146b16c5b0..d66c4398764 100644 --- a/src/vlibmemory/api.h +++ b/src/vlibmemory/api.h @@ -55,10 +55,11 @@ vl_api_can_send_msg (vl_api_registration_t * rp) always_inline vl_api_registration_t * vl_api_client_index_to_registration (u32 index) { - if (PREDICT_FALSE (socket_main.current_rp != 0)) - return socket_main.current_rp; - - return (vl_mem_api_client_index_to_registration (index)); + vl_api_registration_t *reg = + vl_socket_api_client_index_to_registration (index); + if (reg && reg->registration_type != REGISTRATION_TYPE_FREE) + return reg; + return vl_mem_api_client_index_to_registration (index); } always_inline u32 |