101 sw_if_index, ITF_INVALID);
136 const ip46_address_t * ip,
epg_id_t epg_id)
140 .gek_sw_if_index = sw_if_index,
149 return (VNET_API_ERROR_NO_SUCH_ENTRY);
196 .gek_sw_if_index = sw_if_index,
239 ip46_address_t ip = { };
240 u32 sw_if_index = ~0;
252 else if (
unformat (input,
"epg %d", &epg_id))
262 if (~0 == sw_if_index)
287 .path =
"gbp endpoint",
288 .short_help =
"gbp endpoint [del] <interface> epg <ID> ip <IP>",
314 ip46_address_t ip, *ipp;
338 vlib_cli_output (vm,
" %U -> %d", format_ip46_address, &ip,
339 IP46_TYPE_IP4, epg_id);
348 vlib_cli_output (vm,
" %U -> %d", format_ip46_address, ipp,
349 IP46_TYPE_IP6, epg_id);
366 .path =
"show gbp endpoint",
367 .short_help =
"show gbp endpoint\n",
#define vec_foreach_index(var, v)
Iterate over vector indices.
#define hash_set(h, key, value)
A Group Based Policy Endpoint.
#define hash_unset(h, key)
void gbp_itf_epg_delete(u32 sw_if_index)
vnet_main_t * vnet_get_main(void)
static gbp_ip6_to_epg_db_t gbp_ip6_to_epg_db
IP6 destintion address to destination EPG mapping table.
Interface to source EPG DB - a per-interface vector.
gbp_endpoint_key_t * ge_key
The endpoint's interface and IP address.
#define hash_set_mem(h, key, value)
unformat_function_t unformat_vnet_sw_interface
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
format_function_t format_vnet_sw_if_index_name
gbp_itf_to_epg_db_t gbp_itf_to_epg_db
DP functions and databases.
static void gbp_ip_epg_update(const ip46_address_t *ip, epg_id_t epg_id)
static gbp_endpoint_t * gbp_endpoint_pool
Pool of GBP endpoints.
uword * g6ie_hash
use a memroy hash table
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static int gbp_endpoint_show_one(gbp_endpoint_t *gbpe, void *ctx)
#define VLIB_INIT_FUNCTION(x)
u32 gek_sw_if_index
The interface on which the EP is connected.
#define hash_foreach(key_var, value_var, h, body)
gbp_endpoint_group_t * gbp_endpoint_group_find(epg_id_t epg_id)
#define clib_error_return(e, args...)
static gbp_ip4_to_epg_db_t gbp_ip4_to_epg_db
void l2output_intf_bitmap_enable(u32 sw_if_index, u32 feature_bitmap, u32 enable)
Enable (or disable) the feature in the bitmap for the given interface.
int gbp_endpoint_update(u32 sw_if_index, const ip46_address_t *ip, epg_id_t epg_id)
#define hash_create_mem(elts, key_bytes, value_bytes)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define hash_unset_mem(h, key)
#define pool_put(P, E)
Free an object E in pool P.
#define hash_foreach_mem(key_var, value_var, h, body)
An Endpoint Group representation.
static uword * gbp_endpoint_db
DB of endpoints.
#define ip46_address_is_ip4(ip46)
void gbp_itf_epg_update(u32 sw_if_index, epg_id_t src_epg, u8 do_policy)
Port to EPG mapping management.
ip46_address_t gek_ip
The IP[46] address of the endpoint.
Result of a interface to EPG mapping.
void gbp_endpoint_walk(gbp_endpoint_cb_t cb, void *ctx)
uword * g4ie_hash
use a simple hash table
void send_ip6_na_w_addr(vlib_main_t *vm, const ip6_address_t *addr, u32 sw_if_index)
#define clib_memcpy(a, b, c)
static clib_error_t * gbp_endpoint_init(vlib_main_t *vm)
void send_ip4_garp_w_addr(vlib_main_t *vm, const ip4_address_t *ip4_addr, u32 sw_if_index)
#define VLIB_CLI_COMMAND(x,...)
struct gbp_ip6_to_epg_db_t_ gbp_ip6_to_epg_db_t
IP6 destintion address to destination EPG mapping table.
void gbp_endpoint_delete(u32 sw_if_index, const ip46_address_t *ip)
static void clib_mem_free(void *p)
u32 gepg_uplink_sw_if_index
the uplink interface dedicated to the EPG
static clib_error_t * gbp_endpoint_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int(* gbp_endpoint_cb_t)(gbp_endpoint_t *gbpe, void *ctx)
static void * clib_mem_alloc(uword size)
static vlib_main_t * vlib_get_main(void)
struct gbp_ip4_to_epg_db_t_ gbp_ip4_to_epg_db_t
IP4 destintion address to destination EPG mapping table.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
epg_id_t ge_epg_id
The endpoint's designated EPG.
IP4 destintion address to destination EPG mapping table.
#define hash_get_mem(h, key)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
#define ip46_address_is_zero(ip46)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static clib_error_t * gbp_endpoint_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void gbp_ip_epg_delete(const ip46_address_t *ip)