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 Definition: IpAddress.h:212
IPv4Address getDstIP()
Definition: IPReassembly.h:144
Definition: IPReassembly.h:286
uint16_t getIpID()
Definition: IPReassembly.h:134
Definition: IPReassembly.h:282
void setFragmentID(uint32_t fragID)
Definition: IPReassembly.h:229
IPReassembly(OnFragmentsClean onFragmentsCleanCallback=NULL, void *callbackUserCookie=NULL, size_t maxPacketsToStore=500000)
IPv4PacketKey(uint16_t ipid, IPv4Address srcip, IPv4Address dstip)
Definition: IPReassembly.h:124
IPv4PacketKey(const IPv4PacketKey &other)
Definition: IPReassembly.h:129
void setIpID(uint16_t ipID)
Definition: IPReassembly.h:150
IPv6PacketKey()
Definition: IPReassembly.h:195
IPv4Address getSrcIP()
Definition: IPReassembly.h:139
void setSrcIP(const IPv6Address &srcIP)
Definition: IPReassembly.h:235
IPv6PacketKey(uint32_t fragmentID, IPv6Address srcip, IPv6Address dstip)
Definition: IPReassembly.h:203
Definition: RawPacket.h:220
uint32_t getHashValue() const
virtual PacketKey * clone() const =0
virtual ProtocolType getProtocolType() const =0
The main namespace for the PcapPlusPlus lib.
Definition: IPReassembly.h:72
Definition: IPReassembly.h:290
IPv6PacketKey(const IPv6PacketKey &other)
Definition: IPReassembly.h:208
void removePacket(const PacketKey &key)
Definition: IpAddress.h:113
void(* OnFragmentsClean)(const PacketKey *key, void *userCookie)
Definition: IPReassembly.h:270
void setDstIP(const IPv4Address &dstIP)
Definition: IPReassembly.h:162
Definition: IPReassembly.h:278
Definition: IPReassembly.h:288
void setSrcIP(const IPv4Address &srcIP)
Definition: IPReassembly.h:156
Definition: IPReassembly.h:188
ReassemblyStatus
Definition: IPReassembly.h:275
Definition: IPReassembly.h:63
#define PCPP_IP_REASSEMBLY_DEFAULT_MAX_PACKETS_TO_STORE
Definition: IPReassembly.h:50
IPv4PacketKey()
Definition: IPReassembly.h:116
uint32_t getFragmentID()
Definition: IPReassembly.h:213
Definition: IPReassembly.h:109
size_t getMaxSize()
Definition: LRUList.h:106
virtual ~PacketKey()
Definition: IPReassembly.h:79
size_t getCurrentCapacity()
Definition: IPReassembly.h:381
ProtocolType getProtocolType() const
Definition: IPReassembly.h:251
virtual uint32_t getHashValue() const =0
ProtocolType
Definition: ProtocolType.h:16
IPv6Address getSrcIP()
Definition: IPReassembly.h:218
Definition: ProtocolType.h:31
Packet * getCurrentPacket(const PacketKey &key)
ProtocolType getProtocolType() const
Definition: IPReassembly.h:172
Definition: IPReassembly.h:280
uint32_t getHashValue() const
Packet * processPacket(Packet *fragment, ReassemblyStatus &status)
PacketKey * clone() const
Definition: IPReassembly.h:253
void setDstIP(const IPv6Address &dstIP)
Definition: IPReassembly.h:241
IPv6Address getDstIP()
Definition: IPReassembly.h:223
Definition: ProtocolType.h:36
PacketKey * clone() const
Definition: IPReassembly.h:174
Definition: IPReassembly.h:284
size_t getMaxCapacity()
Definition: IPReassembly.h:376