PcapPlusPlus
|
#include <VlanLayer.h>
Public Member Functions | |
VlanLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
VlanLayer (const uint16_t vlanID, bool cfi, uint8_t priority, uint16_t etherType) | |
vlan_header * | getVlanHeader () |
uint16_t | getVlanID () |
uint8_t | getCFI () |
uint8_t | getPriority () |
void | setVlanID (uint16_t id) |
void | setCFI (bool cfi) |
void | setPriority (uint8_t priority) |
void | parseNextLayer () |
size_t | getHeaderLen () |
void | computeCalculateFields () |
std::string | toString () |
OsiModelLayer | getOsiModelLayer () |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
Layer * | getNextLayer () |
Layer * | getPrevLayer () |
ProtocolType | getProtocol () |
uint8_t * | getData () |
size_t | getDataLen () |
uint8_t * | getLayerPayload () |
size_t | getLayerPayloadSize () |
bool | isAllocatedToPacket () |
void | copyData (uint8_t *toArr) |
uint8_t * | getDataPtr (size_t offset=0) |
Represents a VLAN tunnel layer
|
inline |
A constructor that creates the layer from an existing packet raw data
[in] | data | A pointer to the raw data |
[in] | dataLen | Size of the data in bytes |
[in] | prevLayer | A pointer to the previous layer |
[in] | packet | A pointer to the Packet instance where layer will be stored in |
pcpp::VlanLayer::VlanLayer | ( | const uint16_t | vlanID, |
bool | cfi, | ||
uint8_t | priority, | ||
uint16_t | etherType | ||
) |
A constructor that allocates a new VLAN header
[in] | vlanID | VLAN ID |
[in] | cfi | CFI value |
[in] | priority | Priority value |
[in] | etherType | Protocol EtherType of the next layer |
|
inlinevirtual |
Does nothing for this layer
Implements pcpp::Layer.
|
inline |
|
inlinevirtual |
Implements pcpp::Layer.
|
inlinevirtual |
Implements pcpp::Layer.
|
inline |
|
inline |
Get a pointer to the VLAN header. Notice this points directly to the data, so every change will change the actual packet data
|
inline |
Get the VLAN ID value. This method differs from vlan_header::vlanID because vlan_header::vlanID is 12 bits long in a 16 bit field. This methods extracts only the 12 bit relevant for the VLAN ID
|
virtual |
Currently identifies the following next layers: IPv4Layer, IPv6Layer, ArpLayer, VlanLayer, MplsLayer. Otherwise sets PayloadLayer
Implements pcpp::Layer.
|
inline |
Set CFI bit
[in] | cfi | The CFI bit to set |
|
inline |
Set priority value
[in] | priority | The priority value to set |
|
inline |
Set VLAN ID. This method differs from setting vlan_header::vlanID because vlan_header::vlanID is 12 bits long in a 16 bit field. This methods sets only the 12 bit relevant for the VLAN ID
[in] | id | The VLAN ID to set |
|
virtual |
Implements pcpp::Layer.