22 int verbose = va_arg (*args,
int);
23 session_fifo_event_t _e, *e = &_e;
27 if (verbose > 2 && ss->server_rx_fifo->has_event)
30 s =
format (s,
" session node event: %s\n",
31 found ?
"found" :
"not found");
34 if (verbose > 2 && ss->server_tx_fifo->has_event)
37 s =
format (s,
" session node event: %s\n",
38 found ?
"found" :
"not found");
55 int verbose = va_arg (*args,
int);
61 str =
format (0,
"%-10u%-10u%-10lld",
68 s =
format (s,
"%U", tp_vft->format_connection, ss->connection_index,
69 ss->thread_index, verbose);
77 s =
format (s,
"%-40U%v", tp_vft->format_listener, ss->connection_index,
82 s =
format (s,
"%-40U%v", tp_vft->format_half_open,
83 ss->connection_index, str);
87 clib_warning (
"Session in state: %d!", ss->session_state);
97 u8 *proto = va_arg (*args,
u8 *);
98 ip46_address_t *lcl = va_arg (*args, ip46_address_t *);
99 ip46_address_t *rmt = va_arg (*args, ip46_address_t *);
100 u16 *lcl_port = va_arg (*args,
u16 *);
101 u16 *rmt_port = va_arg (*args,
u16 *);
102 u8 *is_ip4 = va_arg (*args,
u8 *);
105 memset (lcl, 0,
sizeof (*lcl));
106 memset (rmt, 0,
sizeof (*rmt));
138 ip46_address_t lcl, rmt;
139 u32 lcl_port = 0, rmt_port = 0, fib_index = 0;
143 &lcl_port, &rmt_port, &is_ip4))
148 clib_host_to_net_u16 (lcl_port),
149 clib_host_to_net_u16 (rmt_port), proto);
152 clib_host_to_net_u16 (lcl_port),
153 clib_host_to_net_u16 (rmt_port), proto);
167 u32 suggested_proto = va_arg (*args,
u32);
170 ip46_address_t lcl, rmt;
171 u32 lcl_port = 0, rmt_port = 0, fib_index = 0;
175 &lcl_port, &rmt_port, &is_ip4))
178 proto = (proto == (
u8) ~ 0) ? suggested_proto : proto;
179 if (proto == (
u8) ~ 0)
183 clib_host_to_net_u16 (lcl_port),
184 clib_host_to_net_u16 (rmt_port), proto);
187 clib_host_to_net_u16 (lcl_port),
188 clib_host_to_net_u16 (rmt_port), proto);
203 u8 *str = 0, one_session = 0, do_listeners = 0, sst, *app_name;
206 u32 transport_proto = ~0;
208 if (!smm->is_enabled)
215 if (
unformat (input,
"verbose %d", &verbose))
217 else if (
unformat (input,
"verbose"))
248 app_name = application_name_from_index (s->app_index);
249 vlib_cli_output (vm,
"%U%-25v%-10u", format_stream_session, s, 1,
250 app_name, s->session_index);
261 pool = smm->sessions[
i];
272 if (once_per_pool && verbose == 1)
274 str =
format (str,
"%-50s%-15s%-10s%-10s%-10s",
275 "Connection",
"State",
"Rx-f",
"Tx-f",
304 .path =
"show session",
305 .short_help =
"show session [verbose [nnn]]",
314 server->cb_fns.session_disconnect_callback (s);
323 u32 thread_index = 0, clear_all = 0;
324 u32 session_index = ~0;
327 if (!smm->is_enabled)
334 if (
unformat (input,
"thread %d", &thread_index))
336 else if (
unformat (input,
"session %d", &session_index))
345 if (!clear_all && session_index == ~0)
348 if (session_index != ~0)
353 session_index, thread_index);
375 .path =
"clear session",
376 .short_help =
"clear session thread <thread> session <index>",
387 u8 is_rx = 0, *str = 0;
425 .path =
"show session fifo trace",
426 .short_help =
"show session fifo trace <session>",
436 u8 is_rx = 0, *str = 0;
472 .path =
"session replay fifo",
473 .short_help =
"session replay fifo <session>",
491 if (
unformat (line_input,
"enable"))
493 else if (
unformat (line_input,
"disable"))
512 .short_help =
"session [enable|disable]",
sll srl srl sll sra u16x4 i
struct _transport_connection transport_connection_t
format_function_t format_svm_fifo
session_manager_main_t session_manager_main
struct _transport_proto_vft transport_proto_vft_t
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)
static void session_pool_remove_peeker(u32 thread_index)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
transport_connection_t * session_lookup_connection6(u32 fib_index, ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup connection with ip6 and transport layer information.
#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)
struct _stream_session_t stream_session_t
u8 * format_stream_session(u8 *s, va_list *args)
Format stream session as per the following format.
u8 session_node_lookup_fifo_event(svm_fifo_t *f, session_fifo_event_t *e)
transport_connection_t * session_lookup_connection4(u32 fib_index, ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup connection with ip4 and transport layer information.
transport_proto_vft_t * transport_protocol_get_vft(transport_proto_t transport_proto)
Get transport virtual function table.
static transport_proto_t session_get_transport_proto(stream_session_t *s)
stream_session_t * session_lookup_safe6(u32 fib_index, ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup session with ip6 and transport layer information.
uword unformat_transport_connection(unformat_input_t *input, va_list *args)
static stream_session_t * session_get_if_valid(u64 si, u32 thread_index)
struct _session_manager_main session_manager_main_t
u8 * svm_fifo_replay(u8 *s, svm_fifo_t *f, u8 no_read, u8 verbose)
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
uword unformat_stream_session_id(unformat_input_t *input, va_list *args)
static int clear_session(stream_session_t *s)
static session_type_t session_type_from_proto_and_ip(transport_proto_t proto, u8 is_ip4)
static u32 stream_session_get_index(stream_session_t *s)
uword unformat_stream_session(unformat_input_t *input, va_list *args)
#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...)
stream_session_t * session_lookup_safe4(u32 fib_index, ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup session with ip4 and transport layer information.
struct _application application_t
#define VLIB_CLI_COMMAND(x,...)
uword unformat_transport_proto(unformat_input_t *input, va_list *args)
u8 * svm_fifo_dump_trace(u8 *s, svm_fifo_t *f)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
application_t * application_get(u32 index)
static clib_error_t * session_replay_fifo_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * show_session_fifo_trace_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_foreach(var, vec)
Vector iterator.
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,...)
u8 * format_transport_proto(u8 *s, va_list *args)
static uword pool_elts(void *v)
Number of active elements in a pool.