|
PcapPlusPlus
19.12
|
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);
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();
OsiModelLayer
Definition: ProtocolType.h:224
Definition: IpAddress.h:229
ip6_hdr * getIPv6Header() const
Definition: IPv6Layer.h:97
void computeCalculateFields()
TIPv6Extension * addExtension(const TIPv6Extension &extensionHeader)
Definition: IPv6Layer.h:193
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
Definition: ProtocolType.h:231
Definition: IPv6Extensions.h:23
uint8_t flowLabel[3]
Definition: IPv6Layer.h:35
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:25
IPv6Layer & operator=(const IPv6Layer &other)
Definition: IPv6Layer.h:22
IPv6Extension * getNextHeader() const
Definition: IPv6Extensions.h:66
TIPv6Extension * getExtensionOfType() const
Definition: IPv6Layer.h:183
Definition: IPv6Layer.h:54
size_t getHeaderLen() const
Definition: IPv6Layer.h:157
OsiModelLayer getOsiModelLayer() const
Definition: IPv6Layer.h:169
uint8_t nextHeader
Definition: IPv6Layer.h:39