25 NDP_OPTION_SOURCE_LINK_LAYER = 1,
26 NDP_OPTION_TARGET_LINK_LAYER = 2,
27 NDP_OPTION_PREFIX_INFORMATION = 3,
28 NDP_OPTION_REDIRECTED_HEADER = 4,
30 NDP_OPTION_UNKNOWN = 255
59 if (m_Data ==
nullptr)
60 return NDPNeighborOptionTypes::NDP_OPTION_UNKNOWN;
69 if (m_Data ==
nullptr)
72 return static_cast<size_t>(m_Data->recordLen) * 8;
77 if (m_Data ==
nullptr)
83 return static_cast<size_t>(m_Data->recordLen) * 8 - (2 *
sizeof(uint8_t));
178 virtual size_t getNdpHeaderLen()
const = 0;
179 virtual uint8_t* getNdpOptionsBasePtr()
const
181 return m_Data + getNdpHeaderLen();
183 NdpOption addNdpOptionAt(
const NdpOptionBuilder& optionBuilder,
int offset);
197 #pragma pack(push, 1)
258 void initLayer(uint8_t code,
const IPv6Address& targetIP);
263 size_t getNdpHeaderLen()
const override
265 return sizeof(ndpneighborsolicitationhdr);
280 #pragma pack(push, 1)
283 #if (BYTE_ORDER == LITTLE_ENDIAN)
335 bool routerFlag,
bool unicastFlag,
bool overrideFlag);
374 return getNdpHeader()->
router;
396 void initLayer(uint8_t code,
const IPv6Address& targetIP,
bool routerFlag,
bool unicastFlag,
bool overrideFlag);
401 size_t getNdpHeaderLen()
const override
403 return sizeof(ndpneighboradvertisementhdr);
Definition: IpAddress.h:199
Definition: IcmpV6Layer.h:133
Definition: MacAddress.h:25
Definition: NdpLayer.h:120
NdpOption getFirstNdpOption() const
size_t getNdpOptionCount() const
bool removeAllNdpOptions()
NdpOption getNdpOption(NDPNeighborOptionTypes option) const
NdpOption addNdpOption(const NdpOptionBuilder &optionBuilder)
NdpOption getNextNdpOption(NdpOption &option) const
Definition: NdpLayer.h:274
MacAddress getTargetMac() const
bool hasTargetMacInfo() const
IPv6Address getTargetIP() const
Definition: NdpLayer.h:359
NDPNeighborAdvertisementLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: NdpLayer.h:320
std::string toString() const override
bool getRouterFlag() const
Definition: NdpLayer.h:372
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)
bool getUnicastFlag() const
Definition: NdpLayer.h:380
bool getOverrideFlag() const
Definition: NdpLayer.h:388
Definition: NdpLayer.h:191
bool hasLinkLayerAddress() const
NDPNeighborSolicitationLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: NdpLayer.h:214
IPv6Address getTargetIP() const
Definition: NdpLayer.h:238
NDPNeighborSolicitationLayer(uint8_t code, const IPv6Address &targetIP)
MacAddress getLinkLayerAddress() const
std::string toString() const override
NDPNeighborSolicitationLayer(uint8_t code, const IPv6Address &targetIP, const MacAddress &srcMac)
Definition: NdpLayer.h:93
NdpOptionBuilder(NDPNeighborOptionTypes optionType, const uint8_t *optionValue, uint8_t optionValueLen)
Definition: NdpLayer.h:103
Definition: NdpLayer.h:39
NDPNeighborOptionTypes getNdpOptionType() const
Definition: NdpLayer.h:57
~NdpOption() override=default
NdpOption(uint8_t *optionRawData)
Definition: NdpLayer.h:45
size_t getDataSize() const override
Definition: NdpLayer.h:75
size_t getTotalSize() const override
Definition: NdpLayer.h:67
Definition: TLVData.h:419
Definition: TLVData.h:246
The main namespace for the PcapPlusPlus lib.
NDPNeighborOptionTypes
Definition: NdpLayer.h:24
Definition: NdpLayer.h:282
uint32_t override
Definition: NdpLayer.h:288
uint8_t targetIP[16]
Definition: NdpLayer.h:309
uint32_t solicited
Definition: NdpLayer.h:291
uint32_t router
Definition: NdpLayer.h:293
uint32_t reserved
Definition: NdpLayer.h:286
uint32_t reserved2
Definition: NdpLayer.h:295
Definition: NdpLayer.h:199
uint32_t reserved
Definition: NdpLayer.h:201
uint8_t targetIP[16]
Definition: NdpLayer.h:203
Definition: IcmpV6Layer.h:103