53 #define _(sym,name) name, 67 static char *display_names[] = {
68 #define _(sym,name) #sym, 72 u32 feature_bitmap = va_arg (*args,
u32);
73 u32 verbose = va_arg (*args,
u32);
75 if (feature_bitmap == 0)
77 s =
format (s,
" none configured");
81 feature_bitmap &= ~L2INPUT_FEAT_DROP;
85 if (feature_bitmap & (1 << i))
88 s =
format (s,
"%17s (%s)\n",
101 u32 verbose = va_arg (*args,
u32);
129 s =
format (s,
" L2 bridge bd-id %d idx %d shg %d %s",
134 s =
format (s,
" L2 xconnect %U",
202 const u8 * old_address,
const u8 * new_address)
216 L2FIB_ENTRY_RESULT_FLAG_BVI |
217 L2FIB_ENTRY_RESULT_FLAG_STATIC);
270 i32 l2_if_adjust = 0;
372 L2INPUT_FEAT_UU_FLOOD |
373 L2INPUT_FEAT_UU_FWD |
376 L2INPUT_FEAT_ARP_UFWD |
377 L2INPUT_FEAT_ARP_TERM);
406 L2FIB_ENTRY_RESULT_FLAG_BVI |
407 L2FIB_ENTRY_RESULT_FLAG_STATIC);
433 .flags = member_flags,
449 ~(L2INPUT_FEAT_LEARN | L2INPUT_FEAT_FWD | L2INPUT_FEAT_FLOOD);
461 L2INPUT_FEAT_DROP | L2INPUT_FEAT_INPUT_CLASSIFY;
465 ~(L2INPUT_FEAT_LEARN | L2INPUT_FEAT_FWD | L2INPUT_FEAT_FLOOD);
498 else if ((hi->
l2_if_count == 0) && (l2_if_adjust == -1))
512 if (dev_class->set_l2_mode_function)
514 dev_class->set_l2_mode_function (vnet_main, hi, l2_if_adjust);
569 if (!
unformat (input,
"%d", &bd_id))
593 (void)
unformat (input,
"%d", &shg);
651 .path =
"set interface l2 bridge",
652 .short_help =
"set interface l2 bridge <interface> <bridge-domain-id> [bvi|uu-fwd] [shg]",
717 .path =
"set interface l2 xconnect",
718 .short_help =
"set interface l2 xconnect <interface> <peer interface>",
767 .path =
"set interface l3",
768 .short_help =
"set interface l3 <interface>",
827 args =
format (0,
"bd_id %d%s shg %d", bd_id,
832 mode =
"l2 xconnect";
884 .short_help =
"show mode [<if-name1> <if-name2> ...]",
889 #define foreach_l2_init_function \ 890 _(feat_bitmap_drop_init) \ 892 _(l2_input_classify_init) \ 895 _(l2_in_out_acl_init) \ 899 _(l2_efp_filter_init) \ 912 if ((error = vlib_call_init_function (vm, a))) return error; } \ void bd_validate(l2_bridge_domain_t *bd_config)
Init bridge domain if not done already.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
l2_input_config_t * configs
#define L2_FLOOD_MEMBER_NORMAL
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define pool_foreach(VAR, POOL)
Iterate through pool.
vnet_interface_main_t interface_main
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
unformat_function_t unformat_vnet_sw_interface
u32 bd_remove_member(l2_bridge_domain_t *bd_config, u32 sw_if_index)
#define L2_FLOOD_MEMBER_BVI
u32 * output_node_index_vec
struct _vnet_device_class vnet_device_class_t
format_function_t format_vnet_sw_if_index_name
enum walk_rc_t_ walk_rc_t
Walk return code.
l2_bridge_domain_t * bd_get(u32 bd_index)
void l2output_create_output_node_mapping(vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index)
Create a mapping in the next node mapping table for the given sw_if_index.
vnet_flood_class_t flood_class
#define VLIB_INIT_FUNCTION(x)
static vnet_device_class_t * vnet_get_device_class(vnet_main_t *vnm, u32 dev_class_index)
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
void bd_add_member(l2_bridge_domain_t *bd_config, l2_flood_member_t *member)
description fragment has unexpected format
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#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.
u32 bd_input_walk(u32 bd_index, bd_input_walk_fn_t fn, void *data)
l2_output_config_t * l2output_intf_config(u32 sw_if_index)
Get a pointer to the config for the given interface.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
enum l2_bd_port_type_t_ l2_bd_port_type_t
l2output_main_t l2output_main
u32 feat_next_node_index[32]
vl_api_tunnel_mode_t mode
vnet_hw_interface_class_t ethernet_hw_interface_class
u32 l2fib_del_entry(const u8 *mac, u32 bd_index, u32 sw_if_index)
Delete an entry from the l2fib.
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
static void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)
Initialize the feature next-node indexes of a graph node.
void ethernet_register_l2_input(vlib_main_t *vm, u32 node_index)
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
#define VLIB_CLI_COMMAND(x,...)
static u32 bd_find_or_add_bd_index(bd_main_t *bdm, u32 bd_id)
Get or create a bridge domain.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static vlib_main_t * vlib_get_main(void)
void ethernet_sw_interface_set_l2_mode(vnet_main_t *vnm, u32 sw_if_index, u32 l2)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vnet_sw_interface_t * sw_interfaces
l2_bridge_domain_t * bd_configs
#define vec_foreach(var, vec)
Vector iterator.
u32 bd_find_index(bd_main_t *bdm, u32 bd_id)
Get a bridge domain.
void l2fib_table_init(void)
#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)
void l2fib_flush_int_mac(vlib_main_t *vm, u32 sw_if_index)
Flush all non static MACs from an interface.
vl_api_interface_index_t sw_if_index
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
static uword pool_elts(void *v)
Number of active elements in a pool.