PcapPlusPlus  23.09
pcpp::ICMPv6EchoLayer Class Reference

#include <IcmpV6Layer.h>

Inheritance diagram for pcpp::ICMPv6EchoLayer:
pcpp::IcmpV6Layer pcpp::Layer pcpp::IDataContainer

Public Types

enum  ICMPv6EchoType { REQUEST, REPLY }
 

Public Member Functions

 ICMPv6EchoLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 ICMPv6EchoLayer (ICMPv6EchoType echoType, uint16_t id, uint16_t sequence, const uint8_t *data, size_t dataLen)
 
uint16_t getIdentifier () const
 
uint16_t getSequenceNr () const
 
size_t getEchoDataLen () const
 
uint8_t * getEchoDataPtr () const
 
std::string toString () const
 
- Public Member Functions inherited from pcpp::IcmpV6Layer
 IcmpV6Layer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 IcmpV6Layer (ICMPv6MessageType msgType, uint8_t code, const uint8_t *data, size_t dataLen)
 
bool isMessageOfType (ICMPv6MessageType type) const
 
ICMPv6MessageType getMessageType () const
 
uint8_t getCode () const
 
uint16_t getChecksum () const
 
void parseNextLayer ()
 
size_t getHeaderLen () const
 
void computeCalculateFields ()
 
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
 

Additional Inherited Members

- Static Public Member Functions inherited from pcpp::IcmpV6Layer
static LayerparseIcmpV6Layer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 

Detailed Description

Represents an ICMPv6 echo request/reply protocol layer

Member Enumeration Documentation

◆ ICMPv6EchoType

An enum representing ICMPv6 echo message types

Enumerator
REQUEST 

Echo Request Type

REPLY 

Echo Reply Type

Constructor & Destructor Documentation

◆ ICMPv6EchoLayer() [1/2]

pcpp::ICMPv6EchoLayer::ICMPv6EchoLayer ( 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

◆ ICMPv6EchoLayer() [2/2]

pcpp::ICMPv6EchoLayer::ICMPv6EchoLayer ( ICMPv6EchoType  echoType,
uint16_t  id,
uint16_t  sequence,
const uint8_t *  data,
size_t  dataLen 
)

A constructor for a new echo request/reply layer

Parameters
[in]echoTypeThe type of the echo message
[in]idEcho request identifier
[in]sequenceEcho request sequence number
[in]dataA pointer to echo request payload to set
[in]dataLenThe length of the echo request payload

Member Function Documentation

◆ getEchoDataLen()

size_t pcpp::ICMPv6EchoLayer::getEchoDataLen ( ) const
inline
Returns
Size of the data in bytes

◆ getEchoDataPtr()

uint8_t* pcpp::ICMPv6EchoLayer::getEchoDataPtr ( ) const
inline
Returns
Pointer to the beginning of the data

◆ getIdentifier()

uint16_t pcpp::ICMPv6EchoLayer::getIdentifier ( ) const
Returns
Identifier in host representation

◆ getSequenceNr()

uint16_t pcpp::ICMPv6EchoLayer::getSequenceNr ( ) const
Returns
Sequence number in host representation

◆ toString()

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

Reimplemented from pcpp::IcmpV6Layer.