45 gm->
acl_plugin.register_user_module (
"GBP ACL",
"src-epg",
"dst-epg");
98 gbp_contract_t gbpc = {
123 else if (
unformat (input,
"src-epg %d", &src_epg_id))
125 else if (
unformat (input,
"dst-epg %d", &dst_epg_id))
127 else if (
unformat (input,
"acl-index %d", &acl_index))
160 .path =
"gbp contract",
162 "gbp contract [del] src-epg <ID> dst-epg <ID> acl-index <ACL>",
179 vlib_cli_output (vm,
" {%d,%d} -> %d", key.gck_src,
180 key.gck_dst, value.gc_acl_index);
196 .path =
"show gbp contract",
197 .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.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
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.
u32 gc_lc_index
lookup context and acl index
The value for an Contract.
void gbp_contract_delete(epg_id_t src_epg, epg_id_t dst_epg)
#define vec_free(V)
Free vector's memory (no header).
static clib_error_t * acl_plugin_exports_init(acl_plugin_methods_t *m)
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)
acl_plugin_methods_t acl_plugin
Group Base Policy (GBP) defines:
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)