stream_session_get_index (ss));
if (ss->session_state == SESSION_STATE_READY
- || ss->session_state == SESSION_STATE_ACCEPTING)
+ || ss->session_state == SESSION_STATE_ACCEPTING
+ || ss->session_state == SESSION_STATE_CLOSED)
{
s = format (s, "%U", tp_vft->format_connection, ss->connection_index,
ss->thread_index, verbose);
s = format (s, "%-40U%v", tp_vft->format_half_open,
ss->connection_index, str);
}
- else if (ss->session_state == SESSION_STATE_CLOSED)
- {
- s =
- format (s, "[CL] %U", tp_vft->format_connection, ss->connection_index,
- ss->thread_index, verbose);
- if (verbose == 1)
- s = format (s, "%v", str);
- if (verbose > 1)
- s = format (s, "%U", format_stream_session_fifos, ss, verbose);
- }
else
{
clib_warning ("Session in state: %d!", ss->session_state);
{
*proto = TRANSPORT_PROTO_UDP;
}
- else if (unformat (input, "%U:%d->%U:%d", unformat_ip4_address, &lcl->ip4,
- lcl_port, unformat_ip4_address, &rmt->ip4, rmt_port))
+ if (unformat (input, "%U:%d->%U:%d", unformat_ip4_address, &lcl->ip4,
+ lcl_port, unformat_ip4_address, &rmt->ip4, rmt_port))
{
*is_ip4 = 1;
tuple_is_set = 1;
*is_ip4 = 0;
tuple_is_set = 1;
}
- else
- return 0;
-
- if (tuple_is_set)
- return 1;
- return 0;
+ return tuple_is_set;
}
uword
u8 proto = ~0;
ip46_address_t lcl, rmt;
u32 lcl_port = 0, rmt_port = 0;
- u8 is_ip4 = 0, s_type = ~0, id_is_set = 0;
+ u8 is_ip4 = 0, s_type = ~0;
- if (unformat (input, "%U", unformat_stream_session_id, &proto, &lcl, &rmt,
- &lcl_port, &rmt_port, &is_ip4))
- {
- id_is_set = 1;
- }
- else
+ if (!unformat (input, "%U", unformat_stream_session_id, &proto, &lcl, &rmt,
+ &lcl_port, &rmt_port, &is_ip4))
return 0;
- if (!id_is_set)
- {
- return 0;
- }
-
s_type = session_type_from_proto_and_ip (proto, is_ip4);
if (is_ip4)
s = stream_session_lookup4 (&lcl.ip4, &rmt.ip4,
u8 proto = ~0;
ip46_address_t lcl, rmt;
u32 lcl_port = 0, rmt_port = 0;
- u8 is_ip4 = 0, s_type = ~0, id_is_set = 0;
+ u8 is_ip4 = 0, s_type = ~0;
- if (unformat (input, "%U", unformat_stream_session_id, &proto, &lcl, &rmt,
- &lcl_port, &rmt_port, &is_ip4))
- {
- id_is_set = 1;
- }
- else
+ if (!unformat (input, "%U", unformat_stream_session_id, &proto, &lcl, &rmt,
+ &lcl_port, &rmt_port, &is_ip4))
return 0;
- if (!id_is_set)
- {
- return 0;
- }
-
proto = (proto == (u8) ~ 0) ? suggested_proto : proto;
if (proto == (u8) ~ 0)
return 0;
{
if (once_per_pool && verbose == 1)
{
- str =
- format (str, "%-50s%-15s%-10s%-10s%-10s", "Connection",
- "State", "Rx-f", "Tx-f", "S-idx");
+ str = format (str, "%-50s%-15s%-10s%-10s%-10s",
+ "Connection", "State", "Rx-f", "Tx-f",
+ "S-idx");
vlib_cli_output (vm, "%v", str);
vec_reset_length (str);
once_per_pool = 0;