summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_cli.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-04-13 06:39:07 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-04-16 07:33:57 +0000
commit5c9083d52646153bdc917a7ae37da696d864ad1c (patch)
treeb28635fbfb3d443597526bd67625dce007d23186 /src/vnet/session/session_cli.c
parente8fa6209de1bf4f89cd57fcc09dfdc6086b92df9 (diff)
session: use generic session pool for listeners
Change-Id: I825f3822910a6ee368b9004e39ca16ac6833e30c Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_cli.c')
-rwxr-xr-xsrc/vnet/session/session_cli.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c
index 929e604b01e..52833554a53 100755
--- a/src/vnet/session/session_cli.c
+++ b/src/vnet/session/session_cli.c
@@ -61,7 +61,7 @@ format_stream_session (u8 * s, va_list * args)
str = format (0, "%-10u%-10u%-10lld",
svm_fifo_max_dequeue (ss->server_rx_fifo),
svm_fifo_max_enqueue (ss->server_tx_fifo),
- stream_session_get_index (ss));
+ session_get_index (ss));
if (ss->session_state >= SESSION_STATE_ACCEPTING)
{
@@ -237,21 +237,18 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
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* */
- }
+ vlib_cli_output (vm, "%-40s%-24s%-10s", "Listener", "App", "S-idx");
+ /* *INDENT-OFF* */
+ pool_foreach (s, smm->sessions[0], ({
+ if (s->session_state != SESSION_STATE_LISTENING
+ || s->session_type != sst)
+ continue;
+ 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;
}