1 #ifndef PACKETPP_IP_REASSEMBLY 2 #define PACKETPP_IP_REASSEMBLY 50 #define PCPP_IP_REASSEMBLY_DEFAULT_MAX_PACKETS_TO_STORE 500000 138 m_IpID = other.m_IpID;
139 m_SrcIP = other.m_SrcIP;
140 m_DstIP = other.m_DstIP;
163 void setIpID(uint16_t ipID) { m_IpID = ipID; }
230 m_FragmentID = other.m_FragmentID;
231 m_SrcIP = other.m_SrcIP;
232 m_SrcIP = other.m_DstIP;
282 uint32_t m_FragmentID;
328 : m_PacketLRU(maxPacketsToStore), m_OnFragmentsCleanCallback(onFragmentsCleanCallback), m_CallbackUserCookie(callbackUserCookie) {}
426 uint16_t fragmentOffset;
428 uint8_t* fragmentData;
429 size_t fragmentDataLen;
430 IPFragment() { fragmentOffset = 0; lastFragment =
false; fragmentData = NULL; fragmentDataLen = 0; }
431 ~IPFragment() {
delete [] fragmentData; }
434 struct IPFragmentData
436 uint16_t currentOffset;
442 IPFragmentData(
PacketKey* pktKey, uint32_t fragId) { currentOffset = 0; data = NULL; deleteData =
true; fragmentID = fragId; packetKey = pktKey; }
443 ~IPFragmentData() {
delete packetKey;
if (deleteData && data != NULL) {
delete data; } }
447 std::map<uint32_t, IPFragmentData*> m_FragmentMap;
449 void* m_CallbackUserCookie;
451 void addNewFragment(uint32_t hash, IPFragmentData* fragData);
452 bool matchOutOfOrderFragments(IPFragmentData* fragData);
457 #endif // PACKETPP_IP_REASSEMBLY The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:258
IPv4Address getDstIP() const
Definition: IPReassembly.h:157
virtual ProtocolType getProtocolType() const =0
void setSrcIP(const IPv6Address &srcIP)
Definition: IPReassembly.h:261
Definition: IPReassembly.h:316
PacketKey * clone() const
Definition: IPReassembly.h:187
IPv4PacketKey(const IPv4PacketKey &other)
Definition: IPReassembly.h:130
Definition: IPReassembly.h:306
size_t getCurrentCapacity() const
Definition: IPReassembly.h:420
Definition: RawPacket.h:252
void removePacket(const PacketKey &key)
IPv4PacketKey & operator=(const IPv4PacketKey &other)
Definition: IPReassembly.h:136
IPv6Address getSrcIP() const
Definition: IPReassembly.h:244
const ProtocolType UnknownProtocol
Definition: ProtocolType.h:23
IPv6PacketKey(const IPv6PacketKey &other)
Definition: IPReassembly.h:222
Definition: ProtocolType.h:275
IPv6PacketKey & operator=(const IPv6PacketKey &other)
Definition: IPReassembly.h:228
uint64_t ProtocolType
Definition: ProtocolType.h:18
void(* OnFragmentsClean)(const PacketKey *key, void *userCookie)
Definition: IPReassembly.h:296
void setDstIP(const IPv6Address &dstIP)
Definition: IPReassembly.h:267
Definition: IPReassembly.h:201
void setFragmentID(uint32_t fragID)
Definition: IPReassembly.h:255
Definition: IPReassembly.h:304
uint16_t getIpID() const
Definition: IPReassembly.h:147
Definition: IPReassembly.h:72
Definition: IPReassembly.h:109
Definition: IpAddress.h:27
Definition: IpAddress.h:167
Definition: IPReassembly.h:310
virtual uint32_t getHashValue() const =0
Definition: IPReassembly.h:312
uint32_t getFragmentID() const
Definition: IPReassembly.h:239
virtual ~PacketKey()
Definition: IPReassembly.h:79
#define PCPP_IP_REASSEMBLY_DEFAULT_MAX_PACKETS_TO_STORE
Definition: IPReassembly.h:50
Definition: IPReassembly.h:63
PacketKey * clone() const
Definition: IPReassembly.h:279
ProtocolType getProtocolType() const
Definition: IPReassembly.h:185
IPv4PacketKey()
Definition: IPReassembly.h:116
ReassemblyStatus
Definition: IPReassembly.h:301
virtual PacketKey * clone() const =0
Definition: IPReassembly.h:308
const ProtocolType IPv6
Definition: ProtocolType.h:38
IPv6PacketKey(uint32_t fragmentID, IPv6Address srcip, IPv6Address dstip)
Definition: IPReassembly.h:216
size_t getMaxCapacity() const
Definition: IPReassembly.h:415
IPv4PacketKey(uint16_t ipid, IPv4Address srcip, IPv4Address dstip)
Definition: IPReassembly.h:124
void setDstIP(const IPv4Address &dstIP)
Definition: IPReassembly.h:175
ProtocolType getProtocolType() const
Definition: IPReassembly.h:277
IPReassembly(OnFragmentsClean onFragmentsCleanCallback=NULL, void *callbackUserCookie=NULL, size_t maxPacketsToStore=500000)
Definition: IPReassembly.h:327
const ProtocolType IPv4
Definition: ProtocolType.h:33
Packet * processPacket(Packet *fragment, ReassemblyStatus &status, ProtocolType parseUntil=UnknownProtocol, OsiModelLayer parseUntilLayer=OsiModelLayerUnknown)
void setIpID(uint16_t ipID)
Definition: IPReassembly.h:163
void setSrcIP(const IPv4Address &srcIP)
Definition: IPReassembly.h:169
IPv6Address getDstIP() const
Definition: IPReassembly.h:249
IPv4Address getSrcIP() const
Definition: IPReassembly.h:152
IPv6PacketKey()
Definition: IPReassembly.h:208
Definition: IPReassembly.h:314
Packet * getCurrentPacket(const PacketKey &key)