PcapPlusPlus  22.11
pcpp::NDPNeighborSolicitationLayer Class Reference

#include <NdpLayer.h>

Inheritance diagram for pcpp::NDPNeighborSolicitationLayer:
pcpp::NDPLayerBase pcpp::IcmpV6Layer pcpp::Layer pcpp::IDataContainer

Classes

struct  ndpneighborsolicitationhdr
 

Public Member Functions

 NDPNeighborSolicitationLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 NDPNeighborSolicitationLayer (uint8_t code, const IPv6Address &targetIP)
 
 NDPNeighborSolicitationLayer (uint8_t code, const IPv6Address &targetIP, const MacAddress &srcMac)
 
IPv6Address getTargetIP () const
 
bool hasLinkLayerAddress () const
 
MacAddress getLinkLayerAddress () const
 
std::string toString () const
 
- Public Member Functions inherited from pcpp::NDPLayerBase
size_t getNdpOptionCount () const
 
NdpOption getNdpOption (NDPNeighborOptionTypes option) const
 
NdpOption getFirstNdpOption () const
 
NdpOption getNextNdpOption (NdpOption &option) const
 
NdpOption addNdpOption (const NdpOptionBuilder &optionBuilder)
 
bool removeAllNdpOptions ()
 
- 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 a NDP Neighbor Solicitation protocol layer

Constructor & Destructor Documentation

◆ NDPNeighborSolicitationLayer() [1/3]

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

◆ NDPNeighborSolicitationLayer() [2/3]

pcpp::NDPNeighborSolicitationLayer::NDPNeighborSolicitationLayer ( uint8_t  code,
const IPv6Address targetIP 
)

A constructor for a new NDPNeighborSolicitationLayer object

Parameters
[in]codeCode field
[in]targetIPTarget IP address for which the solicitation shall be created

◆ NDPNeighborSolicitationLayer() [3/3]

pcpp::NDPNeighborSolicitationLayer::NDPNeighborSolicitationLayer ( uint8_t  code,
const IPv6Address targetIP,
const MacAddress srcMac 
)

A constructor for a new NDPNeighborSolicitationLayer object

Parameters
[in]codeCode field
[in]targetIPTarget IP address for which the solicitation shall be created
[in]srcMacMac address which shall be put in the linklayer option

Member Function Documentation

◆ getLinkLayerAddress()

MacAddress pcpp::NDPNeighborSolicitationLayer::getLinkLayerAddress ( ) const

Get the Link Layer Address

Returns
Mac address which is specified in the link layer address option

◆ getTargetIP()

IPv6Address pcpp::NDPNeighborSolicitationLayer::getTargetIP ( ) const
inline
Returns
Get the IP address specified as the target IP address in the solicitation message

◆ hasLinkLayerAddress()

bool pcpp::NDPNeighborSolicitationLayer::hasLinkLayerAddress ( ) const

Checks if the layer has a link layer address option set

Returns
true if link layer address option is available, false otherwise

◆ toString()

std::string pcpp::NDPNeighborSolicitationLayer::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.