18 #ifndef included_vnet_l2_input_h 19 #define included_vnet_l2_input_h 66 u32 feat_next_node_index[32];
93 #define L2INPUT_BVI ((u32) (~0-1)) 98 #define foreach_l2input_feat \ 99 _(DROP, "feature-bitmap-drop") \ 100 _(XCONNECT, "l2-output") \ 101 _(FLOOD, "l2-flood") \ 102 _(ARP_TERM, "arp-term-l2bd") \ 103 _(UU_FLOOD, "l2-flood") \ 106 _(LEARN, "l2-learn") \ 107 _(VTR, "l2-input-vtr") \ 108 _(VPATH, "vpath-input-l2") \ 109 _(ACL, "l2-input-acl") \ 110 _(POLICER_CLAS, "l2-policer-classify") \ 111 _(INPUT_CLASSIFY, "l2-input-classify") 116 #define _(sym,str) L2INPUT_FEAT_##sym##_BIT, 125 #define _(sym,str) L2INPUT_FEAT_##sym = (1<<L2INPUT_FEAT_##sym##_BIT), 145 L2INPUT_FEAT_UU_FLOOD);
151 return ((bd_config->
feature_bitmap & L2INPUT_FEAT_FWD) == L2INPUT_FEAT_FWD);
165 L2INPUT_FEAT_ARP_TERM);
175 u32 feature_bitmap,
u32 enable);
182 #define MODE_L2_BRIDGE 1 184 #define MODE_L2_CLASSIFY 3 186 #define MODE_ERROR_ETH 1 187 #define MODE_ERROR_BVI_DEF 2 212 ethertype = clib_net_to_host_u16 (eth->
type);
218 vlan = (
void *) (eth + 1);
219 ethertype = clib_net_to_host_u16 (vlan->
type);
220 if (ethertype == ETHERNET_TYPE_VLAN)
240 u16 ethertype = clib_net_to_host_u16 (*(
u16 *) (l3h - 2));
242 if (ethertype == ETHERNET_TYPE_IP4)
244 else if (ethertype == ETHERNET_TYPE_IP6)
l2_input_config_t * configs
static u32 ip4_compute_flow_hash(const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
struct _vlib_node_registration vlib_node_registration_t
#define hash_v3_mix32(a, b, c)
#define static_always_inline
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u32 ip6_compute_flow_hash(const ip6_header_t *ip, flow_hash_config_t flow_hash_config)
#define ethernet_buffer_set_vlan_count(b, v)
Sets the number of VLAN headers in the current Ethernet frame in the buffer.
static u32 bd_is_valid(l2_bridge_domain_t *bd_config)
#define hash_v3_finalize32(a, b, c)
static_always_inline int ethernet_frame_is_tagged(u16 type)
#define IP_FLOW_HASH_DEFAULT
Default: 5-tuple without the "reverse" bit.
l2_bridge_domain_t * bd_configs