39 u32 dev_instance = va_arg (*args,
u32);
40 return format (s,
"bvi%d", dev_instance);
73 #define BVI_MAX_INSTANCE (16 * 1024) 150 *sw_if_indexp = (
u32) ~ 0;
159 return VNET_API_ERROR_INVALID_REGISTRATION;
183 instance, mac.
bytes, &hw_if_index,
188 rv = VNET_API_ERROR_INVALID_REGISTRATION;
215 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
219 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
222 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
240 instance = sw_if_index = ~0;
249 else if (
unformat (line_input,
"instance %d", &instance))
287 .path =
"bvi create",
288 .short_help =
"bvi create [mac <mac-addr>] [instance <instance>]",
313 if (~0 != sw_if_index)
338 .path =
"bvi delete",
339 .short_help =
"bvi delete <interface>",
VNET_DEVICE_CLASS(bvi_device_class)
void ethernet_delete_interface(vnet_main_t *vnm, u32 hw_if_index)
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)
static uword * l2_bvi_instances
vnet_interface_main_t interface_main
uword vlib_node_add_named_next_with_slot(vlib_main_t *vm, uword node, char *name, uword slot)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
VNET_DEVICE_CLASS_TX_FN() bvi_device_class(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
send packets to l2-input.
void l2flood_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
Add the L3 input node for this ethertype to the next nodes structure.
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
static_always_inline void mac_address_copy(mac_address_t *dst, const mac_address_t *src)
static_always_inline int mac_address_is_zero(const mac_address_t *mac)
unformat_function_t unformat_vnet_sw_interface
format_function_t format_vnet_sw_if_index_name
static clib_error_t * l2_bvi_delete_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static_always_inline void mac_address_set_zero(mac_address_t *mac)
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_flood_class_t flood_class
vl_api_interface_index_t sw_if_index
#define clib_error_return(e, args...)
vl_api_fib_path_type_t type
static_always_inline void mac_address_from_bytes(mac_address_t *mac, const u8 *bytes)
void l2fwd_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
Add the L3 input node for this ethertype to the next nodes structure.
uword unformat_mac_address_t(unformat_input_t *input, va_list *args)
int l2_bvi_delete(u32 sw_if_index)
static clib_error_t * bvi_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static u8 * format_bvi_name(u8 *s, va_list *args)
static int bvi_instance_free(u32 instance)
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
#define VLIB_CLI_COMMAND(x,...)
static clib_error_t * bvi_mac_change(vnet_hw_interface_t *hi, const u8 *old_address, const u8 *mac_address)
#define clib_error_report(e)
static vlib_main_t * vlib_get_main(void)
static u32 bvi_instance_alloc(u32 want)
static clib_error_t * l2_bvi_create_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void l2bvi_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
clib_error_t * ethernet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, const u8 *address, u32 *hw_if_index_return, ethernet_flag_change_function_t flag_change)
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
vnet_sw_interface_t * sw_interfaces
static uword clib_bitmap_first_clear(uword *ai)
Return the lowest numbered clear bit in a bitmap.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
int l2_bvi_create(u32 user_instance, const mac_address_t *mac_in, u32 *sw_if_indexp)