PcapPlusPlus  20.08
pcpp::IPv6AuthenticationHeader Class Reference

#include <IPv6Extensions.h>

Inheritance diagram for pcpp::IPv6AuthenticationHeader:
pcpp::IPv6Extension

Classes

struct  ipv6_authentication_header
 

Public Member Functions

 IPv6AuthenticationHeader (uint32_t securityParametersIndex, uint32_t sequenceNumber, const uint8_t *integrityCheckValue, size_t integrityCheckValueLen)
 
ipv6_authentication_headergetAuthHeader () const
 
uint8_t * getIntegrityCheckValue () const
 
size_t getIntegrityCheckValueLength () const
 
size_t getExtensionLen () const
 
- Public Member Functions inherited from pcpp::IPv6Extension
IPv6ExtensionType getExtensionType () const
 
virtual ~IPv6Extension ()
 
IPv6ExtensiongetNextHeader () const
 

Additional Inherited Members

- Public Types inherited from pcpp::IPv6Extension
enum  IPv6ExtensionType {
  IPv6HopByHop = 0, IPv6Routing = 43, IPv6Fragmentation = 44, IPv6AuthenticationHdr = 51,
  IPv6Destination = 60, IPv6ExtensionUnknown = 255
}
 

Detailed Description

Represents IPv6 authentication header extension (used in IPSec protocol) and allows easy access to all of its data

Constructor & Destructor Documentation

◆ IPv6AuthenticationHeader()

pcpp::IPv6AuthenticationHeader::IPv6AuthenticationHeader ( uint32_t  securityParametersIndex,
uint32_t  sequenceNumber,
const uint8_t *  integrityCheckValue,
size_t  integrityCheckValueLen 
)

A c'tor for creating a new IPv6 authentication header extension object not bounded to a packet. Useful for adding new extensions to an IPv6 layer with IPv6Layer::addExtension()

Parameters
[in]securityParametersIndexSecurity Parameters Index (SPI) value (will be written to ipv6_authentication_header::securityParametersIndex field)
[in]sequenceNumberSequence number value (will be written to ipv6_authentication_header::sequenceNumber field)
[in]integrityCheckValueA pointer to a buffer containing the integrity check value (ICV) data for this extension. Notice this pointer is read-only and its content isn't modified in any way
[in]integrityCheckValueLenThe length of the integrity check value (ICV) buffer

Member Function Documentation

◆ getAuthHeader()

ipv6_authentication_header* pcpp::IPv6AuthenticationHeader::getAuthHeader ( ) const
inline

Get a pointer to the fixed part of the authentication header. Notice the return pointer points directly to the data, so every change will modify the actual packet data

Returns
A pointer to the ipv6_authentication_header

◆ getExtensionLen()

size_t pcpp::IPv6AuthenticationHeader::getExtensionLen ( ) const
inlinevirtual

In the authentication header the extension length is calculated in a different way than other extensions. The calculation is: [ 4 * (ipv6_authentication_header::headerLen + 2) ]

Returns
The length of this extension

Reimplemented from pcpp::IPv6Extension.

◆ getIntegrityCheckValue()

uint8_t* pcpp::IPv6AuthenticationHeader::getIntegrityCheckValue ( ) const
Returns
A pointer to the buffer containing the integrity check value (ICV) for this extension. Notice that any change in this buffer will lead to a change in the extension data

◆ getIntegrityCheckValueLength()

size_t pcpp::IPv6AuthenticationHeader::getIntegrityCheckValueLength ( ) const
Returns
The length of the integrity check value (ICV) buffer