aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_private.h
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_private.h
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_private.h')
-rw-r--r--src/vcl/vcl_private.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 7e1d35b2205..bbcc3fabedb 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -214,6 +214,7 @@ typedef struct vppcom_cfg_t_
f64 accept_timeout;
u32 event_ring_size;
char *event_log_path;
+ u8 *vpp_app_socket_api; /**< app socket api socket file name */
u8 *vpp_bapi_filename; /**< bapi shm transport file name */
u8 *vpp_bapi_socket_name; /**< bapi socket transport socket name */
u8 *vpp_bapi_chroot;
@@ -302,6 +303,7 @@ typedef struct vcl_worker_
u32 forked_child;
+ clib_socket_t app_api_sock;
socket_client_main_t bapi_sock_ctx;
memory_client_main_t bapi_shm_ctx;
api_main_t bapi_api_ctx;
@@ -667,6 +669,12 @@ vcl_session_vpp_evt_q (vcl_worker_t * wrk, vcl_session_t * s)
return wrk->vpp_event_queues[s->vpp_thread_index];
}
+static inline u64
+vcl_vpp_worker_segment_handle (u32 wrk_index)
+{
+ return (VCL_INVALID_SEGMENT_HANDLE - wrk_index - 1);
+}
+
void vcl_send_session_worker_update (vcl_worker_t * wrk, vcl_session_t * s,
u32 wrk_index);
int vcl_send_worker_rpc (u32 dst_wrk_index, void *data, u32 data_len);
@@ -683,6 +691,7 @@ int vcl_bapi_attach (void);
int vcl_bapi_app_worker_add (void);
void vcl_bapi_app_worker_del (vcl_worker_t * wrk);
void vcl_bapi_disconnect_from_vpp (void);
+int vcl_bapi_recv_fds (vcl_worker_t * wrk, int *fds, int n_fds);
void vcl_bapi_send_application_tls_cert_add (vcl_session_t * session,
char *cert, u32 cert_len);
void vcl_bapi_send_application_tls_key_add (vcl_session_t * session,
@@ -690,6 +699,15 @@ void vcl_bapi_send_application_tls_key_add (vcl_session_t * session,
u32 vcl_bapi_max_nsid_len (void);
int vcl_bapi_worker_set (void);
+/*
+ * VCL Socket API
+ */
+int vcl_sapi_attach (void);
+int vcl_sapi_app_worker_add (void);
+void vcl_sapi_app_worker_del (vcl_worker_t * wrk);
+void vcl_sapi_detach (vcl_worker_t * wrk);
+int vcl_sapi_recv_fds (vcl_worker_t * wrk, int *fds, int n_fds);
+
#endif /* SRC_VCL_VCL_PRIVATE_H_ */
/*