aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_types.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-08-31 09:45:13 -0700
committerFlorin Coras <fcoras@cisco.com>2019-09-04 10:38:49 -0700
commit5bb23ecd098eac639641e2b3d62eb8744e0efef0 (patch)
tree6a9a4e77ea11641c51b381af7019e409e3f013cf /src/vnet/session/session_types.h
parent8b4114e52f69b9292efb282e49ed4d90699ceeb8 (diff)
session: improve cli
Type: feature Allow session cli filtering based on thread index, transport protocol, session state and range of session pool indices. For instance show session thread 1 proto tcp state ready range 0 20 verbose Shows the session ids for the first 20 tcp sessions in thread 1 that are in ready state. To avoid excessive output that could reasult in the worker barrier being held by the main thread for long periods of time, the session cli will only output: - session ids (verbose == 1) for a maximum of 50 sessions / worker - verbose > 1 details for a maximum of 10 sessions Change-Id: I2cfb351b548e2e0a1d5b4345810be613e2917d17 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_types.h')
-rw-r--r--src/vnet/session/session_types.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h
index 52a79e3beb5..bf45855e264 100644
--- a/src/vnet/session/session_types.h
+++ b/src/vnet/session/session_types.h
@@ -121,21 +121,26 @@ typedef enum
/*
* Session states
*/
+#define foreach_session_state \
+ _(CREATED, "created") \
+ _(LISTENING, "listening") \
+ _(CONNECTING, "connecting") \
+ _(ACCEPTING, "accepting") \
+ _(READY, "ready") \
+ _(OPENED, "opened") \
+ _(TRANSPORT_CLOSING, "transport-closing") \
+ _(CLOSING, "closing") \
+ _(APP_CLOSED, "app-closed") \
+ _(TRANSPORT_CLOSED, "transport-closed") \
+ _(TRANSPORT_DELETED, "transport-deleted") \
+ _(CLOSED, "closed") \
+
typedef enum
{
- SESSION_STATE_CREATED,
- SESSION_STATE_LISTENING,
- SESSION_STATE_CONNECTING,
- SESSION_STATE_ACCEPTING,
- SESSION_STATE_READY,
- SESSION_STATE_OPENED,
- SESSION_STATE_TRANSPORT_CLOSING,
- SESSION_STATE_CLOSING,
- SESSION_STATE_APP_CLOSED,
- SESSION_STATE_TRANSPORT_CLOSED,
- SESSION_STATE_TRANSPORT_DELETED,
- SESSION_STATE_CLOSED,
- SESSION_STATE_N_STATES,
+#define _(sym, str) SESSION_STATE_ ## sym,
+ foreach_session_state
+#undef _
+ SESSION_N_STATES,
} session_state_t;
typedef enum session_flags_