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 94 u16 ethertype = clib_net_to_host_u16 (*(
u16 *) (l3h - 2));
101 if (ethertype == ETHERNET_TYPE_IP4)
105 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
mac_address_t * secondary_addrs
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.
ethernet_main_t ethernet_main
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
vl_api_interface_index_t bvi_sw_if_index
vl_api_fib_path_type_t type
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_always_inline u32 l2_to_bvi_dmac_check(vnet_hw_interface_t *hi, u8 *dmac, ethernet_interface_t *ei, u8 have_sec_dmac)
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)
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VLIB buffer representation.
#define vec_foreach(var, vec)
Vector iterator.
vl_api_interface_index_t sw_if_index
#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.