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)
187 curExt = curExt->getNextHeader();
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();
Definition: IpAddress.h:212
Definition: IPv6Extensions.h:22
Definition: IPv6Layer.h:22
OsiModelLayer getOsiModelLayer()
Definition: IPv6Layer.h:169
TIPv6Extension * addExtension(const TIPv6Extension &extensionHeader)
Definition: IPv6Layer.h:193
IPv6Layer & operator=(const IPv6Layer &other)
The main namespace for the PcapPlusPlus lib.
uint16_t payloadLength
Definition: IPv6Layer.h:37
OsiModelLayer
Definition: ProtocolType.h:208
ip6_hdr * getIPv6Header()
Definition: IPv6Layer.h:97
uint8_t ipSrc[16]
Definition: IPv6Layer.h:43
TIPv6Extension * getExtensionOfType()
Definition: IPv6Layer.h:183
uint8_t ipVersion
Definition: IPv6Layer.h:25
void removeAllExtensions()
Definition: IPv6Layer.h:54
uint8_t trafficClass
Definition: IPv6Layer.h:25
uint8_t flowLabel[3]
Definition: IPv6Layer.h:35
size_t getHeaderLen()
Definition: IPv6Layer.h:157
void computeCalculateFields()
IPv6Address getSrcIpAddress()
Definition: IPv6Layer.h:103
Definition: ProtocolType.h:215
IPv6Address getDstIpAddress()
Definition: IPv6Layer.h:109
uint8_t hopLimit
Definition: IPv6Layer.h:41
uint8_t nextHeader
Definition: IPv6Layer.h:39
size_t getExtensionCount()
uint8_t ipDst[16]
Definition: IPv6Layer.h:45