PcapPlusPlus  23.09
pcpp::NDPNeighborAdvertisementLayer Class Reference

#include <NdpLayer.h>

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

Classes

struct  ndpneighboradvertisementhdr
 

Public Member Functions

 NDPNeighborAdvertisementLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 NDPNeighborAdvertisementLayer (uint8_t code, const IPv6Address &targetIP, const MacAddress &targetMac, bool routerFlag, bool unicastFlag, bool overrideFlag)
 
 NDPNeighborAdvertisementLayer (uint8_t code, const IPv6Address &targetIP, bool routerFlag, bool unicastFlag, bool overrideFlag)
 
MacAddress getTargetMac () const
 
IPv6Address getTargetIP () const
 
bool hasTargetMacInfo () const
 
bool getRouterFlag () const
 
bool getUnicastFlag () const
 
bool getOverrideFlag () 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 Advertisement protocol layer

Constructor & Destructor Documentation

◆ NDPNeighborAdvertisementLayer() [1/3]

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

◆ NDPNeighborAdvertisementLayer() [2/3]

pcpp::NDPNeighborAdvertisementLayer::NDPNeighborAdvertisementLayer ( uint8_t  code,
const IPv6Address targetIP,
const MacAddress targetMac,
bool  routerFlag,
bool  unicastFlag,
bool  overrideFlag 
)

A constructor that allocates a new NDP Advertisement Layer with target link-layer address option

Parameters
[in]codeCode field
[in]targetIPThe target IP address from the Neighbor Solicitation message (solicited advertisements) or the address whose link-layer address has changed (unsolicited advertisement)
[in]targetMacAdds the target link-layer address into the option field of the layer
[in]routerFlagThe router flag
[in]unicastFlagThe solicited flag
[in]overrideFlagThe override flag

◆ NDPNeighborAdvertisementLayer() [3/3]

pcpp::NDPNeighborAdvertisementLayer::NDPNeighborAdvertisementLayer ( uint8_t  code,
const IPv6Address targetIP,
bool  routerFlag,
bool  unicastFlag,
bool  overrideFlag 
)

A constructor that allocates a new NDP Advertisement Layer

Parameters
codeCode field
targetIPThe target IP address from the Neighbor Solicitation message (solicited advertisements) or the address whose link-layer address has changed (unsolicited advertisement)
routerFlagThe router flag
unicastFlagThe solicited flag
overrideFlagThe override flag

Member Function Documentation

◆ getOverrideFlag()

bool pcpp::NDPNeighborAdvertisementLayer::getOverrideFlag ( ) const
inline
Returns
Get the override flag

◆ getRouterFlag()

bool pcpp::NDPNeighborAdvertisementLayer::getRouterFlag ( ) const
inline
Returns
Get the router flag

◆ getTargetIP()

IPv6Address pcpp::NDPNeighborAdvertisementLayer::getTargetIP ( ) const
inline
Returns
Get the target IP address

◆ getTargetMac()

MacAddress pcpp::NDPNeighborAdvertisementLayer::getTargetMac ( ) const
Returns
Get the target MAC address

◆ getUnicastFlag()

bool pcpp::NDPNeighborAdvertisementLayer::getUnicastFlag ( ) const
inline
Returns
Get the unicast flag

◆ hasTargetMacInfo()

bool pcpp::NDPNeighborAdvertisementLayer::hasTargetMacInfo ( ) const
Returns
Get information if the target link-layer address was added in the option field of the header

◆ toString()

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