summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_cli.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-11-09 19:30:17 -0800
committerDave Wallace <dwallacelf@gmail.com>2017-11-10 15:26:48 +0000
commitdbd44561538514f6cfce324419042f2ce69fe214 (patch)
tree28561c30020319e28d7a5f2f444e5cdea9693912 /src/vnet/session/session_cli.c
parentbc3c12623c30cefefb974d3581179be7fb042af3 (diff)
session: use listener logic for proxy rules
This moves session proxy logic from session rules tables to table/logic used to manage session listeners in order to avoid overlap of semantically different rules. Change-Id: I463522cce91b92d942f6a2086fb14c3366b9f023 Signed-off-by: Florin Coras <fcoras@cisco.com>
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;