|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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)
int l2_bvi_delete(u32 sw_if_index)
#define TO_BVI_ERR_BAD_MAC
#define TO_BVI_ERR_ETHERTYPE
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vl_api_interface_index_t bvi_sw_if_index
#define SPARSE_VEC_INVALID_INDEX
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
#define vec_elt(v, i)
Get vector value at index i.
static int ethernet_mac_address_equal(const u8 *a, const u8 *b)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
int l2_bvi_create(u32 instance, const mac_address_t *mac, u32 *sw_if_index)
#define static_always_inline
static uword sparse_vec_index(void *v, uword sparse_index)
@ VNET_INTERFACE_COUNTER_RX
vlib_combined_counter_main_t * combined_sw_if_counters
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
ethernet_main_t ethernet_main
static uword ethernet_address_cast(const u8 *a)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define vec_foreach(var, vec)
Vector iterator.
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 void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
void l2bvi_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
vl_api_interface_index_t sw_if_index
ethernet_interface_address_t * secondary_addrs
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.
vl_api_fib_path_type_t type
vnet_interface_main_t interface_main
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
VLIB buffer representation.