FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
gbp_contract.h File Reference
+ Include dependency graph for gbp_contract.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gbp_contract_key_t_
 The key for an Contract. More...
 
struct  gbp_next_hop_t_
 
struct  gbp_rule_t_
 
struct  gbp_contract_t_
 A Group Based Policy Contract. More...
 
struct  gbp_contract_db_t_
 EPG src,dst pair to ACL mapping table, aka contract DB. More...
 

Macros

#define foreach_gbp_contract_error
 
#define GBP_CONTRACT_N_ERROR   GBP_CONTRACT_N_ERROR
 
#define foreach_gbp_hash_mode
 
#define foreach_gbp_rule_action
 
#define foreach_gbp_policy_node
 
#define GBP_POLICY_N_NODES   (GBP_POLICY_NODE_IP6+1)
 
#define FOR_EACH_GBP_POLICY_NODE(pnode)   for (pnode = GBP_POLICY_NODE_L2; pnode < GBP_POLICY_N_NODES; pnode++)
 

Typedefs

typedef struct gbp_contract_key_t_ gbp_contract_key_t
 The key for an Contract. More...
 
typedef struct gbp_next_hop_t_ gbp_next_hop_t
 
typedef enum gbp_hash_mode_t_ gbp_hash_mode_t
 
typedef enum gbp_rule_action_t_ gbp_rule_action_t
 
typedef enum gbp_policy_node_t_ gbp_policy_node_t
 
typedef struct gbp_rule_t_ gbp_rule_t
 
typedef struct gbp_contract_t_ gbp_contract_t
 A Group Based Policy Contract. More...
 
typedef struct gbp_contract_db_t_ gbp_contract_db_t
 EPG src,dst pair to ACL mapping table, aka contract DB. More...
 
typedef int(* gbp_contract_cb_t) (gbp_contract_t *gbpe, void *ctx)
 

Enumerations

enum  gbp_contract_error_t { GBP_CONTRACT_N_ERROR, GBP_CONTRACT_N_ERROR }
 
enum  gbp_hash_mode_t_ { foreach_gbp_hash_mode }
 
enum  gbp_rule_action_t_ { foreach_gbp_rule_action }
 
enum  gbp_policy_node_t_ { foreach_gbp_policy_node }
 
enum  gbp_contract_apply_type_t { GBP_CONTRACT_APPLY_L2, GBP_CONTRACT_APPLY_IP4, GBP_CONTRACT_APPLY_IP6 }
 

Functions

int gbp_contract_update (gbp_scope_t scope, sclass_t sclass, sclass_t dclass, u32 acl_index, index_t *rules, u16 *allowed_ethertypes, u32 *stats_index)
 
int gbp_contract_delete (gbp_scope_t scope, sclass_t sclass, sclass_t dclass)
 
index_t gbp_rule_alloc (gbp_rule_action_t action, gbp_hash_mode_t hash_mode, index_t *nhs)
 
void gbp_rule_free (index_t gui)
 
index_t gbp_next_hop_alloc (const ip46_address_t *ip, index_t grd, const mac_address_t *mac, index_t gbd)
 
void gbp_contract_walk (gbp_contract_cb_t bgpe, void *ctx)
 
u8format_gbp_rule_action (u8 *s, va_list *args)
 
u8format_gbp_contract (u8 *s, va_list *args)
 
static index_t gbp_contract_find (gbp_contract_key_t *key)
 
static gbp_contract_tgbp_contract_get (index_t gci)
 
static gbp_rule_tgbp_rule_get (index_t gui)
 
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)
 

Variables

char * gbp_contract_error_strings [GBP_CONTRACT_N_ERROR]
 
gbp_contract_db_t gbp_contract_db
 DP functions and databases. More...
 
gbp_contract_tgbp_contract_pool
 
gbp_rule_tgbp_rule_pool
 
vlib_combined_counter_main_t gbp_contract_permit_counters
 
vlib_combined_counter_main_t gbp_contract_drop_counters
 

Macro Definition Documentation

◆ FOR_EACH_GBP_POLICY_NODE

#define FOR_EACH_GBP_POLICY_NODE (   pnode)    for (pnode = GBP_POLICY_NODE_L2; pnode < GBP_POLICY_N_NODES; pnode++)

Definition at line 115 of file gbp_contract.h.

◆ foreach_gbp_contract_error

#define foreach_gbp_contract_error
Value:
_(ALLOW_NO_SCLASS, "allow-no-sclass") \
_(ALLOW_INTRA, "allow-intra-sclass") \
_(ALLOW_A_BIT, "allow-a-bit-set") \
_(ALLOW_SCLASS_1, "allow-sclass-1") \
_(ALLOW_CONTRACT, "allow-contract") \
_(DROP_CONTRACT, "drop-contract") \
_(DROP_ETHER_TYPE, "drop-ether-type") \
_(DROP_NO_CONTRACT, "drop-no-contract") \
_(DROP_NO_DCLASS, "drop-no-dclass") \
_(DROP_NO_RULE, "drop-no-rule")

Definition at line 22 of file gbp_contract.h.

◆ foreach_gbp_hash_mode

#define foreach_gbp_hash_mode
Value:
_(SRC_IP, "src-ip") \
_(DST_IP, "dst-ip") \
_(SYMMETRIC, "symmetric")

Definition at line 78 of file gbp_contract.h.

◆ foreach_gbp_policy_node

#define foreach_gbp_policy_node
Value:
_(L2, "L2") \
_(IP4, "ip4") \
_(IP6, "ip6")
Definition: acl.h:67
Definition: acl.h:67

Definition at line 102 of file gbp_contract.h.

