summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-06-11 12:31:31 -0700
committerDamjan Marion <dmarion@me.com>2019-06-12 20:18:45 +0000
commit87d663337931be870891a809cf86d1ee1974fedf (patch)
tree483c54e128d290f685a13b4b6f130c6f587dfc01 /src/vnet/session/application.h
parent87a9bf8c0399bc5424fbc129e31967cf504810a1 (diff)
session: use session handles as app listener handles
Type: refactor Change-Id: I421750147a8a821bd0b522daf6c2b7239e551f12 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application.h')
-rw-r--r--src/vnet/session/application.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h
index cb83f653b9b..a17270cf142 100644
--- a/src/vnet/session/application.h
+++ b/src/vnet/session/application.h
@@ -74,10 +74,13 @@ typedef struct app_listener_
{
clib_bitmap_t *workers; /**< workers accepting connections */
u32 accept_rotor; /**< last worker to accept a connection */
- u32 al_index;
- u32 app_index;
- u32 local_index;
- u32 session_index;
+ u32 al_index; /**< app listener index in app pool */
+ u32 app_index; /**< owning app index */
+ u32 local_index; /**< local listening session index */
+ u32 session_index; /**< global listening session index */
+ session_handle_t ls_handle; /**< session handle of the local or global
+ listening session that also identifies
+ the app listener */
} app_listener_t;
typedef struct application_
@@ -173,6 +176,28 @@ void app_listener_cleanup (app_listener_t * app_listener);
session_handle_t app_listener_handle (app_listener_t * app_listener);
app_listener_t *app_listener_lookup (application_t * app,
session_endpoint_cfg_t * sep);
+
+/**
+ * Get app listener handle for listening session
+ *
+ * For a given listening session, this can return either the session
+ * handle of the app listener associated to the listening session or,
+ * if no such app listener exists, the session's handle
+ *
+ * @param ls listening session
+ * @return app listener or listening session handle
+ */
+session_handle_t app_listen_session_handle (session_t * ls);
+/**
+ * Get app listener for listener session handle
+ *
+ * Should only be called on handles that have an app listener, i.e.,
+ * were obtained at the end of a @ref vnet_listen call.
+ *
+ * @param handle handle of the app listener. This is the handle of
+ * either the global or local listener
+ * @return pointer to app listener or 0
+ */
app_listener_t *app_listener_get_w_handle (session_handle_t handle);
app_listener_t *app_listener_get_w_session (session_t * ls);
session_t *app_listener_get_session (app_listener_t * al);