PcapPlusPlus  Next
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 () override=default
 
uint32_t getFamily () const
 
void setFamily (uint32_t family)
 
void parseNextLayer () override
 
size_t getHeaderLen () const override
 
void computeCalculateFields () override
 
std::string toString () const override
 
OsiModelLayer getOsiModelLayer () const override
 
- Public Member Functions inherited from pcpp::Layer
 ~Layer () override
 
LayergetNextLayer () const
 
LayergetPrevLayer () const
 
ProtocolType getProtocol () const
 
bool isMemberOfProtocolFamily (ProtocolTypeFamily protocolTypeFamily) 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 override
 

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)
explicit

A constructor that allocates a new Null/Loopback header

Parameters
[in]familyThe family protocol to set

◆ ~NullLoopbackLayer()

pcpp::NullLoopbackLayer::~NullLoopbackLayer ( )
overridedefault

A destructor for this layer (does nothing)

Member Function Documentation

◆ computeCalculateFields()

void pcpp::NullLoopbackLayer::computeCalculateFields ( )
inlineoverridevirtual

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
inlineoverridevirtual
Returns
Size of Null/Loopback header = 4B

Implements pcpp::Layer.

◆ getOsiModelLayer()

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

Implements pcpp::Layer.

◆ parseNextLayer()

void pcpp::NullLoopbackLayer::parseNextLayer ( )
overridevirtual

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
overridevirtual
Returns
A string representation of the layer most important data (should look like the layer description in Wireshark)

Implements pcpp::Layer.