◆ foreach_gbp_rule_action

#define foreach_gbp_rule_action
Value:
_(PERMIT, "permit") \
_(DENY, "deny") \
_(REDIRECT, "redirect")

Definition at line 90 of file gbp_contract.h.

◆ GBP_CONTRACT_N_ERROR

#define GBP_CONTRACT_N_ERROR   GBP_CONTRACT_N_ERROR

Definition at line 40 of file gbp_contract.h.

◆ GBP_POLICY_N_NODES

#define GBP_POLICY_N_NODES   (GBP_POLICY_NODE_IP6+1)

Definition at line 113 of file gbp_contract.h.

Typedef Documentation

◆ gbp_contract_cb_t

typedef int(* gbp_contract_cb_t) (gbp_contract_t *gbpe, void *ctx)

Definition at line 182 of file gbp_contract.h.

◆ gbp_contract_db_t

EPG src,dst pair to ACL mapping table, aka contract DB.

◆ gbp_contract_key_t

The key for an Contract.

◆ gbp_contract_t

A Group Based Policy Contract.

Determines the ACL that applies to traffic pass between two endpoint groups

◆ gbp_hash_mode_t

◆ gbp_next_hop_t

◆ gbp_policy_node_t

◆ gbp_rule_action_t

◆ gbp_rule_t

typedef struct gbp_rule_t_ gbp_rule_t

Enumeration Type Documentation

◆ gbp_contract_apply_type_t

Enumerator
GBP_CONTRACT_APPLY_L2 
GBP_CONTRACT_APPLY_IP4 
GBP_CONTRACT_APPLY_IP6 

Definition at line 225 of file gbp_contract.h.

◆ gbp_contract_error_t

Enumerator
GBP_CONTRACT_N_ERROR 
GBP_CONTRACT_N_ERROR 

Definition at line 34 of file gbp_contract.h.

◆ gbp_hash_mode_t_

Enumerator
foreach_gbp_hash_mode 

Definition at line 83 of file gbp_contract.h.

◆ gbp_policy_node_t_

Enumerator
foreach_gbp_policy_node 

Definition at line 107 of file gbp_contract.h.

◆ gbp_rule_action_t_

Enumerator
foreach_gbp_rule_action 

Definition at line 95 of file gbp_contract.h.

Function Documentation

◆ format_gbp_contract()

u8* format_gbp_contract ( u8 s,
va_list *  args 
)

Definition at line 650 of file gbp_contract.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_gbp_rule_action()

u8* format_gbp_rule_action ( u8 s,
va_list *  args 
)

Definition at line 171 of file gbp_contract.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gbp_contract_apply()

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 
)

Definition at line 233 of file gbp_contract.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gbp_contract_delete()

int gbp_contract_delete ( gbp_scope_t  scope,
sclass_t  sclass,
sclass_t  dclass 
)

Definition at line 536 of file gbp_contract.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gbp_contract_find()

static index_t gbp_contract_find ( gbp_contract_key_t key)
inlinestatic

Definition at line 194 of file gbp_contract.h.

+ Here is the caller graph for this function:

◆ gbp_contract_get()

static gbp_contract_t* gbp_contract_get ( index_t  gci)
inlinestatic

Definition at line 209 of file gbp_contract.h.

+ Here is the caller graph for this function:

◆ gbp_contract_update()

int gbp_contract_update ( gbp_scope_t  scope,
sclass_t  sclass,
sclass_t  dclass,
u32  acl_index,
index_t rules,
u16 allowed_ethertypes,
u32 stats_index 
)

Definition at line 465 of file gbp_contract.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gbp_contract_walk()

void gbp_contract_walk ( gbp_contract_cb_t  bgpe,
void *  ctx 
)

Definition at line 565 of file gbp_contract.c.

+ Here is the caller graph for this function:

◆ gbp_next_hop_alloc()

index_t gbp_next_hop_alloc ( const ip46_address_t *  ip,
index_t  grd,
const mac_address_t mac,
index_t  gbd 
)

Definition at line 83 of file gbp_contract.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gbp_rule_alloc()

index_t gbp_rule_alloc ( gbp_rule_action_t  action,
gbp_hash_mode_t  hash_mode,
index_t nhs 
)

Definition at line 62 of file gbp_contract.c.

+ Here is the caller graph for this function:

◆ gbp_rule_free()

void gbp_rule_free ( index_t  gui)

Definition at line 77 of file gbp_contract.c.

+ Here is the caller graph for this function:

◆ gbp_rule_get()

static gbp_rule_t* gbp_rule_get ( index_t  gui)
inlinestatic

Definition at line 217 of file gbp_contract.h.

+ Here is the caller graph for this function:

Variable Documentation

◆ gbp_contract_db

gbp_contract_db_t gbp_contract_db

DP functions and databases.

DP functions and databases.

Definition at line 36 of file gbp_contract.c.

◆ gbp_contract_drop_counters

vlib_combined_counter_main_t gbp_contract_drop_counters

Definition at line 56 of file gbp_contract.c.

◆ gbp_contract_error_strings

char* gbp_contract_error_strings[GBP_CONTRACT_N_ERROR]

Definition at line 27 of file gbp_contract.c.

◆ gbp_contract_permit_counters

vlib_combined_counter_main_t gbp_contract_permit_counters

Definition at line 51 of file gbp_contract.c.

◆ gbp_contract_pool

gbp_contract_t* gbp_contract_pool

Definition at line 38 of file gbp_contract.c.

◆ gbp_rule_pool

gbp_rule_t* gbp_rule_pool

Definition at line 44 of file gbp_contract.c.