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.
uint8_t pcpp::VlanLayer::getCFI | ( | ) |
|
inlinevirtual |
Implements pcpp::Layer.
|
inlinevirtual |
Implements pcpp::Layer.
uint8_t pcpp::VlanLayer::getPriority | ( | ) |
|
inline |
Get a pointer to the VLAN header. Notice this points directly to the data, so every change will change the actual packet data
uint16_t pcpp::VlanLayer::getVlanID | ( | ) |
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.
void pcpp::VlanLayer::setCFI | ( | bool | cfi | ) |
Set CFI bit
[in] | cfi | The CFI bit to set |
void pcpp::VlanLayer::setPriority | ( | uint8_t | priority | ) |
Set priority value
[in] | priority | The priority value to set |
void pcpp::VlanLayer::setVlanID | ( | uint16_t | id | ) |
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.