|
PcapPlusPlus
20.08
|
Go to the documentation of this file. 1 #ifndef PACKETPP_IPV6_LAYER
2 #define PACKETPP_IPV6_LAYER
23 #if (BYTE_ORDER == LITTLE_ENDIAN)
121 template<
class TIPv6Extension>
133 template<
class TIPv6Extension>
134 TIPv6Extension*
addExtension(
const TIPv6Extension& extensionHeader);
152 static inline bool isDataValid(
const uint8_t* data,
size_t dataLen);
181 void parseExtensions();
182 void deleteExtensions();
186 size_t m_ExtensionsLen;
190 template<
class TIPv6Extension>
194 while (curExt != NULL &&
dynamic_cast<TIPv6Extension*
>(curExt) == NULL)
197 return (TIPv6Extension*)curExt;
200 template<
class TIPv6Extension>
204 if (!extendLayer(offsetToAddHeader, extensionHeader.getExtensionLen()))
209 TIPv6Extension* newHeader =
new TIPv6Extension(
this, (
size_t)offsetToAddHeader);
210 (*newHeader) = extensionHeader;
212 if (m_FirstExtension != NULL)
214 newHeader->getBaseHeader()->nextHeader = m_LastExtension->getBaseHeader()->nextHeader;
215 m_LastExtension->getBaseHeader()->nextHeader = newHeader->getExtensionType();
216 m_LastExtension->setNextHeader(newHeader);
217 m_LastExtension = newHeader;
221 m_FirstExtension = newHeader;
222 m_LastExtension = newHeader;
227 m_ExtensionsLen += newHeader->getExtensionLen();
236 return dataLen >=
sizeof(
ip6_hdr);
OsiModelLayer
Definition: ProtocolType.h:233
Definition: IpAddress.h:140
ip6_hdr * getIPv6Header() const
Definition: IPv6Layer.h:97
void computeCalculateFields()
TIPv6Extension * addExtension(const TIPv6Extension &extensionHeader)
Definition: IPv6Layer.h:201
uint8_t ipSrc[16]
Definition: IPv6Layer.h:43
IPv6Address getDstIpAddress() const
Definition: IPv6Layer.h:109
uint16_t payloadLength
Definition: IPv6Layer.h:37
std::string toString() const
IPv6Address getSrcIpAddress() const
Definition: IPv6Layer.h:103
@ OsiModelNetworkLayer
Definition: ProtocolType.h:240
Definition: IPv6Extensions.h:23
uint8_t flowLabel[3]
Definition: IPv6Layer.h:35
static bool isDataValid(const uint8_t *data, size_t dataLen)
Definition: IPv6Layer.h:234
uint8_t trafficClass
Definition: IPv6Layer.h:25
void removeAllExtensions()
uint8_t ipDst[16]
Definition: IPv6Layer.h:45
uint8_t hopLimit
Definition: IPv6Layer.h:41
The main namespace for the PcapPlusPlus lib.
size_t getExtensionCount() const
uint8_t ipVersion
Definition: IPv6Layer.h:27
IPv6Layer & operator=(const IPv6Layer &other)
Definition: IPv6Layer.h:22
IPv6Extension * getNextHeader() const
Definition: IPv6Extensions.h:66
TIPv6Extension * getExtensionOfType() const
Definition: IPv6Layer.h:191
Definition: IPv6Layer.h:54
size_t getHeaderLen() const
Definition: IPv6Layer.h:165
OsiModelLayer getOsiModelLayer() const
Definition: IPv6Layer.h:177
uint8_t nextHeader
Definition: IPv6Layer.h:39