18 #ifndef included_vnet_l2_input_h 19 #define included_vnet_l2_input_h 63 u32 feat_next_node_index[32];
92 #define foreach_l2input_feat \ 93 _(DROP, "feature-bitmap-drop") \ 94 _(CLASSIFY, "l2-classify") \ 95 _(XCONNECT, "l2-output") \ 96 _(IPIW, "feature-bitmap-drop") \ 97 _(FLOOD, "l2-flood") \ 98 _(ARP_TERM, "arp-term-l2bd") \ 99 _(UU_FLOOD, "l2-flood") \ 102 _(LEARN, "l2-learn") \ 103 _(VTR, "l2-input-vtr") \ 104 _(VPATH, "vpath-input-l2") \ 105 _(CTRL_PKT, "feature-bitmap-drop") \ 106 _(L2PT, "feature-bitmap-drop") \ 107 _(IGMP_SNOOP, "feature-bitmap-drop") \ 108 _(MLD_SNOOP, "feature-bitmap-drop") \ 109 _(DHCP_SNOOP, "feature-bitmap-drop") \ 110 _(DAI, "feature-bitmap-drop") \ 111 _(IPSG, "feature-bitmap-drop") \ 112 _(ACL, "l2-input-acl") \ 113 _(QOS, "feature-bitmap-drop") \ 114 _(CFM, "feature-bitmap-drop") \ 115 _(SPAN, "feature-bitmap-drop") \ 116 _(POLICER_CLAS, "l2-policer-classify") 121 #define _(sym,str) L2INPUT_FEAT_##sym##_BIT, 130 #define _(sym,str) L2INPUT_FEAT_##sym = (1<<L2INPUT_FEAT_##sym##_BIT), 150 L2INPUT_FEAT_UU_FLOOD);
156 return ((bd_config->
feature_bitmap & L2INPUT_FEAT_FWD) == L2INPUT_FEAT_FWD);
170 L2INPUT_FEAT_ARP_TERM);
175 #define IP4_FEAT_MASK ~(L2INPUT_FEAT_CTRL_PKT | \ 176 L2INPUT_FEAT_MLD_SNOOP | \ 177 L2INPUT_FEAT_L2PT | \ 181 #define IP6_FEAT_MASK ~(L2INPUT_FEAT_CTRL_PKT | \ 182 L2INPUT_FEAT_IGMP_SNOOP | \ 183 L2INPUT_FEAT_L2PT | \ 187 #define IP_UDP_TCP_FEAT_MASK ~(L2INPUT_FEAT_CTRL_PKT | \ 188 L2INPUT_FEAT_L2PT | \ 189 L2INPUT_FEAT_IGMP_SNOOP | \ 190 L2INPUT_FEAT_MLD_SNOOP | \ 191 L2INPUT_FEAT_DHCP_SNOOP | \ 195 #define MPLS_FEAT_MASK ~(L2INPUT_FEAT_CTRL_PKT | \ 196 L2INPUT_FEAT_L2PT | \ 197 L2INPUT_FEAT_IGMP_SNOOP | \ 198 L2INPUT_FEAT_MLD_SNOOP | \ 199 L2INPUT_FEAT_DHCP_SNOOP | \ 209 u32 feature_bitmap,
u32 enable);
216 #define MODE_L2_BRIDGE 1 218 #define MODE_L2_CLASSIFY 3 220 #define MODE_ERROR_ETH 1 221 #define MODE_ERROR_BVI_DEF 2 246 ethertype = clib_net_to_host_u16 (eth->
type);
247 if ((ethertype == ETHERNET_TYPE_VLAN) ||
248 (ethertype == ETHERNET_TYPE_DOT1AD) ||
249 (ethertype == ETHERNET_TYPE_VLAN_9100) ||
250 (ethertype == ETHERNET_TYPE_VLAN_9200))
255 vlan = (
void *) (eth + 1);
256 ethertype = clib_net_to_host_u16 (vlan->
type);
257 if (ethertype == ETHERNET_TYPE_VLAN)
277 u16 ethertype = clib_net_to_host_u16 (*(
u16 *) (l3h - 2));
279 if (ethertype == ETHERNET_TYPE_IP4)
281 else if (ethertype == ETHERNET_TYPE_IP6)
l2_input_config_t * configs
struct _vlib_node_registration vlib_node_registration_t
#define hash_v3_mix32(a, b, c)
#define static_always_inline
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static u32 ip6_compute_flow_hash(ip6_header_t *ip, u32 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)
#define IP_FLOW_HASH_DEFAULT
Default: 5-tuple without the "reverse" bit.
l2_bridge_domain_t * bd_configs
static u32 ip4_compute_flow_hash(ip4_header_t *ip, u32 flow_hash_config)