aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-02-03 19:28:34 -0800
committerDave Barach <openvpp@barachs.net>2019-02-05 15:01:08 +0000
commit623eb5676689f6874716857a1085d0efd4974c4c (patch)
tree8d880ffa262d9f49b32683896ace973e4c3870f2 /src/vnet/session/application.h
parenta09c1ff5b6ae535932b4fc9477ffc4e39748ca62 (diff)
session: cleanup part 2
Move app worker logic to app_worker.c Change-Id: Ic5e5735b2884f006c064d023f491aa6888114810 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application.h')
-rw-r--r--src/vnet/session/application.h112
1 files changed, 59 insertions, 53 deletions
diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h
index 0f8dbe3909b..54f998996e9 100644
--- a/src/vnet/session/application.h
+++ b/src/vnet/session/application.h
@@ -175,11 +175,6 @@ typedef struct app_main_
application_t *app_pool;
/**
- * Pool of workers associated to apps
- */
- app_worker_t *workers;
-
- /**
* Hash table of apps by api client index
*/
uword *app_by_api_client_index;
@@ -220,37 +215,6 @@ typedef struct _vnet_app_worker_add_del_args
#define APP_NS_INVALID_INDEX ((u32)~0)
#define APP_INVALID_SEGMENT_MANAGER_INDEX ((u32) ~0)
-app_worker_t *app_worker_alloc (application_t * app);
-int app_worker_alloc_and_init (application_t * app, app_worker_t ** wrk);
-app_worker_t *app_worker_get (u32 wrk_index);
-app_worker_t *app_worker_get_if_valid (u32 wrk_index);
-application_t *app_worker_get_app (u32 wrk_index);
-int app_worker_own_session (app_worker_t * app_wrk, session_t * s);
-void app_worker_free (app_worker_t * app_wrk);
-int app_worker_open_session (app_worker_t * app, session_endpoint_t * tep,
- u32 api_context);
-segment_manager_t *app_worker_get_listen_segment_manager (app_worker_t *,
- session_t *);
-segment_manager_t *app_worker_get_connect_segment_manager (app_worker_t *);
-segment_manager_t
- * app_worker_get_or_alloc_connect_segment_manager (app_worker_t *);
-int app_worker_alloc_connects_segment_manager (app_worker_t * app);
-int app_worker_add_segment_notify (u32 app_or_wrk, u64 segment_handle);
-u32 app_worker_n_listeners (app_worker_t * app);
-session_t *app_worker_first_listener (app_worker_t * app,
- u8 fib_proto, u8 transport_proto);
-u8 app_worker_application_is_builtin (app_worker_t * app_wrk);
-int app_worker_send_event (app_worker_t * app, session_t * s, u8 evt);
-int app_worker_lock_and_send_event (app_worker_t * app, session_t * s,
- u8 evt_type);
-clib_error_t *vnet_app_worker_add_del (vnet_app_worker_add_del_args_t * a);
-
-int application_start_listen (application_t * app,
- session_endpoint_cfg_t * tep,
- session_handle_t * handle);
-int application_stop_listen (u32 app_index, u32 app_or_wrk,
- session_handle_t handle);
-
application_t *application_alloc (void);
int application_alloc_and_init (app_init_args_t * args);
void application_free (application_t * app);
@@ -263,7 +227,12 @@ app_worker_t *application_get_worker (application_t * app, u32 wrk_index);
app_worker_t *application_get_default_worker (application_t * app);
app_worker_t *application_listener_select_worker (session_t * ls,
u8 is_local);
-
+int application_start_listen (application_t * app,
+ session_endpoint_cfg_t * tep,
+ session_handle_t * handle);
+int application_stop_listen (u32 app_index, u32 app_or_wrk,
+ session_handle_t handle);
+int application_change_listener_owner (session_t * s, app_worker_t * app_wrk);
int application_is_proxy (application_t * app);
int application_is_builtin (application_t * app);
int application_is_builtin_proxy (application_t * app);
@@ -283,16 +252,52 @@ segment_manager_properties_t
* application_segment_manager_properties (application_t * app);
/*
+ * App worker
+ */
+
+app_worker_t *app_worker_alloc (application_t * app);
+int application_alloc_worker_and_init (application_t * app,
+ app_worker_t ** wrk);
+app_worker_t *app_worker_get (u32 wrk_index);
+app_worker_t *app_worker_get_if_valid (u32 wrk_index);
+application_t *app_worker_get_app (u32 wrk_index);
+int app_worker_own_session (app_worker_t * app_wrk, session_t * s);
+void app_worker_free (app_worker_t * app_wrk);
+int app_worker_open_session (app_worker_t * app, session_endpoint_t * tep,
+ u32 api_context);
+int app_worker_start_listen (app_worker_t * app_wrk, session_t * ls);
+int app_worker_stop_listen (app_worker_t * app_wrk, session_handle_t handle);
+segment_manager_t *app_worker_get_listen_segment_manager (app_worker_t *,
+ session_t *);
+segment_manager_t *app_worker_get_connect_segment_manager (app_worker_t *);
+segment_manager_t
+ * app_worker_get_or_alloc_connect_segment_manager (app_worker_t *);
+int app_worker_alloc_connects_segment_manager (app_worker_t * app);
+int app_worker_add_segment_notify (u32 app_or_wrk, u64 segment_handle);
+u32 app_worker_n_listeners (app_worker_t * app);
+session_t *app_worker_first_listener (app_worker_t * app,
+ u8 fib_proto, u8 transport_proto);
+u8 app_worker_application_is_builtin (app_worker_t * app_wrk);
+int app_worker_send_event (app_worker_t * app, session_t * s, u8 evt);
+int app_worker_lock_and_send_event (app_worker_t * app, session_t * s,
+ u8 evt_type);
+session_t *app_worker_proxy_listener (app_worker_t * app, u8 fib_proto,
+ u8 transport_proto);
+u8 *format_app_worker (u8 * s, va_list * args);
+u8 *format_app_worker_listener (u8 * s, va_list * args);
+void app_worker_format_connects (app_worker_t * app_wrk, int verbose);
+clib_error_t *vnet_app_worker_add_del (vnet_app_worker_add_del_args_t * a);
+
+/*
* Local session
*/
-local_session_t *application_local_session_alloc (app_worker_t * app);
-void application_local_session_free (app_worker_t * app,
- local_session_t * ls);
-local_session_t *application_get_local_session (app_worker_t * app,
- u32 session_index);
-local_session_t *application_get_local_session_from_handle (session_handle_t
- handle);
+local_session_t *app_worker_local_session_alloc (app_worker_t * app);
+void app_worker_local_session_free (app_worker_t * app, local_session_t * ls);
+local_session_t *app_worker_get_local_session (app_worker_t * app,
+ u32 session_index);
+local_session_t *app_worker_get_local_session_from_handle (session_handle_t
+ handle);
local_session_t
* application_get_local_listen_session_from_handle (session_handle_t lh);
int application_start_local_listen (application_t * server,
@@ -300,15 +305,16 @@ int application_start_local_listen (application_t * server,
session_handle_t * handle);
int application_stop_local_listen (u32 app_index, u32 app_or_wrk,
session_handle_t lh);
-int application_local_session_connect (app_worker_t * client,
- app_worker_t * server,
- local_session_t * ls, u32 opaque);
-int application_local_session_connect_notify (local_session_t * ls);
-int application_local_session_disconnect (u32 app_or_wrk,
- local_session_t * ls);
-int application_local_session_disconnect_w_index (u32 app_or_wrk,
- u32 ls_index);
-void app_worker_local_sessions_free (app_worker_t * app);
+int app_worker_local_session_connect (app_worker_t * client,
+ app_worker_t * server,
+ local_session_t * ls, u32 opaque);
+int app_worker_local_session_connect_notify (local_session_t * ls);
+int app_worker_local_session_disconnect (u32 app_or_wrk,
+ local_session_t * ls);
+int app_worker_local_session_disconnect_w_index (u32 app_or_wrk,
+ u32 ls_index);
+void app_worker_format_local_sessions (app_worker_t * app_wrk, int verbose);
+void app_worker_format_local_connects (app_worker_t * app, int verbose);
always_inline u32
local_session_id (local_session_t * ls)