1 #ifndef PACKETPP_IPV6_EXTENSION 2 #define PACKETPP_IPV6_EXTENSION 50 virtual inline size_t getExtensionLen()
const {
return 8 * (getBaseHeader()->headerLen+1); }
64 struct ipv6_ext_base_header
71 IPv6Extension(IDataContainer* dataContainer,
size_t offset) :
72 m_NextHeader(NULL), m_ExtType(
IPv6ExtensionUnknown), m_DataContainer(dataContainer), m_Offset(offset), m_ShadowData(NULL) {}
76 m_NextHeader(NULL), m_ExtType(
IPv6ExtensionUnknown), m_DataContainer(NULL), m_Offset(0), m_ShadowData(NULL) {}
79 IPv6Extension& operator=(
const IPv6Extension& other);
81 uint8_t* getDataPtr()
const;
83 void initShadowPtr(
size_t size);
85 ipv6_ext_base_header* getBaseHeader()
const {
return (ipv6_ext_base_header*)getDataPtr(); }
87 inline void setNextHeader(IPv6Extension* nextHeader) { m_NextHeader = nextHeader; }
89 inline IPv6Extension* getNextHeader() {
return m_NextHeader; }
91 IPv6Extension* m_NextHeader;
95 IDataContainer* m_DataContainer;
97 uint8_t* m_ShadowData;
202 static const uint8_t Pad0OptionType = 0;
203 static const uint8_t PadNOptionType = 1;
218 memcpy(&result, optionData,
sizeof(T));
227 if (optionType == Pad0OptionType)
228 return sizeof(uint8_t);
230 return (
size_t)(optionLen +
sizeof(uint16_t));
238 if (optionType == Pad0OptionType)
261 TLVOptionBuilder(uint8_t optType, uint8_t optDataLen,
const uint8_t* optValue);
304 void init(uint8_t optType, uint8_t optDataLen,
const uint8_t* optValue);
305 uint8_t* m_OptionBuffer;
313 TLVOption*
getOption(uint8_t optionType);
342 size_t m_OptionCount;
432 IPv6RoutingHeader(uint8_t routingType, uint8_t segmentsLeft,
const uint8_t* additionalRoutingData,
size_t additionalRoutingDataLen);
508 IPv6AuthenticationHeader(uint32_t securityParametersIndex, uint32_t sequenceNumber,
const uint8_t* integrityCheckValue,
size_t integrityCheckValueLen);
544 #endif // PACKETPP_IPV6_EXTENSION Definition: IpAddress.h:212
size_t getExtensionLen() const
Definition: IPv6Extensions.h:535
Definition: IPv6Extensions.h:376
IPv6ExtensionType
Definition: IPv6Extensions.h:31
uint32_t sequenceNumber
Definition: IPv6Extensions.h:496
~TLVOptionBuilder()
Definition: IPv6Extensions.h:288
uint8_t optionType
Definition: IPv6Extensions.h:196
uint8_t * getRawBuffer() const
Definition: IPv6Extensions.h:300
size_t getRoutingAdditionalDataLength()
Definition: IPv6Extensions.h:22
TLVOption * getFirstOption()
TLVOption * getNextOption(TLVOption *option)
IPv6FragmentationHeader(uint32_t fragId, uint16_t fragOffset, bool lastFragment)
uint8_t headerLen
Definition: IPv6Extensions.h:416
Definition: IPv6Extensions.h:192
Definition: IPv6Extensions.h:107
ipv6_frag_header * getFragHeader()
Definition: IPv6Extensions.h:144
uint32_t securityParametersIndex
Definition: IPv6Extensions.h:494
The main namespace for the PcapPlusPlus lib.
Definition: IPv6Extensions.h:34
uint8_t segmentsLeft
Definition: IPv6Extensions.h:420
Definition: IPv6Extensions.h:411
uint8_t nextHeader
Definition: IPv6Extensions.h:487
Definition: IPv6Extensions.h:351
Definition: IPv6Extensions.h:181
Definition: IPv6Extensions.h:38
TLVOptionBuilder(uint8_t optType, uint8_t optDataLen, const uint8_t *optValue)
virtual size_t getExtensionLen() const
Definition: IPv6Extensions.h:50
uint8_t nextHeader
Definition: IPv6Extensions.h:120
ipv6_authentication_header * getAuthHeader()
Definition: IPv6Extensions.h:515
uint8_t routingType
Definition: IPv6Extensions.h:418
uint8_t optionLen
Definition: IPv6Extensions.h:198
Definition: IPv6Extensions.h:484
TLVOption * build() const
Definition: IPv6Extensions.h:295
uint8_t nextHeader
Definition: IPv6Extensions.h:414
Definition: IPv6Extensions.h:401
size_t getDataSize()
Definition: IPv6Extensions.h:236
uint8_t optionData[]
Definition: IPv6Extensions.h:200
Definition: IPv6Extensions.h:250
uint8_t * getIntegrityCheckValue()
IPv6RoutingHeader(uint8_t routingType, uint8_t segmentsLeft, const uint8_t *additionalRoutingData, size_t additionalRoutingDataLen)
Definition: IPv6Extensions.h:40
IPv6ExtensionType getExtensionType()
Definition: IPv6Extensions.h:55
Definition: IPv6Layer.h:54
IPv6HopByHopHeader(const std::vector< TLVOptionBuilder > &options)
Definition: IPv6Extensions.h:363
Definition: IPv6Extensions.h:474
uint8_t headerLen
Definition: IPv6Extensions.h:122
uint8_t headerLen
Definition: IPv6Extensions.h:490
uint32_t id
Definition: IPv6Extensions.h:127
IPv6Address getRoutingAdditionalDataAsIPv6Address(size_t offset=0)
IPv6AuthenticationHeader(uint32_t securityParametersIndex, uint32_t sequenceNumber, const uint8_t *integrityCheckValue, size_t integrityCheckValueLen)
uint8_t * getRoutingAdditionalData()
Definition: IPv6Extensions.h:36
uint16_t fragOffsetAndFlags
Definition: IPv6Extensions.h:125
size_t getIntegrityCheckValueLength()
ipv6_routing_header * getRoutingHeader()
Definition: IPv6Extensions.h:439
size_t getTotalSize() const
Definition: IPv6Extensions.h:225
T getValueAs()
Definition: IPv6Extensions.h:212
IPv6TLVOptionHeader(const std::vector< TLVOptionBuilder > &options)
uint16_t getFragmentOffset()
Definition: IPv6Extensions.h:44
uint16_t reserved
Definition: IPv6Extensions.h:492
TLVOption * getOption(uint8_t optionType)
Definition: IPv6Extensions.h:117
Definition: IPv6Extensions.h:42
IPv6DestinationHeader(const std::vector< TLVOptionBuilder > &options)
Definition: IPv6Extensions.h:388