PcapPlusPlus
pcpp::NullLoopbackLayer Class Reference

#include <NullLoopbackLayer.h>

Inheritance diagram for pcpp::NullLoopbackLayer:
pcpp::Layer

Public Member Functions

 NullLoopbackLayer (uint8_t *data, size_t dataLen, Packet *packet)
 
 NullLoopbackLayer (uint32_t family)
 
 ~NullLoopbackLayer ()
 
uint32_t getFamily ()
 
void setFamily (uint32_t family)
 
void parseNextLayer ()
 
size_t getHeaderLen ()
 
void computeCalculateFields ()
 
std::string toString ()
 
OsiModelLayer getOsiModelLayer ()
 
- Public Member Functions inherited from pcpp::Layer
virtual ~Layer ()
 
LayergetNextLayer ()
 
LayergetPrevLayer ()
 
ProtocolType getProtocol ()
 
uint8_t * getData ()
 
size_t getDataLen ()
 
uint8_t * getLayerPayload ()
 
size_t getLayerPayloadSize ()
 
bool isAllocatedToPacket ()
 
void copyData (uint8_t *toArr)
 

Detailed Description

Represents a NULL/Loopback layer

Constructor & Destructor Documentation

pcpp::NullLoopbackLayer::NullLoopbackLayer ( uint8_t *  data,
size_t  dataLen,
Packet packet 
)
inline

A constructor that creates the layer from an existing packet raw data

Parameters
[in]dataA pointer to the raw data
[in]dataLenSize of the data in bytes
[in]packetA pointer to the Packet instance where layer will be stored in
pcpp::NullLoopbackLayer::NullLoopbackLayer ( uint32_t  family)

A constructor that allocates a new Null/Loopback header

Parameters
[in]familyThe family protocol to set
pcpp::NullLoopbackLayer::~NullLoopbackLayer ( )
inline

A destructor for this layer (does nothing)

Member Function Documentation

void pcpp::NullLoopbackLayer::computeCalculateFields ( )
inlinevirtual

Does nothing for this layer

Implements pcpp::Layer.

uint32_t pcpp::NullLoopbackLayer::getFamily ( )
Returns
The protocol family in this layer
size_t pcpp::NullLoopbackLayer::getHeaderLen ( )
inlinevirtual
Returns
Size of Null/Loopback header = 4B

Implements pcpp::Layer.

OsiModelLayer pcpp::NullLoopbackLayer::getOsiModelLayer ( )
inlinevirtual
Returns
The OSI Model layer this protocol belongs to

Implements pcpp::Layer.

void pcpp::NullLoopbackLayer::parseNextLayer ( )
virtual

Identifies the next layers by family:

Implements pcpp::Layer.

void pcpp::NullLoopbackLayer::setFamily ( uint32_t  family)

Set a protocol family

Parameters
[in]familyThe family protocol to set
std::string pcpp::NullLoopbackLayer::toString ( )
virtual
Returns
A string representation of the layer most important data (should look like the layer description in Wireshark)

Implements pcpp::Layer.