PcapPlusPlus  21.05
pcpp::NullLoopbackLayer Class Reference

#include <NullLoopbackLayer.h>

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

Public Member Functions

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

Detailed Description

Represents a NULL/Loopback layer

Constructor & Destructor Documentation

◆ NullLoopbackLayer() [1/2]

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

◆ NullLoopbackLayer() [2/2]

pcpp::NullLoopbackLayer::NullLoopbackLayer ( uint32_t  family)

A constructor that allocates a new Null/Loopback header

Parameters
[in]familyThe family protocol to set

◆ ~NullLoopbackLayer()

pcpp::NullLoopbackLayer::~NullLoopbackLayer ( )
inline

A destructor for this layer (does nothing)

Member Function Documentation

◆ computeCalculateFields()

void pcpp::NullLoopbackLayer::computeCalculateFields ( )
inlinevirtual

Does nothing for this layer

Implements pcpp::Layer.

◆ getFamily()

uint32_t pcpp::NullLoopbackLayer::getFamily ( ) const
Returns
The protocol family in this layer

◆ getHeaderLen()

size_t pcpp::NullLoopbackLayer::getHeaderLen ( ) const
inlinevirtual
Returns
Size of Null/Loopback header = 4B

Implements pcpp::Layer.

◆ getOsiModelLayer()

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

Implements pcpp::Layer.

◆ parseNextLayer()

void pcpp::NullLoopbackLayer::parseNextLayer ( )
virtual

Identifies the next layers by family:

Implements pcpp::Layer.

◆ setFamily()

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

Set a protocol family

Parameters
[in]familyThe family protocol to set

◆ toString()

std::string pcpp::NullLoopbackLayer::toString ( ) const
virtual
Returns
A string representation of the layer most important data (should look like the layer description in Wireshark)

Implements pcpp::Layer.