summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/bfd/bfd_api.c2
-rw-r--r--src/vnet/bier/bier_api.c2
-rw-r--r--src/vnet/bonding/bond_api.c2
-rw-r--r--src/vnet/classify/classify_api.c2
-rw-r--r--src/vnet/cop/cop_api.c2
-rw-r--r--src/vnet/devices/af_packet/af_packet_api.c2
-rw-r--r--src/vnet/devices/netmap/netmap_api.c2
-rw-r--r--src/vnet/devices/pipe/pipe_api.c2
-rw-r--r--src/vnet/devices/tap/tapv2_api.c2
-rw-r--r--src/vnet/devices/virtio/vhost_user_api.c2
-rw-r--r--src/vnet/devices/virtio/virtio_api.c2
-rw-r--r--src/vnet/ethernet/p2p_ethernet_api.c2
-rw-r--r--src/vnet/feature/feature_api.c2
-rw-r--r--src/vnet/geneve/geneve_api.c2
-rw-r--r--src/vnet/gre/gre_api.c2
-rw-r--r--src/vnet/gso/gso_api.c2
-rw-r--r--src/vnet/interface_api.c2
-rw-r--r--src/vnet/ip/ip_api.c2
-rw-r--r--src/vnet/ip/punt_api.c2
-rw-r--r--src/vnet/ip/rd_cp.c2
-rw-r--r--src/vnet/ipfix-export/flow_api.c2
-rw-r--r--src/vnet/ipsec/ipsec_api.c2
-rw-r--r--src/vnet/l2/l2_api.c2
-rw-r--r--src/vnet/l2tp/l2tp_api.c2
-rw-r--r--src/vnet/lisp-cp/lisp_api.c2
-rw-r--r--src/vnet/lisp-cp/one_api.c2
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_api.c2
-rw-r--r--src/vnet/lldp/lldp_api.c2
-rw-r--r--src/vnet/mpls/mpls_api.c2
-rw-r--r--src/vnet/pg/pg_api.c2
-rw-r--r--src/vnet/policer/policer_api.c2
-rw-r--r--src/vnet/qos/qos_api.c2
-rw-r--r--src/vnet/session/session.c2
-rw-r--r--src/vnet/session/session_api.c2
-rw-r--r--src/vnet/span/span_api.c2
-rw-r--r--src/vnet/srmpls/sr_mpls_api.c2
-rw-r--r--src/vnet/srv6/sr_api.c2
-rw-r--r--src/vnet/syslog/syslog_api.c2
-rw-r--r--src/vnet/tcp/tcp_api.c2
-rw-r--r--src/vnet/udp/udp_api.c2
-rw-r--r--src/vnet/vxlan-gbp/vxlan_gbp_api.c2
-rw-r--r--src/vnet/vxlan-gpe/vxlan_gpe_api.c2
-rw-r--r--src/vnet/vxlan/vxlan_api.c2
43 files changed, 43 insertions, 43 deletions
diff --git a/src/vnet/bfd/bfd_api.c b/src/vnet/bfd/bfd_api.c
index 0671a5dd5f3..50be675f3e2 100644
--- a/src/vnet/bfd/bfd_api.c
+++ b/src/vnet/bfd/bfd_api.c
@@ -415,7 +415,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
bfd_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N, n) \
vl_msg_api_set_handlers (VL_API_##N, #n, vl_api_##n##_t_handler, \
diff --git a/src/vnet/bier/bier_api.c b/src/vnet/bier/bier_api.c
index 66f6b422810..e06a53edd97 100644
--- a/src/vnet/bier/bier_api.c
+++ b/src/vnet/bier/bier_api.c
@@ -688,7 +688,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
bier_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/bonding/bond_api.c b/src/vnet/bonding/bond_api.c
index ebbb80e956b..525f058ee4c 100644
--- a/src/vnet/bonding/bond_api.c
+++ b/src/vnet/bonding/bond_api.c
@@ -269,7 +269,7 @@ bond_setup_message_id_table (api_main_t * am)
static clib_error_t *
bond_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/classify/classify_api.c b/src/vnet/classify/classify_api.c
index 24f28873fbe..03d04298c7a 100644
--- a/src/vnet/classify/classify_api.c
+++ b/src/vnet/classify/classify_api.c
@@ -678,7 +678,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
classify_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/cop/cop_api.c b/src/vnet/cop/cop_api.c
index 0b8a5a26ce9..1415bf03312 100644
--- a/src/vnet/cop/cop_api.c
+++ b/src/vnet/cop/cop_api.c
@@ -110,7 +110,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
cop_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/devices/af_packet/af_packet_api.c b/src/vnet/devices/af_packet/af_packet_api.c
index dd9697a8a6b..58d45be4960 100644
--- a/src/vnet/devices/af_packet/af_packet_api.c
+++ b/src/vnet/devices/af_packet/af_packet_api.c
@@ -170,7 +170,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
af_packet_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/devices/netmap/netmap_api.c b/src/vnet/devices/netmap/netmap_api.c
index 3959615fb99..ee05ec22d25 100644
--- a/src/vnet/devices/netmap/netmap_api.c
+++ b/src/vnet/devices/netmap/netmap_api.c
@@ -106,7 +106,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
netmap_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/devices/pipe/pipe_api.c b/src/vnet/devices/pipe/pipe_api.c
index 1466681949f..35efb87a712 100644
--- a/src/vnet/devices/pipe/pipe_api.c
+++ b/src/vnet/devices/pipe/pipe_api.c
@@ -146,7 +146,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
pipe_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/devices/tap/tapv2_api.c b/src/vnet/devices/tap/tapv2_api.c
index a1acacf4719..af3c2763f48 100644
--- a/src/vnet/devices/tap/tapv2_api.c
+++ b/src/vnet/devices/tap/tapv2_api.c
@@ -254,7 +254,7 @@ tap_setup_message_id_table (api_main_t * am)
static clib_error_t *
tapv2_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/devices/virtio/vhost_user_api.c b/src/vnet/devices/virtio/vhost_user_api.c
index 7899fa2ae78..c8c9b59dcc0 100644
--- a/src/vnet/devices/virtio/vhost_user_api.c
+++ b/src/vnet/devices/virtio/vhost_user_api.c
@@ -226,7 +226,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
vhost_user_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/devices/virtio/virtio_api.c b/src/vnet/devices/virtio/virtio_api.c
index e354958d5aa..9d009f37a38 100644
--- a/src/vnet/devices/virtio/virtio_api.c
+++ b/src/vnet/devices/virtio/virtio_api.c
@@ -187,7 +187,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
virtio_pci_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/ethernet/p2p_ethernet_api.c b/src/vnet/ethernet/p2p_ethernet_api.c
index 3f537168a8e..3bbda6ef361 100644
--- a/src/vnet/ethernet/p2p_ethernet_api.c
+++ b/src/vnet/ethernet/p2p_ethernet_api.c
@@ -106,7 +106,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
p2p_ethernet_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/feature/feature_api.c b/src/vnet/feature/feature_api.c
index a2c0cedb508..75399ec54c4 100644
--- a/src/vnet/feature/feature_api.c
+++ b/src/vnet/feature/feature_api.c
@@ -102,7 +102,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
feature_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/geneve/geneve_api.c b/src/vnet/geneve/geneve_api.c
index 2a4f5aa8053..996a7a029e0 100644
--- a/src/vnet/geneve/geneve_api.c
+++ b/src/vnet/geneve/geneve_api.c
@@ -199,7 +199,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
geneve_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/gre/gre_api.c b/src/vnet/gre/gre_api.c
index 9ee9f19f99f..be91f758777 100644
--- a/src/vnet/gre/gre_api.c
+++ b/src/vnet/gre/gre_api.c
@@ -252,7 +252,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
gre_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/gso/gso_api.c b/src/vnet/gso/gso_api.c
index 9991c5fd289..d3426142f1c 100644
--- a/src/vnet/gso/gso_api.c
+++ b/src/vnet/gso/gso_api.c
@@ -75,7 +75,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
feature_gso_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index 387ef32a207..fe3426cb827 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -1391,7 +1391,7 @@ pub_sub_handler (interface_events, INTERFACE_EVENTS);
static clib_error_t *
interface_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 3440c657502..6da6ac34d48 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -2925,7 +2925,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
ip_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/ip/punt_api.c b/src/vnet/ip/punt_api.c
index 8bb0f7fbc82..6ed62a1873c 100644
--- a/src/vnet/ip/punt_api.c
+++ b/src/vnet/ip/punt_api.c
@@ -389,7 +389,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
punt_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/ip/rd_cp.c b/src/vnet/ip/rd_cp.c
index f6cb6742529..c9c387e07c0 100644
--- a/src/vnet/ip/rd_cp.c
+++ b/src/vnet/ip/rd_cp.c
@@ -662,7 +662,7 @@ static clib_error_t *
rd_cp_init (vlib_main_t * vm)
{
rd_cp_main_t *rm = &rd_cp_main;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
rm->vlib_main = vm;
rm->vnet_main = vnet_get_main ();
diff --git a/src/vnet/ipfix-export/flow_api.c b/src/vnet/ipfix-export/flow_api.c
index ead602499da..84babe7dcdc 100644
--- a/src/vnet/ipfix-export/flow_api.c
+++ b/src/vnet/ipfix-export/flow_api.c
@@ -409,7 +409,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
flow_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/ipsec/ipsec_api.c b/src/vnet/ipsec/ipsec_api.c
index ed79193906a..4252acd2688 100644
--- a/src/vnet/ipsec/ipsec_api.c
+++ b/src/vnet/ipsec/ipsec_api.c
@@ -978,7 +978,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
ipsec_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c
index 255e91b2e0a..e8b103ac2c7 100644
--- a/src/vnet/l2/l2_api.c
+++ b/src/vnet/l2/l2_api.c
@@ -1067,7 +1067,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
l2_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/l2tp/l2tp_api.c b/src/vnet/l2tp/l2tp_api.c
index ba1f7c61cc6..3a31372253f 100644
--- a/src/vnet/l2tp/l2tp_api.c
+++ b/src/vnet/l2tp/l2tp_api.c
@@ -242,7 +242,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
l2tp_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/lisp-cp/lisp_api.c b/src/vnet/lisp-cp/lisp_api.c
index 3f18a5dee70..4ef4d18f44a 100644
--- a/src/vnet/lisp-cp/lisp_api.c
+++ b/src/vnet/lisp-cp/lisp_api.c
@@ -1283,7 +1283,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
lisp_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/lisp-cp/one_api.c b/src/vnet/lisp-cp/one_api.c
index 17d4afc8267..d1117ee6d73 100644
--- a/src/vnet/lisp-cp/one_api.c
+++ b/src/vnet/lisp-cp/one_api.c
@@ -1817,7 +1817,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
one_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/lisp-gpe/lisp_gpe_api.c b/src/vnet/lisp-gpe/lisp_gpe_api.c
index 16c1128c131..59a3fd1afc0 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_api.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_api.c
@@ -566,7 +566,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
gpe_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/lldp/lldp_api.c b/src/vnet/lldp/lldp_api.c
index 00b71f97dad..b28d1b10869 100644
--- a/src/vnet/lldp/lldp_api.c
+++ b/src/vnet/lldp/lldp_api.c
@@ -142,7 +142,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
lldp_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/mpls/mpls_api.c b/src/vnet/mpls/mpls_api.c
index 56911c8791c..0185e373a41 100644
--- a/src/vnet/mpls/mpls_api.c
+++ b/src/vnet/mpls/mpls_api.c
@@ -550,7 +550,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
mpls_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/pg/pg_api.c b/src/vnet/pg/pg_api.c
index f4b9604bfd4..5b64a77c0fc 100644
--- a/src/vnet/pg/pg_api.c
+++ b/src/vnet/pg/pg_api.c
@@ -153,7 +153,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
pg_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/policer/policer_api.c b/src/vnet/policer/policer_api.c
index 96ee781ca18..ae57a9359ea 100644
--- a/src/vnet/policer/policer_api.c
+++ b/src/vnet/policer/policer_api.c
@@ -204,7 +204,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
policer_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/qos/qos_api.c b/src/vnet/qos/qos_api.c
index cb92c851854..af0a700d2b5 100644
--- a/src/vnet/qos/qos_api.c
+++ b/src/vnet/qos/qos_api.c
@@ -367,7 +367,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
qos_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 4eb4f4abf7d..33691068b0c 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1333,7 +1333,7 @@ session_vpp_event_queues_allocate (session_main_t * smm)
{
u32 evt_q_length = 2048, evt_size = sizeof (session_event_t);
ssvm_private_t *eqs = &smm->evt_qs_segment;
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
uword eqs_size = 64 << 20;
pid_t vpp_pid = getpid ();
void *oldheap;
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c
index 6cff9ec6b05..0846e571919 100644
--- a/src/vnet/session/session_api.c
+++ b/src/vnet/session/session_api.c
@@ -1531,7 +1531,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
session_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/span/span_api.c b/src/vnet/span/span_api.c
index 9566941ab9e..6ed58cd8b6b 100644
--- a/src/vnet/span/span_api.c
+++ b/src/vnet/span/span_api.c
@@ -129,7 +129,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
span_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/srmpls/sr_mpls_api.c b/src/vnet/srmpls/sr_mpls_api.c
index f3bfc27a4d2..f17c8b482e3 100644
--- a/src/vnet/srmpls/sr_mpls_api.c
+++ b/src/vnet/srmpls/sr_mpls_api.c
@@ -179,7 +179,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
sr_mpls_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/srv6/sr_api.c b/src/vnet/srv6/sr_api.c
index 5a7d8c5a2ea..ffd0c4d0400 100644
--- a/src/vnet/srv6/sr_api.c
+++ b/src/vnet/srv6/sr_api.c
@@ -396,7 +396,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
sr_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/syslog/syslog_api.c b/src/vnet/syslog/syslog_api.c
index 9fc8e55ebf7..626a2ac4396 100644
--- a/src/vnet/syslog/syslog_api.c
+++ b/src/vnet/syslog/syslog_api.c
@@ -212,7 +212,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
syslog_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/tcp/tcp_api.c b/src/vnet/tcp/tcp_api.c
index 7f574630147..db488e1c52a 100644
--- a/src/vnet/tcp/tcp_api.c
+++ b/src/vnet/tcp/tcp_api.c
@@ -83,7 +83,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
tcp_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/udp/udp_api.c b/src/vnet/udp/udp_api.c
index 5f4081c2dcf..522b0a804ca 100644
--- a/src/vnet/udp/udp_api.c
+++ b/src/vnet/udp/udp_api.c
@@ -177,7 +177,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
udp_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/vxlan-gbp/vxlan_gbp_api.c b/src/vnet/vxlan-gbp/vxlan_gbp_api.c
index 08e2a7c279f..17a1984b8c3 100644
--- a/src/vnet/vxlan-gbp/vxlan_gbp_api.c
+++ b/src/vnet/vxlan-gbp/vxlan_gbp_api.c
@@ -229,7 +229,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
vxlan_gbp_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/vxlan-gpe/vxlan_gpe_api.c b/src/vnet/vxlan-gpe/vxlan_gpe_api.c
index 22a28a73a77..480441d15ed 100644
--- a/src/vnet/vxlan-gpe/vxlan_gpe_api.c
+++ b/src/vnet/vxlan-gpe/vxlan_gpe_api.c
@@ -236,7 +236,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
vxlan_gpe_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
diff --git a/src/vnet/vxlan/vxlan_api.c b/src/vnet/vxlan/vxlan_api.c
index 2cec93c7687..8efd1e6a7e0 100644
--- a/src/vnet/vxlan/vxlan_api.c
+++ b/src/vnet/vxlan/vxlan_api.c
@@ -263,7 +263,7 @@ setup_message_id_table (api_main_t * am)
static clib_error_t *
vxlan_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \