Squashed commit of the following:
commit
59ee334a4e7e69b19bd8a25e8462b2a2005a0534
Author: Steven Baigal (sbaigal) <sbaigal@cisco.com>
Date: Tue Jun 25 14:04:58 2019 -0400
codec: add support of ignore_vlan flag from daq header
updated to skip vlan header process when ignore_vlan flag was set
else
codec.next_prot_id = (ProtocolId)proto;
+ codec.lyr_len = sizeof(vlan::VlanTagHdr);
+
+ if (raw.pkth->flags & DAQ_PKT_FLAG_IGNORE_VLAN)
+ return true;
+
// Vlan IDs 0 and 4095 are reserved.
const uint16_t vid = vh->vid();
if (vid == 0 || vid == 4095)
codec_event(codec, DECODE_BAD_VLAN);
- codec.lyr_len = sizeof(vlan::VlanTagHdr);
codec.proto_bits |= PROTO_BIT__VLAN;
return true;
}
const vlan::VlanTagHdr* get_vlan_layer(const Packet* const p)
{
- if ( p->proto_bits & PROTO_BIT__VLAN )
- {
- assert( p->vlan_idx < p->num_layers );
- const Layer* lyr = p->layers + p->vlan_idx;
- return reinterpret_cast<const vlan::VlanTagHdr*>(lyr->start);
- }
- return nullptr;
+ assert( p->proto_bits & PROTO_BIT__VLAN );
+ assert( p->vlan_idx < p->num_layers );
+ const Layer* lyr = p->layers + p->vlan_idx;
+ return reinterpret_cast<const vlan::VlanTagHdr*>(lyr->start);
}
const eth::EtherHdr* get_eth_layer(const Packet* const p)