64 s =
format (s,
"l2-output-acl: sw_if_index %d dst %U src %U",
75 #define foreach_l2_outacl_error \ 76 _(L2_OUTACL, "L2 output ACL packets") \ 77 _(DROP, "L2 output drops") 81 #define _(sym,str) L2_OUTACL_ERROR_##sym, 88 #define _(sym,string) string, 105 u32 n_left_from, *from, *to_next;
111 u32 cached_sw_if_index = (
u32) ~ 0;
112 u32 cached_next_index = (
u32) ~ 0;
118 while (n_left_from > 0)
125 while (0 && n_left_from >= 4 && n_left_to_next >= 2)
130 u32 sw_if_index0, sw_if_index1;
149 to_next[0] = bi0 = from[0];
150 to_next[1] = bi1 = from[1];
185 em->
counters[node_counter_base_index + L2_OUTACL_ERROR_L2_OUTACL] +=
193 to_next, n_left_to_next,
194 bi0, bi1, next0, next1);
197 while (n_left_from > 0 && n_left_to_next > 0)
229 em->
counters[node_counter_base_index + L2_OUTACL_ERROR_L2_OUTACL] +=
240 vnet_buffer (b0)->l2.feature_bitmap & ~L2OUTPUT_FEAT_ACL;
250 b0, sw_if_index0, feature_bitmap0, &next0);
254 to_next, n_left_to_next,
268 .name =
"l2-output-acl",
269 .vector_size =
sizeof (
u32),
345 .path =
"set interface acl output",
346 .short_help =
"set interface acl output <interface> [disable]",
347 .function = int_l2_outacl,
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
char ** l2output_get_feat_names(void)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
struct _vlib_node_registration vlib_node_registration_t
unformat_function_t unformat_vnet_sw_interface
static uword l2_outacl_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vnet_main_t * vnet_get_main(void)
u8 * format_ethernet_address(u8 *s, va_list *args)
#define VLIB_INIT_FUNCTION(x)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
void l2output_intf_bitmap_enable(u32 sw_if_index, u32 feature_bitmap, u32 enable)
Enable (or disable) the feature in the bitmap for the given interface.
u32 feat_next_node_index[32]
vlib_error_main_t error_main
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
static vlib_node_registration_t l2_outacl_node
(constructor) VLIB_REGISTER_NODE (l2_outacl_node)
#define CLIB_PREFETCH(addr, size, type)
static u8 * format_l2_outacl_trace(u8 *s, va_list *args)
static void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)
Initialize the feature next-node indexes of a graph node.
#define clib_memcpy(a, b, c)
l2_output_next_nodes_st next_nodes
#define VLIB_CLI_COMMAND(x,...)
#define VLIB_NODE_FLAG_TRACE
#define VLIB_BUFFER_IS_TRACED
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
u32 * output_node_index_vec
clib_error_t * l2_outacl_init(vlib_main_t *vm)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static char * l2_outacl_error_strings[]
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
l2_outacl_main_t l2_outacl_main
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
#define clib_error_return(e, args...)
static void l2_output_dispatch(vlib_main_t *vlib_main, vnet_main_t *vnet_main, vlib_node_runtime_t *node, u32 node_index, u32 *cached_sw_if_index, u32 *cached_next_index, l2_output_next_nodes_st *next_nodes, vlib_buffer_t *b0, u32 sw_if_index, u32 feature_bitmap, u32 *next0)
Determine the next L2 node based on the output feature bitmap.
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static void l2output_init_output_node_vec(u32 **output_node_index_vec)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define foreach_l2_outacl_error