diff options
author | Ole Troan <ot@cisco.com> | 2022-01-27 16:25:43 +0100 |
---|---|---|
committer | Ole Troan <ot@cisco.com> | 2022-05-02 16:26:24 +0200 |
commit | 2ca88ff97884ec9ed20a853b13cee6d86f9c9d0f (patch) | |
tree | 65061fc95f2ad79580a367ec4e11bcbcf380dcc9 /src/vnet/interface_api.c | |
parent | 6a2868734c2f96186b6bfb705969a5daa702ebb6 (diff) |
vapi: support api clients within vpp process
Add vapi_connect_from_vpp() and vapi_disconnect_from_vpp()
calls to allow API clients from within VPP process.
Add a new memclnt_create version that gives the user a
knob to enable or disable dead client scans (keepalive).
Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Id0b7bb89308db3a3aed2d3fcbedf4e1282dcd03f
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet/interface_api.c')
-rw-r--r-- | src/vnet/interface_api.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c index 00a1ce3a599..29f98f7851f 100644 --- a/src/vnet/interface_api.c +++ b/src/vnet/interface_api.c @@ -1624,23 +1624,27 @@ interface_api_hookup (vlib_main_t * vm) { api_main_t *am = vlibapi_get_main (); + /* + * Set up the (msg_name, crc, message-id) table + */ + REPLY_MSG_ID_BASE = setup_message_id_table (); + /* Mark these APIs as mp safe */ - am->is_mp_safe[VL_API_SW_INTERFACE_DUMP] = 1; - am->is_mp_safe[VL_API_SW_INTERFACE_DETAILS] = 1; - am->is_mp_safe[VL_API_SW_INTERFACE_TAG_ADD_DEL] = 1; - am->is_mp_safe[VL_API_SW_INTERFACE_SET_INTERFACE_NAME] = 1; + am->is_mp_safe[REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_DUMP] = 1; + am->is_mp_safe[REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_DETAILS] = 1; + am->is_mp_safe[REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_TAG_ADD_DEL] = 1; + am->is_mp_safe[REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_SET_INTERFACE_NAME] = + 1; /* Do not replay VL_API_SW_INTERFACE_DUMP messages */ - am->api_trace_cfg[VL_API_SW_INTERFACE_DUMP].replay_enable = 0; + am->api_trace_cfg[REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_DUMP] + .replay_enable = 0; /* Mark these APIs as autoendian */ - am->is_autoendian[VL_API_SW_INTERFACE_SET_TX_PLACEMENT] = 1; - am->is_autoendian[VL_API_SW_INTERFACE_TX_PLACEMENT_GET] = 1; - - /* - * Set up the (msg_name, crc, message-id) table - */ - REPLY_MSG_ID_BASE = setup_message_id_table (); + am->is_autoendian[REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_SET_TX_PLACEMENT] = + 1; + am->is_autoendian[REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_TX_PLACEMENT_GET] = + 1; return 0; } |