summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-11-13 15:52:38 -0800
committerDamjan Marion <dmarion@me.com>2018-11-18 19:46:38 +0000
commit053a0e44edb21713e0825f9c09ba4af12e686b38 (patch)
tree950e303daf1b367eab26cc823c0efc23ae170b1d /src/vnet/session/application.h
parent0c4fec0134f32bc913299b37d048a99293b1a851 (diff)
vcl/session: apps with process workers
Allow apps to register child processes as app workers. In particular, on fork vcl now registers the child process with vpp as a new worker. Change-Id: I52a65fbc3292962b1f6e1fe0f6153f739e6e0d4a Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application.h')
-rw-r--r--src/vnet/session/application.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h
index 3888cf7f463..9c68433d5e9 100644
--- a/src/vnet/session/application.h
+++ b/src/vnet/session/application.h
@@ -101,6 +101,9 @@ typedef struct app_worker_
/** Hash table of the app's local connects */
uword *local_connects;
+ /** API index for the worker. Needed for multi-process apps */
+ u32 api_index;
+
u8 app_is_builtin;
} app_worker_t;
@@ -121,7 +124,8 @@ typedef struct application_
/** App index in app pool */
u32 app_index;
- /** Binary API connection index, ~0 if internal */
+ /** Binary API connection index of app process that created the app,
+ * ~0 if internal */
u32 api_client_index;
/** Flags */
@@ -210,6 +214,7 @@ typedef struct _vnet_app_worker_add_del_args
{
u32 app_index; /**< App for which a new worker is requested */
u32 wrk_index; /**< Index to delete or return value if add */
+ u32 api_index; /**< Binary API client index */
ssvm_private_t *segment; /**< First segment in segment manager */
svm_msg_q_t *evt_q; /**< Worker message queue */
u8 is_add; /**< Flag set if addition */
@@ -251,6 +256,7 @@ int application_stop_listen (u32 app_index, u32 app_or_wrk,
application_t *application_alloc (void);
int application_alloc_and_init (app_init_args_t * args);
void application_free (application_t * app);
+void application_detach_process (application_t * app, u32 api_client_index);
application_t *application_get (u32 index);
application_t *application_get_if_valid (u32 index);
application_t *application_lookup (u32 api_client_index);
@@ -268,7 +274,7 @@ int application_is_builtin (application_t * app);
int application_is_builtin_proxy (application_t * app);
u32 application_session_table (application_t * app, u8 fib_proto);
u32 application_local_session_table (application_t * app);
-u8 *application_name_from_index (u32 app_or_wrk);
+const u8 *application_name_from_index (u32 app_or_wrk);
u8 application_has_local_scope (application_t * app);
u8 application_has_global_scope (application_t * app);
u8 application_use_mq_for_ctrl (application_t * app);