aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_bapi.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-09-08 22:43:47 -0700
committerFlorin Coras <florin.coras@gmail.com>2020-09-14 14:33:50 +0000
commit935ce75cb060da34991e6b02bec5680445f85323 (patch)
tree1afceb3650b40c60ae9a83937e1ae839c9aee40a /src/vcl/vcl_bapi.c
parentb88de908101081f870d94e1415659326b589b9ce (diff)
vcl: add support for app socket api
To enable add "app-socket-api /path/to/socket" to vcl.conf. On vpp side, add use-app-socket-api to session stanza in startup.conf VPP allocates a socket per application namespace which it places in the app_ns_sockets subfolder of the run folder (default /var/run/vpp). The socket used implicitly selects the app namespace for the vcl app. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifc14b93dcbf6ef9bed1852d46cd069f4855b92ef
Diffstat (limited to 'src/vcl/vcl_bapi.c')
-rw-r--r--src/vcl/vcl_bapi.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/vcl/vcl_bapi.c b/src/vcl/vcl_bapi.c
index d3a27acaced..900fb966242 100644
--- a/src/vcl/vcl_bapi.c
+++ b/src/vcl/vcl_bapi.c
@@ -61,12 +61,6 @@ static void
vcm->bapi_app_state = STATE_APP_ENABLED;
}
-static u64
-vcl_vpp_worker_segment_handle (u32 wrk_index)
-{
- return (VCL_INVALID_SEGMENT_HANDLE - wrk_index - 1);
-}
-
static void
vl_api_app_attach_reply_t_handler (vl_api_app_attach_reply_t * mp)
{
@@ -691,6 +685,21 @@ vcl_bapi_app_worker_del (vcl_worker_t * wrk)
}
int
+vcl_bapi_recv_fds (vcl_worker_t * wrk, int *fds, int n_fds)
+{
+ clib_error_t *err;
+
+ if ((err = vl_socket_client_recv_fd_msg2 (&wrk->bapi_sock_ctx, fds, n_fds,
+ 5)))
+ {
+ clib_error_report (err);
+ return -1;
+ }
+
+ return 0;
+}
+
+int
vppcom_session_tls_add_cert (uint32_t session_handle, char *cert,
uint32_t cert_len)
{