49 #define GBP_BD_DBG(...) \ 50 vlib_log_debug (gb_logger, __VA_ARGS__); 55 return (gbd - gbp_bridge_domain_pool);
131 s =
format (s,
"do-not-learn ");
133 s =
format (s,
"uu-fwd-drop ");
135 s =
format (s,
"mcast-drop ");
137 s =
format (s,
"ucast-arp ");
155 "[%d] bd:[%d,%d], bvi:%U uu-flood:%U bm-flood:%U flags:%U locks:%d",
200 return (VNET_API_ERROR_BD_NOT_MODIFIABLE);
208 pool_get (gbp_bridge_domain_pool, gb);
209 memset (gb, 0,
sizeof (*gb));
234 if ((!(flags & GBP_BD_FLAG_UU_FWD_DROP) ||
240 if (!(flags & GBP_BD_FLAG_MCAST_DROP) && ~0 != bm_flood_sw_if_index)
245 L2INPUT_FEAT_GBP_LEARN);
253 if (flags & GBP_BD_FLAG_UCAST_ARP)
265 (L2FIB_ENTRY_RESULT_FLAG_STATIC |
266 L2FIB_ENTRY_RESULT_FLAG_BVI));
338 pool_put (gbp_bridge_domain_pool, gb);
358 return (VNET_API_ERROR_NO_SUCH_ENTRY);
392 vnm, &bvi_sw_if_index))
395 vnm, &uu_fwd_sw_if_index))
398 vnm, &bm_flood_sw_if_index))
404 else if (
unformat (input,
"flags %d", &flags))
406 else if (
unformat (input,
"bd %d", &bd_id))
421 if (~0 == bvi_sw_if_index)
428 bm_flood_sw_if_index);
445 .path =
"gbp bridge-domain",
446 .short_help =
"gbp bridge-domain [del] bd <ID> bvi <interface> [uu-fwd <interface>] [bm-flood <interface>] [flags <flags>]",
481 .path =
"show gbp bridge-domain",
482 .short_help =
"show gbp bridge-domain\n",
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
void gbp_bridge_domain_walk(gbp_bridge_domain_cb_t cb, void *ctx)
void gbp_bridge_domain_itf_add(index_t gbdi, u32 sw_if_index, l2_bd_port_type_t type)
void gbp_bridge_domain_itf_del(index_t gbdi, u32 sw_if_index, l2_bd_port_type_t type)
vlib_log_class_t gb_logger
logger
u32 gb_uu_fwd_sw_if_index
The BD's MAC spine-proxy interface (optional)
void gbp_route_domain_unlock(index_t index)
#define hash_set(h, key, value)
#define hash_unset(h, key)
vl_api_wireguard_peer_flags_t flags
vnet_main_t * vnet_get_main(void)
static void gbp_bridge_domain_db_add(gbp_bridge_domain_t *gb)
index_t * gbd_by_bd_index
int gbp_bridge_domain_add_and_lock(u32 bd_id, u32 rd_id, gbp_bridge_domain_flags_t flags, u32 bvi_sw_if_index, u32 uu_fwd_sw_if_index, u32 bm_flood_sw_if_index)
void gbp_itf_unlock(gbp_itf_hdl_t *gh)
A bridge Domain Representation.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
unformat_function_t unformat_vnet_sw_interface
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static gbp_bridge_domain_t * gbp_bridge_domain_get(index_t i)
format_function_t format_vnet_sw_if_index_name
vl_api_interface_index_t uu_fwd_sw_if_index
index_t gbp_bridge_domain_index(const gbp_bridge_domain_t *gbd)
void gbp_bridge_domain_unlock(index_t gbdi)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
enum gbp_bridge_domain_flags_t_ gbp_bridge_domain_flags_t
Bridge Domain Flags.
#define VLIB_INIT_FUNCTION(x)
vl_api_interface_index_t bvi_sw_if_index
#define clib_error_return(e, args...)
void l2fib_add_entry(const u8 *mac, u32 bd_index, u32 sw_if_index, l2fib_entry_result_flags_t flags)
Add an entry to the l2fib.
static void gbp_bridge_domain_lock(index_t i)
static const u8 * vnet_sw_interface_get_hw_address(vnet_main_t *vnm, u32 sw_if_index)
vl_api_fib_path_type_t type
static u8 * format_gbp_bridge_domain_ptr(u8 *s, va_list *args)
static clib_error_t * gbp_bridge_domain_init(vlib_main_t *vm)
#define pool_put(P, E)
Free an object E in pool P.
enum l2_bd_port_type_t_ l2_bd_port_type_t
u32 gb_bd_id
Bridge-domain ID.
u32 gb_rdi
Index of the Route-domain this BD is associated with.
static index_t gbp_bridge_domain_find(u32 bd_id)
gbp_bridge_domain_flags_t gb_flags
Flags conttrolling behaviour.
void gbp_itf_hdl_reset(gbp_itf_hdl_t *gh)
static clib_error_t * gbp_bridge_domain_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static int gbp_bridge_domain_show_one(gbp_bridge_domain_t *gb, void *ctx)
u32 gb_locks
locks/references to the BD so it does not get deleted (from the API) whilst it is still being used ...
u32 l2fib_del_entry(const u8 *mac, u32 bd_index, u32 sw_if_index)
Delete an entry from the l2fib.
int(* gbp_bridge_domain_cb_t)(gbp_bridge_domain_t *gb, void *ctx)
gbp_itf_hdl_t gbp_itf_l2_add_and_lock(u32 sw_if_index, index_t gbi)
sll srl srl sll sra u16x4 i
u8 * format_gbp_bridge_domain(u8 *s, va_list *args)
static void gbp_bridge_domain_db_remove(gbp_bridge_domain_t *gb)
u32 bd_set_flags(vlib_main_t *vm, u32 bd_index, bd_flags_t flags, u32 enable)
Set the learn/forward/flood flags for the bridge domain.
gbp_bridge_domain_db_t gbp_bridge_domain_db
DB of bridge_domains.
gbp_bridge_domain_t * gbp_bridge_domain_pool
Pool of GBP bridge_domains.
index_t gbp_bridge_domain_find_and_lock(u32 bd_id)
#define VLIB_CLI_COMMAND(x,...)
vl_api_interface_index_t bm_flood_sw_if_index
gbp_route_domain_t * gbp_route_domain_get(index_t i)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u32 gb_bvi_sw_if_index
The BD's BVI interface (obligatory)
u8 * format_gbp_itf_hdl(u8 *s, va_list *args)
u8 * format_gbp_bridge_domain_flags(u8 *s, va_list *args)
int gbp_bridge_domain_delete(u32 bd_id)
static vlib_main_t * vlib_get_main(void)
gbp_scope_t * gbp_scope_by_bd_index
Map of BD index to contract scope.
void gbp_itf_l2_set_input_feature(gbp_itf_hdl_t gh, l2input_feat_masks_t feats)
gbp_itf_hdl_t gb_bm_flood_itf
The BD's interface to sned Broadcast and multicast packets.
A route Domain Representation.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static clib_error_t * gbp_bridge_domain_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 bd_find_index(bd_main_t *bdm, u32 bd_id)
Get a bridge domain.
#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)
bd_flags
Flags that can be changed on a bridge domain.
u32 gbp_bridge_domain_get_bd_id(index_t gbdi)
vl_api_interface_index_t sw_if_index
index_t gbp_route_domain_find_and_lock(u32 rd_id)
enum bd_flags_t_ bd_flags_t