|
PcapPlusPlus
19.12
|
Go to the documentation of this file. 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 void setIpID(uint16_t ipID) { m_IpID = ipID; }
256 uint32_t m_FragmentID;
302 : m_PacketLRU(maxPacketsToStore), m_OnFragmentsCleanCallback(onFragmentsCleanCallback), m_CallbackUserCookie(callbackUserCookie) {}
400 uint16_t fragmentOffset;
402 uint8_t* fragmentData;
403 size_t fragmentDataLen;
404 IPFragment() { fragmentOffset = 0; lastFragment =
false; fragmentData = NULL; fragmentDataLen = 0; }
405 ~IPFragment() {
delete [] fragmentData; }
408 struct IPFragmentData
410 uint16_t currentOffset;
414 PacketKey* packetKey;
415 PointerVector<IPFragment> outOfOrderFragments;
416 IPFragmentData(PacketKey* pktKey, uint32_t fragId) { currentOffset = 0; data = NULL; deleteData =
true; fragmentID = fragId; packetKey = pktKey; }
417 ~IPFragmentData() {
delete packetKey;
if (deleteData && data != NULL) {
delete data; } }
420 LRUList<uint32_t> m_PacketLRU;
421 std::map<uint32_t, IPFragmentData*> m_FragmentMap;
423 void* m_CallbackUserCookie;
425 void addNewFragment(uint32_t hash, IPFragmentData* fragData);
426 bool matchOutOfOrderFragments(IPFragmentData* fragData);
431 #endif // PACKETPP_IP_REASSEMBLY
void setSrcIP(const IPv6Address &srcIP)
Definition: IPReassembly.h:235
OsiModelLayer
Definition: ProtocolType.h:224
Definition: ProtocolType.h:36
Definition: IpAddress.h:119
Definition: IpAddress.h:229
Definition: IPReassembly.h:188
Packet * processPacket(Packet *fragment, ReassemblyStatus &status, ProtocolType parseUntil=UnknownProtocol, OsiModelLayer parseUntilLayer=OsiModelLayerUnknown)
uint32_t getFragmentID() const
Definition: IPReassembly.h:213
Definition: IPReassembly.h:280
Definition: IPReassembly.h:288
void removePacket(const PacketKey &key)
PacketKey * clone() const
Definition: IPReassembly.h:253
Definition: IPReassembly.h:109
size_t getCurrentCapacity() const
Definition: IPReassembly.h:394
Definition: IPReassembly.h:286
size_t getMaxSize() const
Definition: LRUList.h:120
void(* OnFragmentsClean)(const PacketKey *key, void *userCookie)
Definition: IPReassembly.h:270
PacketKey * clone() const
Definition: IPReassembly.h:174
IPv4PacketKey(const IPv4PacketKey &other)
Definition: IPReassembly.h:129
Definition: IPReassembly.h:72
IPv4PacketKey(uint16_t ipid, IPv4Address srcip, IPv4Address dstip)
Definition: IPReassembly.h:124
virtual ProtocolType getProtocolType() const =0
void setIpID(uint16_t ipID)
Definition: IPReassembly.h:150
virtual uint32_t getHashValue() const =0
ProtocolType getProtocolType() const
Definition: IPReassembly.h:251
Definition: IPReassembly.h:282
ProtocolType
Definition: ProtocolType.h:16
IPv6PacketKey(const IPv6PacketKey &other)
Definition: IPReassembly.h:208
Definition: ProtocolType.h:241
uint16_t getIpID() const
Definition: IPReassembly.h:134
IPv6PacketKey(uint32_t fragmentID, IPv6Address srcip, IPv6Address dstip)
Definition: IPReassembly.h:203
IPv6PacketKey()
Definition: IPReassembly.h:195
void setDstIP(const IPv4Address &dstIP)
Definition: IPReassembly.h:162
uint32_t getHashValue() const
Definition: ProtocolType.h:31
virtual PacketKey * clone() const =0
ReassemblyStatus
Definition: IPReassembly.h:275
uint32_t getHashValue() const
IPv4Address getDstIP() const
Definition: IPReassembly.h:144
The main namespace for the PcapPlusPlus lib.
ProtocolType getProtocolType() const
Definition: IPReassembly.h:172
Definition: ProtocolType.h:21
Definition: IPReassembly.h:290
#define PCPP_IP_REASSEMBLY_DEFAULT_MAX_PACKETS_TO_STORE
Definition: IPReassembly.h:50
IPv4PacketKey()
Definition: IPReassembly.h:116
void setDstIP(const IPv6Address &dstIP)
Definition: IPReassembly.h:241
IPv6Address getSrcIP() const
Definition: IPReassembly.h:218
virtual ~PacketKey()
Definition: IPReassembly.h:79
size_t getMaxCapacity() const
Definition: IPReassembly.h:389
Definition: IPReassembly.h:284
IPv6Address getDstIP() const
Definition: IPReassembly.h:223
Definition: IPReassembly.h:278
void setFragmentID(uint32_t fragID)
Definition: IPReassembly.h:229
IPReassembly(OnFragmentsClean onFragmentsCleanCallback=NULL, void *callbackUserCookie=NULL, size_t maxPacketsToStore=500000)
Definition: IPReassembly.h:301
Packet * getCurrentPacket(const PacketKey &key)
Definition: IPReassembly.h:63
Definition: RawPacket.h:219
void setSrcIP(const IPv4Address &srcIP)
Definition: IPReassembly.h:156
IPv4Address getSrcIP() const
Definition: IPReassembly.h:139