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 66 ethertype = clib_net_to_host_u16(*(
u16 *)(l3h - 2));
73 if (ethertype == ETHERNET_TYPE_IP4) {
75 }
else if (ethertype == ETHERNET_TYPE_IP6) {
always_inline u32 eth_mac_equal(u8 *mac1, u8 *mac2)
void l2bvi_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
#define TO_BVI_ERR_BAD_MAC
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
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)
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define static_always_inline
vlib_combined_counter_main_t * combined_sw_if_counters
always_inline void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 cpu_index, u32 index, u32 packet_increment, u32 byte_increment)
always_inline uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
int vlib_main(vlib_main_t *vm, unformat_input_t *input)
always_inline uword ethernet_address_cast(u8 *a)
always_inline vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define vec_elt(v, i)
Get vector value at index i.
always_inline void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define SPARSE_VEC_INVALID_INDEX
always_inline uword sparse_vec_index(void *v, uword sparse_index)