36 #define _(node_name, node_var, is_out, is_ip6, is_track) \ 38 feat_bitmap_init_next_nodes(vm, node_var.index, L2OUTPUT_N_FEAT, \ 39 l2output_get_feat_names (), \ 40 sm->node_var ## _feat_next_node_index); \ 42 feat_bitmap_init_next_nodes(vm, node_var.index, L2INPUT_N_FEAT, \ 43 l2input_get_feat_names (), \ 44 sm->node_var ## _feat_next_node_index); 52 u8 * prev_node_name,
int add_output_nodes)
56 #define _(node_name, node_var, is_out, is_ip6, is_track) \ 57 if (is_out == add_output_nodes) { \ 58 u32 idx = vlib_node_add_next_with_slot(vm, n->index, node_var.index, ~0); \ 60 sm->next_slot_track_node_by_is_ip6_is_out[is_ip6][is_out] = idx; \ 94 return "<?l4-unknown?>";
114 s->create_time) * ct->seconds_per_clock;
117 s->side[0].active_time) *
118 ct->seconds_per_clock;
121 s->side[1].active_time) *
122 ct->seconds_per_clock;
130 "%5d: create time: %U pkts/bytes/active time: [ %ld %ld %U : %ld %ld %U ]\n",
132 format_time_interval,
"h:m:s:u",
133 ctime, s->side[0].n_packets,
135 format_time_interval,
"h:m:s:u",
136 atime0, s->side[1].n_packets,
138 format_time_interval,
"h:m:s:u",
139 atime1); u8 * out1 = 0;
143 format (0,
"%s %U :%u <-> %U :%u",
144 get_l4_proto_str (s->is_ip6,
147 &s->side[0].addr.ip6,
150 &s->side[1].addr.ip6,
155 format (0,
"%s %U :%u <-> %U :%u",
156 get_l4_proto_str (s->is_ip6,
159 &s->side[0].addr.ip4,
162 &s->side[1].addr.ip4,
183 "attempted to delete sessions which were already free: %d",
191 .path =
"show l2sess",
192 .short_help =
"show l2sess",
197 .path =
"show l2sess count",
198 .short_help =
"show l2sess count",
void timing_wheel_init(timing_wheel_t *w, u64 current_cpu_time, f64 cpu_clocks_per_second)
static clib_error_t * l2sess_show_count_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u64 clib_cpu_time_now(void)
#define vec_alloc(V, N)
Allocate space for N more elements (no header, unspecified alignment)
#define pool_len(p)
Number of elements in pool vector.
static char * get_l4_proto_str(int is_ip6, uint8_t l4_proto)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
void l2sess_init_next_features(vlib_main_t *vm, l2sess_main_t *sm)
#define VLIB_INIT_FUNCTION(x)
format_function_t format_timing_wheel
timing_wheel_t timing_wheel
#define foreach_l2sess_node
static clib_error_t * l2sess_init(vlib_main_t *vm)
#define vec_free(V)
Free vector's memory (no header).
foreach_l2sess_node l2_output_next_nodes_st output_next_nodes
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
static u64 time_sec_to_clock(clib_time_t *ct, f64 sec)
#define VLIB_CLI_COMMAND(x,...)
u64 timer_wheel_next_expiring_time
u32 * data_from_advancing_timing_wheel
l2sess_main_t l2sess_main
static vlib_main_t * vlib_get_main(void)
#define UDP_SESSION_IDLE_TIMEOUT_SEC
u32 * output_node_index_vec
#define TCP_SESSION_IDLE_TIMEOUT_SEC
static clib_error_t * l2sess_show_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void l2sess_setup_nodes(void)
u64 udp_session_idle_timeout
u64 counter_attempted_delete_free_session
void l2sess_add_our_next_nodes(vlib_main_t *vm, l2sess_main_t *sm, u8 *prev_node_name, int add_output_nodes)
u64 tcp_session_transient_timeout
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static void l2output_init_output_node_vec(u32 **output_node_index_vec)
u64 tcp_session_idle_timeout
#define TCP_SESSION_TRANSIENT_TIMEOUT_SEC
static uword pool_elts(void *v)
Number of active elements in a pool.