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 67 ethertype = clib_net_to_host_u16 (*(
u16 *) (l3h - 2));
74 if (ethertype == ETHERNET_TYPE_IP4)
78 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
#define TO_BVI_ERR_ETHERTYPE
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, u32 *next0)
Send a packet from L2 processing to L3 via the BVI interface.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#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 uword sparse_vec_index(void *v, uword sparse_index)
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
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.
static u32 eth_mac_equal(u8 *mac1, u8 *mac2)
#define SPARSE_VEC_INVALID_INDEX