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);
173 void parseExtensions();
174 void deleteExtensions();
178 size_t m_ExtensionsLen;
182 template<
class TIPv6Extension>
186 while (curExt != NULL && dynamic_cast<TIPv6Extension*>(curExt) == NULL)
189 return (TIPv6Extension*)curExt;
192 template<
class TIPv6Extension>
196 if (!extendLayer(offsetToAddHeader, extensionHeader.getExtensionLen()))
201 TIPv6Extension* newHeader =
new TIPv6Extension(
this, (
size_t)offsetToAddHeader);
202 (*newHeader) = extensionHeader;
204 if (m_FirstExtension != NULL)
206 newHeader->getBaseHeader()->nextHeader = m_LastExtension->getBaseHeader()->nextHeader;
207 m_LastExtension->getBaseHeader()->nextHeader = newHeader->getExtensionType();
208 m_LastExtension->setNextHeader(newHeader);
209 m_LastExtension = newHeader;
213 m_FirstExtension = newHeader;
214 m_LastExtension = newHeader;
219 m_ExtensionsLen += newHeader->getExtensionLen();
uint8_t nextHeader
Definition: IPv6Layer.h:39
TIPv6Extension * getExtensionOfType()
Definition: IPv6Layer.h:183
uint16_t payloadLength
Definition: IPv6Layer.h:37
OsiModelLayer getOsiModelLayer()
Definition: IPv6Layer.h:169
uint8_t ipSrc[16]
Definition: IPv6Layer.h:43
Definition: IPv6Layer.h:54
void removeAllExtensions()
TIPv6Extension * addExtension(const TIPv6Extension &extensionHeader)
Definition: IPv6Layer.h:193
ip6_hdr * getIPv6Header()
Definition: IPv6Layer.h:97
uint8_t ipVersion
Definition: IPv6Layer.h:25
size_t getHeaderLen()
Definition: IPv6Layer.h:157
void computeCalculateFields()
OsiModelLayer
Definition: ProtocolType.h:213
Definition: IPv6Layer.h:22
uint8_t trafficClass
Definition: IPv6Layer.h:25
Definition: ProtocolType.h:220
IPv6Address getDstIpAddress()
Definition: IPv6Layer.h:109
IPv6Address getSrcIpAddress()
Definition: IPv6Layer.h:103
Definition: IpAddress.h:212
uint8_t flowLabel[3]
Definition: IPv6Layer.h:35
size_t getExtensionCount()
IPv6Layer & operator=(const IPv6Layer &other)
IPv6Extension * getNextHeader()
Definition: IPv6Extensions.h:66
uint8_t ipDst[16]
Definition: IPv6Layer.h:45
Definition: IPv6Extensions.h:23
The main namespace for the PcapPlusPlus lib.
uint8_t hopLimit
Definition: IPv6Layer.h:41