FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
gbp_contract.c File Reference
+ Include dependency graph for gbp_contract.c:

Go to the source code of this file.

Macros

#define GBP_CONTRACT_DBG(...)   vlib_log_notice (gc_logger, __VA_ARGS__);
 

Functions

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)
 
static gbp_next_hop_tgbp_next_hop_get (index_t gui)
 
static void gbp_contract_rules_free (index_t *rules)
 
static u8format_gbp_next_hop (u8 *s, va_list *args)
 
u8format_gbp_rule_action (u8 *s, va_list *args)
 
static u8format_gbp_hash_mode (u8 *s, va_list *args)
 
static u8format_gbp_policy_node (u8 *s, va_list *args)
 
static u8format_gbp_rule (u8 *s, va_list *args)
 
static void gbp_contract_mk_adj (gbp_next_hop_t *gnh, fib_protocol_t fproto)
 
static flow_hash_config_t gbp_contract_mk_lb_hp (gbp_hash_mode_t gu_hash_mode)
 
static void gbp_contract_mk_lb (index_t gui, fib_protocol_t fproto)
 
static void gbp_contract_mk_one_lb (index_t gui)
 
static int gbp_contract_next_hop_resolve (index_t gui, index_t gnhi)
 
static void gbp_contract_rule_resolve (index_t gui)
 
static void gbp_contract_resolve (index_t *guis)
 
static void gbp_contract_mk_lbs (index_t *guis)
 
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)
 
void gbp_contract_walk (gbp_contract_cb_t cb, void *ctx)
 
static clib_error_tgbp_contract_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static u8format_gbp_contract_key (u8 *s, va_list *args)
 
u8format_gbp_contract (u8 *s, va_list *args)
 
static clib_error_tgbp_contract_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static fib_node_tgbp_next_hop_get_node (fib_node_index_t index)
 
static void gbp_next_hop_last_lock_gone (fib_node_t *node)
 
static gbp_next_hop_tgbp_next_hop_from_fib_node (fib_node_t *node)
 
static fib_node_back_walk_rc_t gbp_next_hop_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
static clib_error_tgbp_contract_init (vlib_main_t *vm)
 

Variables

char * gbp_contract_error_strings []
 
gbp_contract_db_t gbp_contract_db
 Single contract DB instance. More...
 
gbp_contract_tgbp_contract_pool
 
vlib_log_class_t gc_logger
 
fib_node_type_t gbp_next_hop_fib_type
 
gbp_rule_tgbp_rule_pool
 
gbp_next_hop_tgbp_next_hop_pool
 
vlib_combined_counter_main_t gbp_contract_permit_counters
 
vlib_combined_counter_main_t gbp_contract_drop_counters
 
static vlib_cli_command_t gbp_contract_cli_node
 (constructor) VLIB_CLI_COMMAND (gbp_contract_cli_node) More...
 
static vlib_cli_command_t gbp_contract_show_node
 (constructor) VLIB_CLI_COMMAND (gbp_contract_show_node) More...
 
static const fib_node_vft_t gbp_next_hop_vft
 

Macro Definition Documentation

◆ GBP_CONTRACT_DBG

#define GBP_CONTRACT_DBG (   ...)    vlib_log_notice (gc_logger, __VA_ARGS__);

Definition at line 47 of file gbp_contract.c.

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_contract_key()

static u8* format_gbp_contract_key ( u8 s,
va_list *  args 
)
static

Definition at line 640 of file gbp_contract.c.

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

◆ format_gbp_hash_mode()

static u8* format_gbp_hash_mode ( u8 s,
va_list *  args 
)
static

Definition at line 186 of file gbp_contract.c.

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

◆ format_gbp_next_hop()

static u8* format_gbp_next_hop ( u8 s,
va_list *  args 
)
static

Definition at line 155 of file gbp_contract.c.

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

◆ format_gbp_policy_node()

static u8* format_gbp_policy_node ( u8 s,
va_list *  args 
)
static

Definition at line 201 of file gbp_contract.c.

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

◆ format_gbp_rule()

static u8* format_gbp_rule ( u8 s,
va_list *  args 
)
static

Definition at line 216 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_cli()

static clib_error_t* gbp_contract_cli ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 579 of file gbp_contract.c.

+ Here is the call 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_init()

static clib_error_t* gbp_contract_init ( vlib_main_t vm)
static

Definition at line 803 of file gbp_contract.c.

+ Here is the call graph for this function:

◆ gbp_contract_mk_adj()

static void gbp_contract_mk_adj ( gbp_next_hop_t gnh,
fib_protocol_t  fproto 
)
static

Definition at line 261 of file gbp_contract.c.

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

◆ gbp_contract_mk_lb()

static void gbp_contract_mk_lb ( index_t  gui,
fib_protocol_t  fproto 
)
static

Definition at line 312 of file gbp_contract.c.

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

◆ gbp_contract_mk_lb_hp()

static flow_hash_config_t gbp_contract_mk_lb_hp ( gbp_hash_mode_t  gu_hash_mode)
static

Definition at line 295 of file gbp_contract.c.

+ Here is the caller graph for this function:

