30 int verbose = va_arg (*args,
int);
37 str =
format (0,
"%-20llp%-20llp%-15lld", ss->server_rx_fifo,
42 s =
format (s,
"%-40U%v", tp_vft->format_connection,
43 ss->connection_index, ss->thread_index, str);
47 s =
format (s,
"%-40U%v", tp_vft->format_listener, ss->connection_index,
53 format (s,
"%-40U%v", tp_vft->format_half_open, ss->connection_index,
58 s =
format (s,
"[CL] %-40U%v", tp_vft->format_connection,
59 ss->connection_index, ss->thread_index, str);
63 clib_warning (
"Session in state: %d!", ss->session_state);
97 pool = smm->sessions[
i];
110 str =
format (str,
"%-40s%-20s%-20s%-15s",
111 "Connection",
"Rx fifo",
"Tx fifo",
137 .path =
"show session",
138 .short_help =
"show session [verbose]",
148 u32 thread_index = 0;
149 u32 session_index = ~0;
153 if (!smm->is_enabled)
160 if (
unformat (input,
"thread %d", &thread_index))
162 else if (
unformat (input,
"session %d", &session_index))
169 if (session_index == ~0)
172 if (thread_index >
vec_len (smm->sessions))
174 thread_index,
vec_len (smm->sessions));
176 pool = smm->sessions[thread_index];
185 server->cb_fns.session_disconnect_callback (session);
193 .path =
"clear session",
194 .short_help =
"clear session thread <thread> session <index>",
209 else if (
unformat (input,
"disable"))
223 .short_help =
"session [enable|disable]",
sll srl srl sll sra u16x4 i
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)
#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.
#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).
#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.