56 gbp_contract_t gbpc = {
58 .gc_acl_index = acl_index,
81 else if (
unformat (input,
"src-epg %d", &src_epg_id))
83 else if (
unformat (input,
"dst-epg %d", &dst_epg_id))
85 else if (
unformat (input,
"acl-index %d", &acl_index))
117 .path =
"gbp contract",.short_help =
118 "gbp contract [del] src-epg <ID> dst-epg <ID> acl-index <ACL>",.function
134 vlib_cli_output (vm,
" {%d,%d} -> %d", key.gck_src,
135 key.gck_dst, epg_id);
151 .path =
"show gbp contract",
152 .short_help =
"show gbp contract\n",
static clib_error_t * gbp_contract_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define hash_set(h, key, value)
#define hash_unset(h, key)
gbp_contract_db_t gbp_contract_db
Single contract DB instance.
static clib_error_t * gbp_contract_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
EPG src,dst pair to ACL mapping table, aka contract DB.
#define hash_foreach(key_var, value_var, h, body)
#define clib_error_return(e, args...)
uword * gc_hash
We can form a u64 key from the pair, so use a simple hash table.
void gbp_contract_delete(epg_id_t src_epg, epg_id_t dst_epg)
epg_id_t gck_src
source and destination EPGs for which the ACL applies
#define VLIB_CLI_COMMAND(x,...)
void gbp_contract_update(epg_id_t src_epg, epg_id_t dst_epg, u32 acl_index)
void gbp_contract_walk(gbp_contract_cb_t cb, void *ctx)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
int(* gbp_contract_cb_t)(gbp_contract_t *gbpe, void *ctx)