◆ gbp_contract_mk_lbs()

static void gbp_contract_mk_lbs ( index_t guis)
static

Definition at line 454 of file gbp_contract.c.

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

◆ gbp_contract_mk_one_lb()

static void gbp_contract_mk_one_lb ( index_t  gui)
static

Definition at line 378 of file gbp_contract.c.

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

◆ gbp_contract_next_hop_resolve()

static int gbp_contract_next_hop_resolve ( index_t  gui,
index_t  gnhi 
)
static

Definition at line 385 of file gbp_contract.c.

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

◆ gbp_contract_resolve()

static void gbp_contract_resolve ( index_t guis)
static

Definition at line 443 of file gbp_contract.c.

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

◆ gbp_contract_rule_resolve()

static void gbp_contract_rule_resolve ( index_t  gui)
static

Definition at line 427 of file gbp_contract.c.

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

◆ gbp_contract_rules_free()

static void gbp_contract_rules_free ( index_t rules)
static

Definition at line 111 of file gbp_contract.c.

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

◆ gbp_contract_show()

static clib_error_t* gbp_contract_show ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 691 of file gbp_contract.c.

+ Here is the call 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  cb,
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_next_hop_back_walk_notify()

static fib_node_back_walk_rc_t gbp_next_hop_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 780 of file gbp_contract.c.

+ Here is the call graph for this function:

◆ gbp_next_hop_from_fib_node()

static gbp_next_hop_t* gbp_next_hop_from_fib_node ( fib_node_t node)
static

Definition at line 773 of file gbp_contract.c.

+ Here is the caller graph for this function:

◆ gbp_next_hop_get()

static gbp_next_hop_t* gbp_next_hop_get ( index_t  gui)
inlinestatic

Definition at line 105 of file gbp_contract.c.

+ Here is the caller graph for this function:

◆ gbp_next_hop_get_node()

static fib_node_t* gbp_next_hop_get_node ( fib_node_index_t  index)
static

Definition at line 757 of file gbp_contract.c.

+ Here is the call graph for this function:

◆ gbp_next_hop_last_lock_gone()

static void gbp_next_hop_last_lock_gone ( fib_node_t node)
static

Definition at line 767 of file gbp_contract.c.

◆ 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:

Variable Documentation

◆ gbp_contract_cli_node

vlib_cli_command_t gbp_contract_cli_node
static
Initial value:
=
{
.path = "gbp contract",
.short_help =
"gbp contract [del] src-epg <ID> dst-epg <ID> acl-index <ACL>",
.function = gbp_contract_cli,
}
static clib_error_t * gbp_contract_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gbp_contract.c:579

(constructor) VLIB_CLI_COMMAND (gbp_contract_cli_node)

Definition at line 630 of file gbp_contract.c.

◆ gbp_contract_db

gbp_contract_db_t gbp_contract_db

Single contract DB instance.

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
Initial value:
= {
.name = "gbp-contracts-drop",
.stat_segment_name = "/net/gbp/contract/drop",
}

Definition at line 56 of file gbp_contract.c.

◆ gbp_contract_error_strings

char* gbp_contract_error_strings[]
Initial value:
= {
#define _(sym,string)
}
#define foreach_gbp_contract_error
Definition: gbp_contract.h:22

Definition at line 27 of file gbp_contract.c.

◆ gbp_contract_permit_counters

vlib_combined_counter_main_t gbp_contract_permit_counters
Initial value:
= {
.name = "gbp-contracts-permit",
.stat_segment_name = "/net/gbp/contract/permit",
}

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_contract_show_node

vlib_cli_command_t gbp_contract_show_node
static
Initial value:
= {
.path = "show gbp contract",
.short_help = "show gbp contract [src <SRC>] [dst <DST>]\n",
.function = gbp_contract_show,
}
static clib_error_t * gbp_contract_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gbp_contract.c:691

(constructor) VLIB_CLI_COMMAND (gbp_contract_show_node)

Definition at line 749 of file gbp_contract.c.

◆ gbp_next_hop_fib_type

fib_node_type_t gbp_next_hop_fib_type

Definition at line 42 of file gbp_contract.c.

◆ gbp_next_hop_pool

gbp_next_hop_t* gbp_next_hop_pool

Definition at line 45 of file gbp_contract.c.

◆ gbp_next_hop_vft

const fib_node_vft_t gbp_next_hop_vft
static
Initial value:
= {
.fnv_last_lock = gbp_next_hop_last_lock_gone,
}
static fib_node_t * gbp_next_hop_get_node(fib_node_index_t index)
Definition: gbp_contract.c:757
static void gbp_next_hop_last_lock_gone(fib_node_t *node)
Definition: gbp_contract.c:767
static fib_node_back_walk_rc_t gbp_next_hop_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Definition: gbp_contract.c:780

Definition at line 795 of file gbp_contract.c.

◆ gbp_rule_pool

gbp_rule_t* gbp_rule_pool

Definition at line 44 of file gbp_contract.c.

◆ gc_logger

vlib_log_class_t gc_logger

Definition at line 40 of file gbp_contract.c.