diff options
author | Florin Coras <fcoras@cisco.com> | 2019-02-22 13:11:38 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-02-23 09:41:17 +0000 |
commit | ba7d8f5a3d4078d673486fbb91fe0ce87dfe7230 (patch) | |
tree | 84091faa4acbdd08c6a4386614bdb582f1d7dbfd /src/vnet/session/application.c | |
parent | b691f768a1427094f6788a2f4f268ccfe7e9d15b (diff) |
session: separate local session logic
Move local session to separate header and source files. First step to
refactoring local sessions.
Change-Id: I280fdfef20ba8a0977d15c1c8ce030ea2fb72dde
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application.c')
-rw-r--r-- | src/vnet/session/application.c | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c index 3bf722b81a0..954b934c138 100644 --- a/src/vnet/session/application.c +++ b/src/vnet/session/application.c @@ -16,6 +16,7 @@ #include <vnet/session/application.h> #include <vnet/session/application_interface.h> #include <vnet/session/application_namespace.h> +#include <vnet/session/application_local.h> #include <vnet/session/session.h> static app_main_t app_main; @@ -27,16 +28,6 @@ static app_main_t app_main; return 0; \ } -static void -application_local_listener_session_endpoint (local_session_t * ll, - session_endpoint_t * sep) -{ - sep->transport_proto = - session_type_transport_proto (ll->listener_session_type); - sep->port = ll->port; - sep->is_ip4 = ll->listener_session_type & 1; -} - static app_listener_t * app_listener_alloc (application_t * app) { @@ -65,27 +56,6 @@ app_listener_free (application_t * app, app_listener_t * app_listener) clib_memset (app_listener, 0xfa, sizeof (*app_listener)); } -local_session_t * -application_local_listen_session_alloc (application_t * app) -{ - local_session_t *ll; - pool_get_zero (app->local_listen_sessions, ll); - ll->session_index = ll - app->local_listen_sessions; - ll->session_type = session_type_from_proto_and_ip (TRANSPORT_PROTO_NONE, 0); - ll->app_index = app->app_index; - ll->session_state = SESSION_STATE_LISTENING; - return ll; -} - -void -application_local_listen_session_free (application_t * app, - local_session_t * ll) -{ - pool_put (app->local_listen_sessions, ll); - if (CLIB_DEBUG) - clib_memset (ll, 0xfb, sizeof (*ll)); -} - static u32 app_listener_id (app_listener_t * al) { @@ -227,7 +197,7 @@ app_listener_alloc_and_init (application_t * app, * lookups, prior to establishing connection. Requests transport to * build it's own specific listening connection. */ - ls = listen_session_new (0, st); + ls = listen_session_alloc (0, st); ls->app_index = app->app_index; ls->app_wrk_index = sep->app_wrk_index; @@ -266,7 +236,7 @@ app_listener_cleanup (app_listener_t * al) { session_t *ls = session_get (al->session_index, 0); session_stop_listen (ls); - listen_session_del (ls); + listen_session_free (ls); } if (al->local_index != SESSION_INVALID_INDEX) { |