aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
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/plugins
parent6b3f25caff262b536a5449ac5461dd041c92a655 (diff)
api: multiple connections per process
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dhcp/dhcp6_ia_na_client_cp.c2
-rw-r--r--src/plugins/dhcp/dhcp6_pd_client_cp.c2
-rw-r--r--src/plugins/dns/dns.c2
-rw-r--r--src/plugins/hs_apps/echo_client.c2
-rw-r--r--src/plugins/hs_apps/echo_server.c2
-rw-r--r--src/plugins/hs_apps/proxy.c2
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo.c2
-rw-r--r--src/plugins/lacp/lacp_api.c2
-rw-r--r--src/plugins/mactime/mactime.c2
-rw-r--r--src/plugins/mactime/mactime_top.c2
-rwxr-xr-xsrc/plugins/nat/nat.c2
-rw-r--r--src/plugins/nsh/nsh_api.c2
12 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/dhcp/dhcp6_ia_na_client_cp.c b/src/plugins/dhcp/dhcp6_ia_na_client_cp.c
index b87ad2139ed..f9c379cffe8 100644
--- a/src/plugins/dhcp/dhcp6_ia_na_client_cp.c
+++ b/src/plugins/dhcp/dhcp6_ia_na_client_cp.c
@@ -766,7 +766,7 @@ dhcp_ia_na_client_cp_init (vlib_main_t * vm)
rm->vlib_main = vm;
rm->vnet_main = vnet_get_main ();
- rm->api_main = &api_main;
+ rm->api_main = vlibapi_get_main ();
rm->node_index = dhcp6_client_cp_process_node.index;
return NULL;
diff --git a/src/plugins/dhcp/dhcp6_pd_client_cp.c b/src/plugins/dhcp/dhcp6_pd_client_cp.c
index 14f127d7cf8..ec9e5c64b07 100644
--- a/src/plugins/dhcp/dhcp6_pd_client_cp.c
+++ b/src/plugins/dhcp/dhcp6_pd_client_cp.c
@@ -1394,7 +1394,7 @@ dhcp_pd_client_cp_init (vlib_main_t * vm)
rm->vlib_main = vm;
rm->vnet_main = vnet_get_main ();
- rm->api_main = &api_main;
+ rm->api_main = vlibapi_get_main ();
rm->node_index = dhcp6_pd_client_cp_process_node.index;
return (NULL);
diff --git a/src/plugins/dns/dns.c b/src/plugins/dns/dns.c
index a6dff672feb..4a07fc09a6d 100644
--- a/src/plugins/dns/dns.c
+++ b/src/plugins/dns/dns.c
@@ -3056,7 +3056,7 @@ dns_init (vlib_main_t * vm)
dm->name_cache_size = 1000;
dm->max_ttl_in_seconds = 86400;
dm->random_seed = 0xDEADDABE;
- dm->api_main = &api_main;
+ dm->api_main = vlibapi_get_main ();
/* Ask for a correctly-sized block of API message decode slots */
dm->msg_id_base = setup_message_id_table ();
diff --git a/src/plugins/hs_apps/echo_client.c b/src/plugins/hs_apps/echo_client.c
index 128503279b7..35cd608f40c 100644
--- a/src/plugins/hs_apps/echo_client.c
+++ b/src/plugins/hs_apps/echo_client.c
@@ -318,7 +318,7 @@ VLIB_REGISTER_NODE (echo_clients_node) =
static int
create_api_loopback (echo_client_main_t * ecm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
vl_shmem_hdr_t *shmem_hdr;
shmem_hdr = am->shmem_hdr;
diff --git a/src/plugins/hs_apps/echo_server.c b/src/plugins/hs_apps/echo_server.c
index dc15185c75b..0da7bc09b5a 100644
--- a/src/plugins/hs_apps/echo_server.c
+++ b/src/plugins/hs_apps/echo_server.c
@@ -306,7 +306,7 @@ static int
create_api_loopback (vlib_main_t * vm)
{
echo_server_main_t *esm = &echo_server_main;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
vl_shmem_hdr_t *shmem_hdr;
shmem_hdr = am->shmem_hdr;
diff --git a/src/plugins/hs_apps/proxy.c b/src/plugins/hs_apps/proxy.c
index 31dbfc5969f..c4ddd676436 100644
--- a/src/plugins/hs_apps/proxy.c
+++ b/src/plugins/hs_apps/proxy.c
@@ -381,7 +381,7 @@ static void
create_api_loopbacks (vlib_main_t * vm)
{
proxy_main_t *pm = &proxy_main;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
vl_shmem_hdr_t *shmem_hdr;
shmem_hdr = am->shmem_hdr;
diff --git a/src/plugins/hs_apps/sapi/vpp_echo.c b/src/plugins/hs_apps/sapi/vpp_echo.c
index 18a0280e6b2..c94ff9d6cd8 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo.c
+++ b/src/plugins/hs_apps/sapi/vpp_echo.c
@@ -88,7 +88,7 @@ int
connect_to_vpp (char *name)
{
echo_main_t *em = &echo_main;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
if (em->use_sock_api)
{
diff --git a/src/plugins/lacp/lacp_api.c b/src/plugins/lacp/lacp_api.c
index 115dd473836..dbeb14b3245 100644
--- a/src/plugins/lacp/lacp_api.c
+++ b/src/plugins/lacp/lacp_api.c
@@ -119,7 +119,7 @@ clib_error_t *
lacp_plugin_api_hookup (vlib_main_t * vm)
{
lacp_main_t *lm = &lacp_main;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
/* Ask for a correctly-sized block of API message decode slots */
lm->msg_id_base = setup_message_id_table ();
diff --git a/src/plugins/mactime/mactime.c b/src/plugins/mactime/mactime.c
index bc0c9cef0d1..9192a26ac23 100644
--- a/src/plugins/mactime/mactime.c
+++ b/src/plugins/mactime/mactime.c
@@ -249,7 +249,7 @@ mactime_send_create_entry_message (u8 * mac_address)
u8 *name;
vl_api_mactime_add_del_range_t *mp;
- am = &api_main;
+ am = vlibapi_get_main ();
shmem_hdr = am->shmem_hdr;
mp = vl_msg_api_alloc_as_if_client (sizeof (*mp));
clib_memset (mp, 0, sizeof (*mp));
diff --git a/src/plugins/mactime/mactime_top.c b/src/plugins/mactime/mactime_top.c
index df7c755111f..48735a2e816 100644
--- a/src/plugins/mactime/mactime_top.c
+++ b/src/plugins/mactime/mactime_top.c
@@ -120,7 +120,7 @@ vl_api_mactime_details_t_handler (vl_api_mactime_details_t * mp)
static int
connect_to_vpp (char *name)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
mt_main_t *mm = &mt_main;
u8 *msg_base_lookup_name;
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index d7133684b32..ee70b0f00ab 100755
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -2309,7 +2309,7 @@ snat_init (vlib_main_t * vm)
sm->vnet_main = vnet_get_main ();
sm->ip4_main = im;
sm->ip4_lookup_main = lm;
- sm->api_main = &api_main;
+ sm->api_main = vlibapi_get_main ();
sm->first_worker_index = 0;
sm->num_workers = 0;
sm->num_snat_thread = 1;
diff --git a/src/plugins/nsh/nsh_api.c b/src/plugins/nsh/nsh_api.c
index 02675f9a735..2f40f31e62d 100644
--- a/src/plugins/nsh/nsh_api.c
+++ b/src/plugins/nsh/nsh_api.c
@@ -713,7 +713,7 @@ nsh_api_init (vlib_main_t * vm, nsh_main_t * nm)
error = nsh_plugin_api_hookup (vm);
/* Add our API messages to the global name_crc hash table */
- setup_message_id_table (nm, &api_main);
+ setup_message_id_table (nm, vlibapi_get_main ());
vec_free (name);