31 #define foreach_gbp_policy \ 36 #define _(sym,str) GBP_ERROR_##sym, 43 #define _(sym,string) string, 50 #define _(sym,str) GBP_POLICY_NEXT_##sym, 72 u32 n_left_from, *from, *to_next;
79 while (n_left_from > 0)
85 while (n_left_from > 0 && n_left_to_next > 0)
89 u32 bi0, sw_if_index0;
93 next0 = GBP_POLICY_NEXT_DENY;
119 L2OUTPUT_FEAT_GBP_POLICY);
125 if (~0 != acl_index0)
136 L2OUTPUT_FEAT_GBP_POLICY);
147 L2OUTPUT_FEAT_GBP_POLICY);
161 to_next, n_left_to_next,
189 .name =
"gbp-policy",
190 .vector_size =
sizeof (
u32),
200 [GBP_POLICY_NEXT_DENY] =
"error-drop",
char ** l2output_get_feat_names(void)
static u32 vnet_l2_feature_next(vlib_buffer_t *b, u32 *next_nodes, u32 feat_bit)
Return the graph node index for the feature corresponding to the next set bit after clearing the curr...
static uword gbp_policy(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define VLIB_INIT_FUNCTION(x)
static char * gbp_policy_error_strings[]
vlib_node_registration_t gbp_policy_node
(constructor) VLIB_REGISTER_NODE (gbp_policy_node)
#define foreach_gbp_policy
struct gbp_policy_trace_t_ gbp_policy_trace_t
per-packet trace data
static u32 gbp_port_to_epg(u32 sw_if_index)
Get the source EPG for a port/interface.
#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 clib_error_t * gbp_policy_init(vlib_main_t *vm)
u32 l2_output_feat_next[32]
Next nodes for L2 output features.
#define VLIB_REGISTER_NODE(x,...)
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.
static u32 gbp_acl_lookup(gbp_contract_key_t *key)
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.
epg_id_t gck_src
source and destination EPGs for which the ACL applies
VLIB_NODE_FUNCTION_MULTIARCH(gbp_policy_node, gbp_policy)
static gbp_policy_main_t gbp_policy_main
static u8 * format_gbp_policy_trace(u8 *s, va_list *args)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct gbp_policy_main_t_ gbp_policy_main_t
Grouping of global data for the GBP source EPG classification feature.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Grouping of global data for the GBP source EPG classification feature.
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 vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.