36 etype = clib_net_to_host_u16 (etype);
40 case ETHERNET_TYPE_IP4:
42 case ETHERNET_TYPE_IP6:
61 dpo = &gu->
gu_dpo[GBP_POLICY_NODE_L2][dproto];
80 feat_bit = L2OUTPUT_FEAT_GBP_POLICY_PORT;
83 feat_bit = L2OUTPUT_FEAT_GBP_POLICY_MAC;
86 feat_bit = L2OUTPUT_FEAT_GBP_POLICY_LPM;
102 u32 n_left_from, *from, *to_next;
104 u32 n_allow_intra, n_allow_a_bit, n_allow_sclass_1;
109 n_allow_intra = n_allow_a_bit = n_allow_sclass_1 = 0;
111 while (n_left_from > 0)
117 while (n_left_from > 0 && n_left_to_next > 0)
126 u32 bi0, sw_if_index0;
175 const ip6_address_t *
ip6 = 0;
204 b0->
error = node->
errors[GBP_CONTRACT_ERROR_DROP_NO_DCLASS];
228 case GBP_RULE_PERMIT:
232 case GBP_RULE_REDIRECT:
248 to_next, n_left_to_next,
256 GBP_CONTRACT_ERROR_ALLOW_INTRA, n_allow_intra);
258 GBP_CONTRACT_ERROR_ALLOW_A_BIT, n_allow_a_bit);
260 GBP_CONTRACT_ERROR_ALLOW_SCLASS_1,
289 .name =
"gbp-policy-port",
290 .vector_size =
sizeof (
u32),
304 .name =
"gbp-policy-mac",
305 .vector_size =
sizeof (
u32),
319 .name =
"gbp-policy-lpm",
320 .vector_size =
sizeof (
u32),
static gbp_scope_t gbp_bridge_domain_get_scope(u32 bd_index)
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
A Group Based Policy Endpoint.
gbp_endpoint_fwd_t ge_fwd
static_always_inline void gbp_policy_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, const gbp_contract_key_t *key, gbp_rule_action_t action, u32 acl_match, u32 rule_match)
vlib_node_registration_t gbp_policy_lpm_node
(constructor) VLIB_REGISTER_NODE (gbp_policy_lpm_node)
char * gbp_contract_error_strings[]
#define VLIB_NODE_FN(node)
vlib_error_t * errors
Vector of errors for this node.
static uword gbp_policy_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, const gbp_policy_type_t type)
vlib_node_registration_t gbp_policy_mac_node
(constructor) VLIB_REGISTER_NODE (gbp_policy_mac_node)
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...
#define static_always_inline
static u32 vxlan_gbp_tunnel_by_sw_if_index(u32 sw_if_index)
u32 gx_fib_index[DPO_PROTO_NUM]
cached FIB indices from the RD
static_always_inline gbp_endpoint_t * gbp_endpoint_find_mac(const u8 *mac, u32 bd_index)
gbp_policy_main_t gbp_policy_main
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static gbp_ext_itf_t * gbp_ext_itf_get(u32 sw_if_index)
sclass_t gck_src
source and destination EPGs for which the ACL applies
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static_always_inline gbp_rule_action_t gbp_contract_apply(vlib_main_t *vm, gbp_main_t *gm, gbp_contract_key_t *key, vlib_buffer_t *b, gbp_rule_t **rule, u32 *intra, u32 *sclass1, u32 *acl_match, u32 *rule_match, gbp_contract_error_t *err, gbp_contract_apply_type_t type)
u32 l2_output_feat_next[GBP_N_POLICY][32]
Next nodes for L2 output features.
u32 node_index
Node index.
#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.
sclass_t gef_sclass
Endpoint Group's sclass.
#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).
enum gbp_policy_type_t_ gbp_policy_type_t
An external interface maps directly to an oflex L3ExternalInterface.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_REGISTER_NODE(x,...)
static dpo_proto_t ethertype_to_dpo_proto(u16 etype)
vlib_parse_match_function_t rule_match
static_always_inline const gbp_policy_dpo_t * gbp_classify_get_gpd(const ip4_address_t *ip4, const ip6_address_t *ip6, const u32 fib_index)
vlib_node_registration_t gbp_policy_port_node
(constructor) VLIB_REGISTER_NODE (gbp_policy_port_node)
dpo_id_t gu_dpo[GBP_POLICY_N_NODES][FIB_PROTOCOL_IP_MAX]
DPO of the load-balance object used to redirect.
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.
sclass_t gpd_sclass
SClass.
vlib_main_t vlib_node_runtime_t * node
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
u8 * format_gbp_policy_trace(u8 *s, va_list *args)
enum gbp_rule_action_t_ gbp_rule_action_t
index_t dpoi_index
the index of objects of that type
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.
Group Base Policy (GBP) defines:
static_always_inline gbp_endpoint_t * gbp_endpoint_find_itf(u32 sw_if_index)
static_always_inline dpo_proto_t gbp_classify_get_ip_address(const ethernet_header_t *eh0, const ip4_address_t **ip4, const ip6_address_t **ip6, const enum gbp_classify_get_ip_way way)
u16 dpoi_next_node
The next VLIB node to follow.
Grouping of global data for the GBP source EPG classification feature.
static_always_inline gbp_policy_next_t gbp_policy_l2_feature_next(gbp_policy_main_t *gpm, vlib_buffer_t *b, const gbp_policy_type_t type)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u32 gbp_rule_l2_redirect(const gbp_rule_t *gu, vlib_buffer_t *b0)