1 #ifndef PACKETPP_IP_REASSEMBLY 2 #define PACKETPP_IP_REASSEMBLY 50 #define PCPP_IP_REASSEMBLY_DEFAULT_MAX_PACKETS_TO_STORE 500000 101 PacketKey(
const PacketKey& other);
150 inline void setIpID(uint16_t ipID) { m_IpID = ipID; }
256 uint32_t m_FragmentID;
387 uint16_t fragmentOffset;
389 uint8_t* fragmentData;
390 size_t fragmentDataLen;
391 IPFragment() { fragmentOffset = 0; lastFragment =
false; fragmentData = NULL; fragmentDataLen = 0; }
392 ~IPFragment() {
delete [] fragmentData; }
395 struct IPFragmentData
397 uint16_t currentOffset;
401 PacketKey* packetKey;
402 PointerVector<IPFragment> outOfOrderFragments;
403 IPFragmentData(PacketKey* pktKey, uint32_t fragId) { currentOffset = 0; data = NULL; deleteData =
true; fragmentID = fragId; packetKey = pktKey; }
404 ~IPFragmentData() {
delete packetKey;
if (deleteData && data != NULL) {
delete data; } }
407 LRUList<uint32_t>* m_PacketLRU;
408 std::map<uint32_t, IPFragmentData*> m_FragmentMap;
410 void* m_CallbackUserCookie;
412 void addNewFragment(uint32_t hash, IPFragmentData* fragData);
413 bool matchOutOfOrderFragments(IPFragmentData* fragData);
418 #endif // PACKETPP_IP_REASSEMBLY #define PCPP_IP_REASSEMBLY_DEFAULT_MAX_PACKETS_TO_STORE
Definition: IPReassembly.h:50
ProtocolType getProtocolType() const
Definition: IPReassembly.h:172
Definition: IPReassembly.h:284
IPv4PacketKey()
Definition: IPReassembly.h:116
virtual ProtocolType getProtocolType() const =0
virtual PacketKey * clone() const =0
void removePacket(const PacketKey &key)
ProtocolType getProtocolType() const
Definition: IPReassembly.h:251
Definition: IPReassembly.h:286
void setSrcIP(const IPv4Address &srcIP)
Definition: IPReassembly.h:156
Definition: IPReassembly.h:288
IPv4PacketKey(uint16_t ipid, IPv4Address srcip, IPv4Address dstip)
Definition: IPReassembly.h:124
void setFragmentID(uint32_t fragID)
Definition: IPReassembly.h:229
Definition: IPReassembly.h:72
Definition: IpAddress.h:113
Packet * getCurrentPacket(const PacketKey &key)
size_t getMaxSize()
Definition: LRUList.h:106
IPv6Address getDstIP()
Definition: IPReassembly.h:223
IPv6PacketKey(uint32_t fragmentID, IPv6Address srcip, IPv6Address dstip)
Definition: IPReassembly.h:203
Definition: IPReassembly.h:188
void setSrcIP(const IPv6Address &srcIP)
Definition: IPReassembly.h:235
virtual ~PacketKey()
Definition: IPReassembly.h:79
Definition: IPReassembly.h:290
Definition: RawPacket.h:219
Definition: IPReassembly.h:278
void setIpID(uint16_t ipID)
Definition: IPReassembly.h:150
IPv6PacketKey()
Definition: IPReassembly.h:195
void(* OnFragmentsClean)(const PacketKey *key, void *userCookie)
Definition: IPReassembly.h:270
Definition: IPReassembly.h:63
uint32_t getHashValue() const
uint16_t getIpID()
Definition: IPReassembly.h:134
Definition: IPReassembly.h:109
Definition: IPReassembly.h:280
Definition: IpAddress.h:212
IPReassembly(OnFragmentsClean onFragmentsCleanCallback=NULL, void *callbackUserCookie=NULL, size_t maxPacketsToStore=500000)
IPv4PacketKey(const IPv4PacketKey &other)
Definition: IPReassembly.h:129
ProtocolType
Definition: ProtocolType.h:16
PacketKey * clone() const
Definition: IPReassembly.h:174
IPv4Address getSrcIP()
Definition: IPReassembly.h:139
uint32_t getHashValue() const
Definition: ProtocolType.h:31
IPv4Address getDstIP()
Definition: IPReassembly.h:144
Packet * processPacket(Packet *fragment, ReassemblyStatus &status)
ReassemblyStatus
Definition: IPReassembly.h:275
IPv6PacketKey(const IPv6PacketKey &other)
Definition: IPReassembly.h:208
size_t getCurrentCapacity()
Definition: IPReassembly.h:381
IPv6Address getSrcIP()
Definition: IPReassembly.h:218
void setDstIP(const IPv6Address &dstIP)
Definition: IPReassembly.h:241
Definition: IPReassembly.h:282
uint32_t getFragmentID()
Definition: IPReassembly.h:213
void setDstIP(const IPv4Address &dstIP)
Definition: IPReassembly.h:162
PacketKey * clone() const
Definition: IPReassembly.h:253
The main namespace for the PcapPlusPlus lib.
virtual uint32_t getHashValue() const =0
size_t getMaxCapacity()
Definition: IPReassembly.h:376
Definition: ProtocolType.h:36