PcapPlusPlus  22.11
pcpp::AuthenticationHeaderLayer Class Reference

#include <IPSecLayer.h>

Inheritance diagram for pcpp::AuthenticationHeaderLayer:
pcpp::Layer pcpp::IDataContainer

Public Member Functions

 AuthenticationHeaderLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
ipsec_authentication_headergetAHHeader () const
 
uint32_t getSPI () const
 
uint32_t getSequenceNumber () const
 
size_t getICVLength () const
 
uint8_t * getICVBytes () const
 
std::string getICVHexStream () 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 AuthenticationHeader (AH) layer

Constructor & Destructor Documentation

◆ AuthenticationHeaderLayer()

pcpp::AuthenticationHeaderLayer::AuthenticationHeaderLayer ( 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::AuthenticationHeaderLayer::computeCalculateFields ( )
inlinevirtual

Does nothing for this layer

Implements pcpp::Layer.

◆ getAHHeader()

ipsec_authentication_header* pcpp::AuthenticationHeaderLayer::getAHHeader ( ) const
inline

Get a pointer to the raw AH header. Notice this points directly to the data, so every change will change the actual packet data

Returns
A pointer to the ipsec_authentication_header

◆ getHeaderLen()

size_t pcpp::AuthenticationHeaderLayer::getHeaderLen ( ) const
inlinevirtual
Returns
The size of the AH header

Implements pcpp::Layer.

◆ getICVBytes()

uint8_t* pcpp::AuthenticationHeaderLayer::getICVBytes ( ) const
Returns
A pointer to the raw data of the Integrity Check Value (ICV)

◆ getICVHexStream()

std::string pcpp::AuthenticationHeaderLayer::getICVHexStream ( ) const
Returns
The value of the Integrity Check Value (ICV) as a hex string

◆ getICVLength()

size_t pcpp::AuthenticationHeaderLayer::getICVLength ( ) const
Returns
The size of the Integrity Check Value (ICV)

◆ getOsiModelLayer()

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

Implements pcpp::Layer.

◆ getSequenceNumber()

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

◆ getSPI()

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

◆ isDataValid()

bool pcpp::AuthenticationHeaderLayer::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 AuthenticationHeader layer
[in]dataLenThe length of byte stream
Returns
True if the data is valid and can represent an AuthenticationHeader layer

◆ parseNextLayer()

void pcpp::AuthenticationHeaderLayer::parseNextLayer ( )
virtual

Currently identifies the following next layers: UdpLayer, TcpLayer, IPv4Layer, IPv6Layer and ESPLayer. Otherwise sets PayloadLayer

Implements pcpp::Layer.

◆ toString()

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

Implements pcpp::Layer.