16 #include <netinet/in.h> 41 u32 match_acl_in_index;
49 #define foreach_acl_fa_error \ 50 _(ACL_DROP, "ACL deny packets") \ 51 _(ACL_PERMIT, "ACL permit packets") \ 52 _(ACL_NEW_SESSION, "new sessions added") \ 53 _(ACL_EXIST_SESSION, "existing session packets") \ 54 _(ACL_CHECK, "checked packets") \ 55 _(ACL_RESTART_SESSION_TIMER, "restart session timer") \ 56 _(ACL_TOO_MANY_SESSIONS, "too many sessions to add new") \ 61 #define _(sym,str) ACL_FA_ERROR_##sym, 84 s =
format (s,
"%s: sw_if_index %d next_index %x ethertype %x",
85 is_output ?
"OUT-ETHER-WHITELIST" :
"IN-ETHER-WHITELIST",
102 #define foreach_nonip_in_error \ 103 _(DROP, "dropped inbound non-whitelisted non-ip packets") \ 104 _(PERMIT, "permitted inbound whitelisted non-ip packets") \ 107 #define foreach_nonip_out_error \ 108 _(DROP, "dropped outbound non-whitelisted non-ip packets") \ 109 _(PERMIT, "permitted outbound whitelisted non-ip packets") \ 116 #define _(sym,str) FA_IN_NONIP_ERROR_##sym, 123 #define _(sym,string) string, 130 #define _(sym,str) FA_OUT_NONIP_ERROR_##sym, 137 #define _(sym,string) string, 157 for (i = 0; i <
vec_len (whitelist); i++)
158 if (whitelist[i] == ethertype)
163 #define get_u16(addr) ( *((u16 *)(addr)) ) 195 ethertype = clib_net_to_host_u16 (
get_u16 (l3h0 - 2));
200 next[0] = next_index;
206 && (b[0]->
flags & VLIB_BUFFER_IS_TRACED)))
244 .name =
"acl-plugin-in-nonip-l2",
245 .vector_size =
sizeof (
u32),
259 .arc_name =
"l2-input-nonip",
260 .node_name =
"acl-plugin-in-nonip-l2",
266 .name =
"acl-plugin-out-nonip-l2",
267 .vector_size =
sizeof (
u32),
281 .arc_name =
"l2-output-nonip",
282 .node_name =
"acl-plugin-out-nonip-l2",
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static u8 * format_l2_nonip_out_trace(u8 *s, va_list *args)
static u8 * format_nonip_in_out_trace(u8 *s, u32 is_output, va_list *args)
#define VLIB_NODE_FN(node)
vlib_error_t * errors
Vector of errors for this node.
#define foreach_nonip_in_error
static int is_permitted_ethertype(acl_main_t *am, int sw_if_index0, int is_output, u16 ethertype)
static u8 * format_l2_nonip_in_trace(u8 *s, va_list *args)
static uword nonip_in_out_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_output)
description fragment has unexpected format
#define foreach_nonip_out_error
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
VNET_FEATURE_INIT(acl_in_l2_nonip_fa_feature, static)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
u32 node_index
Node index.
#define VLIB_REGISTER_NODE(x,...)
static_always_inline void vlib_buffer_enqueue_to_next(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 *nexts, uword count)
sll srl srl sll sra u16x4 i
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
vlib_main_t vlib_node_runtime_t * node
#define foreach_acl_fa_error
#define VNET_FEATURES(...)
#define vec_elt(v, i)
Get vector value at index i.
vlib_node_registration_t acl_in_nonip_node
(constructor) VLIB_REGISTER_NODE (acl_in_nonip_node)
static char * fa_in_nonip_error_strings[]
vl_api_mac_event_action_t action
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static char * fa_out_nonip_error_strings[]
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u16 ** output_etype_whitelist_by_sw_if_index
u16 ** input_etype_whitelist_by_sw_if_index
u16 flags
Copy of main node flags.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static_always_inline void vlib_get_buffers(vlib_main_t *vm, u32 *bi, vlib_buffer_t **b, int count)
Translate array of buffer indices into buffer pointers.
#define VLIB_NODE_FLAG_TRACE
vlib_node_registration_t acl_out_nonip_node
(constructor) VLIB_REGISTER_NODE (acl_out_nonip_node)
vl_api_interface_index_t sw_if_index