diff options
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/application_local.c | 8 | ||||
-rw-r--r-- | src/vnet/session/session_cli.c | 7 | ||||
-rw-r--r-- | src/vnet/session/session_types.h | 3 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/vnet/session/application_local.c b/src/vnet/session/application_local.c index 814350018bb..beca5dbe689 100644 --- a/src/vnet/session/application_local.c +++ b/src/vnet/session/application_local.c @@ -516,9 +516,9 @@ format_ct_listener (u8 * s, va_list * args) u32 __clib_unused thread_index = va_arg (*args, u32); u32 __clib_unused verbose = va_arg (*args, u32); ct_connection_t *ct = ct_connection_get (tc_index); - s = format (s, "%-50U", format_ct_connection_id, ct); + s = format (s, "%-" SESSION_CLI_ID_LEN "U", format_ct_connection_id, ct); if (verbose) - s = format (s, "%-15s", "LISTEN"); + s = format (s, "%-" SESSION_CLI_STATE_LEN "s", "LISTEN"); return s; } @@ -530,10 +530,10 @@ format_ct_connection (u8 * s, va_list * args) if (!ct) return s; - s = format (s, "%-50U", format_ct_connection_id, ct); + s = format (s, "%-" SESSION_CLI_ID_LEN "U", format_ct_connection_id, ct); if (verbose) { - s = format (s, "%-15s", "ESTABLISHED"); + s = format (s, "%-" SESSION_CLI_STATE_LEN "s", "ESTABLISHED"); if (verbose > 1) { s = format (s, "\n"); diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c index 9f6d74c031d..ade76ef4e60 100644 --- a/src/vnet/session/session_cli.c +++ b/src/vnet/session/session_cli.c @@ -329,7 +329,8 @@ session_cli_show_all_sessions (vlib_main_t * vm, int verbose) } if (verbose == 1) - vlib_cli_output (vm, "%s%-50s%-15s%-10s%-10s", + vlib_cli_output (vm, "%s%-" SESSION_CLI_ID_LEN "s%-" + SESSION_CLI_STATE_LEN "s%-10s%-10s", thread_index ? "\n" : "", "Connection", "State", "Rx-f", "Tx-f"); @@ -617,7 +618,9 @@ 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, "%-50s%-24s", "Listener", "App"); + vlib_cli_output (vm, "%-" SESSION_CLI_ID_LEN "s%-24s", "Listener", + "App"); + /* *INDENT-OFF* */ pool_foreach (s, smm->wrk[0].sessions, ({ if (s->session_state != SESSION_STATE_LISTENING diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h index 8cea29a8642..950066a958d 100644 --- a/src/vnet/session/session_types.h +++ b/src/vnet/session/session_types.h @@ -495,6 +495,9 @@ typedef enum session_error_ #undef _ } session_error_t; +#define SESSION_CLI_ID_LEN "60" +#define SESSION_CLI_STATE_LEN "15" + /* Maintained for compatibility. Will be deprecated */ #define SESSION_ERROR_SEG_CREATE SESSION_E_SEG_CREATE #define SESSION_ERROR_NO_SPACE SESSION_E_SEG_NO_SPACE |