39 memset (sm, 0,
sizeof (*sm));
49 #define _(node_name, node_var, is_out, is_ip6, is_track) \ 51 feat_bitmap_init_next_nodes(vm, node_var.index, L2OUTPUT_N_FEAT, \ 52 l2output_get_feat_names (), \ 53 sm->node_var ## _feat_next_node_index); \ 55 feat_bitmap_init_next_nodes(vm, node_var.index, L2INPUT_N_FEAT, \ 56 l2input_get_feat_names (), \ 57 sm->node_var ## _feat_next_node_index); 65 u8 * prev_node_name,
int add_output_nodes)
69 #define _(node_name, node_var, is_out, is_ip6, is_track) \ 70 if (is_out == add_output_nodes) { \ 71 u32 idx = vlib_node_add_next_with_slot(vm, n->index, node_var.index, ~0); \ 73 sm->next_slot_track_node_by_is_ip6_is_out[is_ip6][is_out] = idx; \ 107 return "<?l4-unknown?>";
127 s->create_time) * ct->seconds_per_clock;
130 s->side[0].active_time) *
131 ct->seconds_per_clock;
134 s->side[1].active_time) *
135 ct->seconds_per_clock;
143 "%5d: create time: %U pkts/bytes/active time: [ %ld %ld %U : %ld %ld %U ]\n",
145 format_time_interval,
"h:m:s:u",
146 ctime, s->side[0].n_packets,
148 format_time_interval,
"h:m:s:u",
149 atime0, s->side[1].n_packets,
151 format_time_interval,
"h:m:s:u",
152 atime1); u8 * out1 = 0;
156 format (0,
"%s %U :%u <-> %U :%u",
157 get_l4_proto_str (s->is_ip6,
160 &s->side[0].addr.ip6,
163 &s->side[1].addr.ip6,
168 format (0,
"%s %U :%u <-> %U :%u",
169 get_l4_proto_str (s->is_ip6,
172 &s->side[0].addr.ip4,
175 &s->side[1].addr.ip4,
196 "attempted to delete sessions which were already free: %d",
204 .path =
"show l2sess",
205 .short_help =
"show l2sess",
210 .path =
"show l2sess count",
211 .short_help =
"show l2sess count",
static vlib_main_t * vlib_get_main(void)
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.
ethernet_main_t * ethernet_main
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
ethernet_main_t * ethernet_main
timing_wheel_t timing_wheel
#define foreach_l2sess_node
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
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
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
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
#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 l2sess_vlib_plugin_register(vlib_main_t *vm, void *hh, int from_early_init)
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.