18 #ifndef included_l2bvi_h 19 #define included_l2bvi_h 27 #define TO_BVI_ERR_OK 0 28 #define TO_BVI_ERR_BAD_MAC 1 29 #define TO_BVI_ERR_ETHERTYPE 2 61 u16 ethertype = clib_net_to_host_u16 (*(
u16 *) (l3h - 2));
68 if (ethertype == ETHERNET_TYPE_IP4)
72 else if (ethertype == ETHERNET_TYPE_IP6)
void l2bvi_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
#define TO_BVI_ERR_BAD_MAC
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
vnet_interface_main_t interface_main
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define TO_BVI_ERR_ETHERTYPE
int l2_bvi_delete(u32 sw_if_index)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
int l2_bvi_create(u32 instance, const mac_address_t *mac, u32 *sw_if_index)
#define static_always_inline
static uword ethernet_address_cast(u8 *a)
vlib_combined_counter_main_t * combined_sw_if_counters
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static int ethernet_mac_address_equal(const u8 *a, const u8 *b)
static uword sparse_vec_index(void *v, uword sparse_index)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define vec_elt(v, i)
Get vector value at index i.
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
VLIB buffer representation.
#define SPARSE_VEC_INVALID_INDEX
static_always_inline u32 l2_to_bvi(vlib_main_t *vlib_main, vnet_main_t *vnet_main, vlib_buffer_t *b0, u32 bvi_sw_if_index, next_by_ethertype_t *l3_next, u16 *next0)
Send a packet from L2 processing to L3 via the BVI interface.