PcapPlusPlus  22.05
pcpp::ESPLayer Class Reference

#include <IPSecLayer.h>

Inheritance diagram for pcpp::ESPLayer:
pcpp::Layer pcpp::IDataContainer

Public Member Functions

 ESPLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
uint32_t getSPI () const
 
uint32_t getSequenceNumber () const
 
size_t getHeaderLen () const
 
void parseNextLayer ()
 
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
 

Static Public Member Functions

static bool isDataValid (const uint8_t *data, size_t dataLen)
 

Detailed Description

Represents an IPSec Encapsulating Security Payload (ESP) layer

Constructor & Destructor Documentation

◆ ESPLayer()

pcpp::ESPLayer::ESPLayer ( uint8_t *  data,
size_t  dataLen,
Layer prevLayer,
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]prevLayerA pointer to the previous layer
[in]packetA pointer to the Packet instance where layer will be stored in

Member Function Documentation

◆ computeCalculateFields()

void pcpp::ESPLayer::computeCalculateFields ( )
inlinevirtual

Does nothing for this layer

Implements pcpp::Layer.

◆ getHeaderLen()

size_t pcpp::ESPLayer::getHeaderLen ( ) const
inlinevirtual
Returns
The size of the ESP header (8 bytes)

Implements pcpp::Layer.

◆ getOsiModelLayer()

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

Implements pcpp::Layer.

◆ getSequenceNumber()

uint32_t pcpp::ESPLayer::getSequenceNumber ( ) const
Returns
The sequence number value

◆ getSPI()

uint32_t pcpp::ESPLayer::getSPI ( ) const
Returns
The Security Parameters Index (SPI) field value

◆ isDataValid()

bool pcpp::ESPLayer::isDataValid ( const uint8_t *  data,
size_t  dataLen 
)
inlinestatic

A static method that validates the input data

Parameters
[in]dataThe pointer to the beginning of a byte stream of a ESP layer
[in]dataLenThe length of byte stream
Returns
True if the data is valid and can represent an ESP layer

◆ parseNextLayer()

void pcpp::ESPLayer::parseNextLayer ( )
virtual

The payload of an ESP layer is encrypted, hence the next layer is always a generic payload (PayloadLayer)

Implements pcpp::Layer.

◆ toString()

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

Implements pcpp::Layer.