summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session/session_cli.c')
-rwxr-xr-xsrc/vnet/session/session_cli.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c
index 95fc48d75df..48c431cafa1 100755
--- a/src/vnet/session/session_cli.c
+++ b/src/vnet/session/session_cli.c
@@ -200,10 +200,10 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
vlib_cli_command_t * cmd)
{
session_manager_main_t *smm = &session_manager_main;
+ u8 *str = 0, one_session = 0, do_listeners = 0, sst, *app_name;
int verbose = 0, i;
- stream_session_t *pool;
- stream_session_t *s;
- u8 *str = 0, one_session = 0;
+ stream_session_t *pool, *s;
+ u32 transport_proto = ~0;
if (!smm->is_enabled)
{
@@ -216,6 +216,9 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
;
else if (unformat (input, "verbose"))
verbose = 1;
+ else if (unformat (input, "listeners %U", unformat_transport_proto,
+ &transport_proto))
+ do_listeners = 1;
else if (unformat (input, "%U", unformat_stream_session, &s))
{
one_session = 1;
@@ -231,6 +234,27 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
return 0;
}
+ if (do_listeners)
+ {
+ sst = session_type_from_proto_and_ip (transport_proto, 1);
+ vlib_cli_output (vm, "There are %d active %U listeners",
+ pool_elts (smm->listen_sessions[sst]),
+ format_transport_proto, transport_proto);
+ if (verbose)
+ {
+ vlib_cli_output (vm, "%-40s%-24s%-10s", "Listener", "App", "S-idx");
+ /* *INDENT-OFF* */
+ pool_foreach (s, smm->listen_sessions[sst], ({
+ app_name = application_name_from_index (s->app_index);
+ vlib_cli_output (vm, "%U%-25v%-10u", format_stream_session, s, 1,
+ app_name, s->session_index);
+ vec_free (app_name);
+ }));
+ /* *INDENT-ON* */
+ }
+ return 0;
+ }
+
for (i = 0; i < vec_len (smm->sessions); i++)
{
u32 once_per_pool;