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, 73 u32 n_left_from, *from, *to_next;
80 while (n_left_from > 0)
86 while (n_left_from > 0 && n_left_to_next > 0)
93 u32 bi0, sw_if_index0;
96 next0 = GBP_POLICY_NEXT_DENY;
121 L2OUTPUT_FEAT_GBP_POLICY);
131 u32 acl_pos_p0, acl_match_p0;
132 u32 rule_match_p0, trace_bitmap0;
141 clib_net_to_host_u16 (*(
u16 *) (h0 + l2_len0 - 2));
143 is_ip60 = (ether_type0 == ETHERNET_TYPE_IP6) ? 1 : 0;
157 &pkt_5tuple0, is_ip60,
158 &action0, &acl_pos_p0,
166 L2OUTPUT_FEAT_GBP_POLICY);
177 L2OUTPUT_FEAT_GBP_POLICY);
191 to_next, n_left_to_next,
219 .name =
"gbp-policy",
220 .vector_size =
sizeof (
u32),
230 [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 acl_plugin_methods_t acl_plugin
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
static void acl_plugin_fill_5tuple_inline(void *p_acl_main, u32 lc_index, vlib_buffer_t *b0, int is_ip6, int is_input, int is_l2_path, fa_5tuple_opaque_t *p5tuple_pkt)
struct gbp_policy_trace_t_ gbp_policy_trace_t
per-packet trace data
u32 gc_lc_index
lookup context and acl index
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
The value for an Contract.
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.
static u64 gbp_acl_lookup(gbp_contract_key_t *key)
#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.
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 int acl_plugin_match_5tuple_inline(void *p_acl_main, u32 lc_index, fa_5tuple_opaque_t *pkt_5tuple, int is_ip6, u8 *r_action, u32 *r_acl_pos_p, u32 *r_acl_match_p, u32 *r_rule_match_p, u32 *trace_bitmap)
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.
Group Base Policy (GBP) defines:
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.