16 #ifndef __GBP_CONTRACT_H__ 17 #define __GBP_CONTRACT_H__ 21 #define foreach_gbp_policy_error \ 22 _(ALLOW_NO_SCLASS, "allow-no-sclass") \ 23 _(ALLOW_INTRA, "allow-intra-sclass") \ 24 _(ALLOW_A_BIT, "allow-a-bit-set") \ 25 _(ALLOW_CONTRACT, "allow-contract") \ 26 _(DROP_CONTRACT, "drop-contract") \ 27 _(DROP_ETHER_TYPE, "drop-ether-type") \ 28 _(DROP_NO_CONTRACT, "drop-no-contract") \ 29 _(DROP_NO_DCLASS, "drop-no-dclass") 63 #define foreach_gbp_hash_mode \ 66 _(SYMMETRIC, "symmetric") 70 #define _(v,s) GBP_HASH_MODE_##v, 75 #define foreach_gbp_rule_action \ 78 _(REDIRECT, "redirect") 82 #define _(v,s) GBP_RULE_##v, 87 #define foreach_gbp_policy_node \ 94 #define _(v,s) GBP_POLICY_NODE_##v, 98 #define GBP_POLICY_N_NODES (GBP_POLICY_NODE_IP6+1) 100 #define FOR_EACH_GBP_POLICY_NODE(pnode) \ 101 for (pnode = GBP_POLICY_NODE_L2; pnode < GBP_POLICY_N_NODES; pnode++) u16 * gc_allowed_ethertypes
An ethertype whitelist.
gbp_contract_key_t gc_key
source and destination EPGs
struct gbp_next_hop_t_ gbp_next_hop_t
struct gbp_rule_t_ gbp_rule_t
struct gbp_contract_key_t_ gbp_contract_key_t
The key for an Contract.
#define FIB_PROTOCOL_IP_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements...
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
EPG src,dst pair to ACL mapping table, aka contract DB.
static gbp_rule_t * gbp_rule_get(index_t gui)
vlib_combined_counter_main_t gbp_contract_drop_counters
vlib_combined_counter_main_t gbp_contract_permit_counters
struct gbp_contract_db_t_ gbp_contract_db_t
EPG src,dst pair to ACL mapping table, aka contract DB.
void gbp_contract_walk(gbp_contract_cb_t bgpe, void *ctx)
gbp_contract_db_t gbp_contract_db
DP functions and databases.
uword * gc_hash
We can form a u64 key from the pair, so use a simple hash table.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
gbp_rule_t * gbp_rule_pool
#define foreach_gbp_policy_node
index_t * gc_rules
The ACL to apply for packets from the source to the destination EPG.
sclass_t gck_src
source and destination EPGs for which the ACL applies
gbp_rule_action_t gu_action
#define GBP_POLICY_N_NODES
vl_api_gbp_next_hop_t nhs[8]
An node in the FIB graph.
u8 * format_gbp_contract(u8 *s, va_list *args)
int gbp_contract_update(sclass_t sclass, sclass_t dclass, u32 acl_index, index_t *rules, u16 *allowed_ethertypes, u32 *stats_index)
enum gbp_hash_mode_t_ gbp_hash_mode_t
index_t gbp_next_hop_alloc(const ip46_address_t *ip, index_t grd, const mac_address_t *mac, index_t gbd)
int gbp_contract_delete(sclass_t sclass, sclass_t dclass)
vl_api_gbp_rule_t rules[n_rules]
struct gbp_contract_t_ gbp_contract_t
A Group Based Policy Contract.
static gbp_contract_t * gbp_contract_get(index_t gci)
index_t gbp_rule_alloc(gbp_rule_action_t action, gbp_hash_mode_t hash_mode, index_t *nhs)
enum gbp_rule_action_t_ gbp_rule_action_t
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
#define foreach_gbp_rule_action
#define foreach_gbp_hash_mode
A collection of combined counters.
enum gbp_policy_node_t_ gbp_policy_node_t
gbp_hash_mode_t gu_hash_mode
u16 allowed_ethertypes[16]
gbp_contract_t * gbp_contract_pool
static index_t gbp_contract_find(gbp_contract_key_t *key)
A Group Based Policy Contract.
int(* gbp_contract_cb_t)(gbp_contract_t *gbpe, void *ctx)