39 int verbose = va_arg (*args,
int);
45 str =
format (0,
"%-10u%-10u%-10lld",
52 s =
format (s,
"%U", tp_vft->format_connection, ss->connection_index,
53 ss->thread_index, verbose);
61 s =
format (s,
"%-40U%v", tp_vft->format_listener, ss->connection_index,
66 s =
format (s,
"%-40U%v", tp_vft->format_half_open,
67 ss->connection_index, str);
71 s =
format (s,
"[CL] %-40U", tp_vft->format_connection,
72 ss->connection_index, ss->thread_index, verbose);
80 clib_warning (
"Session in state: %d!", ss->session_state);
105 if (
unformat (input,
"verbose %d", &verbose))
107 else if (
unformat (input,
"verbose"))
116 pool = smm->sessions[
i];
127 if (once_per_pool && verbose == 1)
130 format (str,
"%-50s%-15s%-10s%-10s%-10s",
"Connection",
131 "State",
"Rx-f",
"Tx-f",
"S-idx");
158 .path =
"show session",
159 .short_help =
"show session [verbose]",
169 u32 thread_index = 0;
170 u32 session_index = ~0;
174 if (!smm->is_enabled)
181 if (
unformat (input,
"thread %d", &thread_index))
183 else if (
unformat (input,
"session %d", &session_index))
190 if (session_index == ~0)
193 if (thread_index >
vec_len (smm->sessions))
195 thread_index,
vec_len (smm->sessions));
197 pool = smm->sessions[thread_index];
206 server->cb_fns.session_disconnect_callback (session);
214 .path =
"clear session",
215 .short_help =
"clear session thread <thread> session <index>",
230 else if (
unformat (input,
"disable"))
244 .short_help =
"session [enable|disable]",
sll srl srl sll sra u16x4 i
format_function_t format_svm_fifo
session_manager_main_t session_manager_main
static clib_error_t * clear_session_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u32 svm_fifo_max_enqueue(svm_fifo_t *f)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
struct _stream_session_t stream_session_t
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static u32 svm_fifo_max_dequeue(svm_fifo_t *f)
#define clib_error_return(e, args...)
static clib_error_t * show_session_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u8 * format_stream_session(u8 *s, va_list *args)
Format stream session as per the following format.
struct _transport_proto_vft transport_proto_vft_t
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
struct _session_manager_main session_manager_main_t
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
static u32 stream_session_get_index(stream_session_t *s)
#define vec_free(V)
Free vector's memory (no header).
u8 * format_stream_session_fifos(u8 *s, va_list *args)
#define clib_warning(format, args...)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
struct _application application_t
#define VLIB_CLI_COMMAND(x,...)
transport_proto_vft_t * session_get_transport_vft(u8 type)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
application_t * application_get(u32 index)
static clib_error_t * session_enable_disable_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static uword pool_elts(void *v)
Number of active elements in a pool.