PcapPlusPlus  23.09
pcpp::NDPLayerBase Class Referenceabstract

#include <NdpLayer.h>

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

Public Member Functions

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
 
std::string toString () 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 base for NDP packet types

Member Function Documentation

◆ addNdpOption()

NdpOption pcpp::NDPLayerBase::addNdpOption ( const NdpOptionBuilder optionBuilder)

Add a new NDP option at the end of the layer (after the last NDP option)

Parameters
[in]optionBuilderAn NdpOptionBuilder object that contains the NDP option data to be added
Returns
A NdpOption object that contains the newly added NDP option data or logical NULL (NdpOption::isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log

◆ getFirstNdpOption()

NdpOption pcpp::NDPLayerBase::getFirstNdpOption ( ) const
Returns
The first NDP option in the packet. If the current layer contains no options the returned value will contain a logical NULL (NdpOption::isNull() == true)

◆ getNdpOption()

NdpOption pcpp::NDPLayerBase::getNdpOption ( NDPNeighborOptionTypes  option) const

Get a NDP option by type.

Parameters
[in]optionNDP option type
Returns
An NdpOption object that contains the first option that matches this type, or logical NULL (NdpOption::isNull() == true) if no such option found

◆ getNdpOptionCount()

size_t pcpp::NDPLayerBase::getNdpOptionCount ( ) const
Returns
The number of NDP options in this layer

◆ getNextNdpOption()

NdpOption pcpp::NDPLayerBase::getNextNdpOption ( NdpOption option) const

Get the NDP option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (IdpOption::isNull() == true)

Parameters
[in]optionAn NDP option object that exists in the current layer
Returns
A NdpOption object that contains the NDP option data that comes next, or logical NULL if the given NDP option: (1) was the last one; or (2) contains a logical NULL; or (3) doesn't belong to this packet

◆ removeAllNdpOptions()

bool pcpp::NDPLayerBase::removeAllNdpOptions ( )

Remove all NDP options from the layer

Returns
True if options removed successfully or false if some error occurred (an appropriate error message will be printed to log)