1 #ifndef PACKETPP_TCP_REASSEMBLY 2 #define PACKETPP_TCP_REASSEMBLY 78 ConnectionData() : srcIP(NULL), dstIP(NULL), srcPort(0), dstPort(0), flowKey(0) {}
182 bool m_DeleteDataOnDestruction;
184 void setDeleteDataOnDestruction(
bool flag) { m_DeleteDataOnDestruction = flag; }
296 TcpFragment() { sequence = 0; dataLength = 0; data = NULL; }
297 ~TcpFragment() {
if (data != NULL)
delete [] data; }
300 struct TcpOneSideData
305 PointerVector<TcpFragment> tcpFragmentList;
308 void setSrcIP(IPAddress* sourrcIP);
310 TcpOneSideData() { srcIP = NULL; srcPort = 0; sequence = 0; gotFinOrRst =
false; }
312 ~TcpOneSideData() {
if (srcIP != NULL)
delete srcIP; }
315 struct TcpReassemblyData
319 TcpOneSideData twoSides[2];
320 ConnectionData connData;
322 TcpReassemblyData() { numOfSides = 0; prevSide = -1; }
329 std::map<uint32_t, TcpReassemblyData*> m_ConnectionList;
330 std::map<uint32_t, bool> m_ClosedConnectionList;
331 std::vector<ConnectionData> m_ConnectionInfo;
333 void checkOutOfOrderFragments(TcpReassemblyData* tcpReassemblyData,
int sideIndex,
bool cleanWholeFragList);
335 std::string prepareMissingDataMessage(uint32_t missingDataLen);
337 void handleFinOrRst(TcpReassemblyData* tcpReassemblyData,
int sideIndex, uint32_t flowKey);
ConnectionEndReason
Definition: TcpReassembly.h:200
void(* OnTcpConnectionStart)(ConnectionData connectionData, void *userCookie)
Definition: TcpReassembly.h:223
void(* OnTcpMessageReady)(int side, TcpStreamData tcpData, void *userCookie)
Definition: TcpReassembly.h:215
const std::vector< ConnectionData > & getConnectionInformation() const
Definition: RawPacket.h:220
The main namespace for the PcapPlusPlus lib.
Definition: TcpReassembly.h:203
void(* OnTcpConnectionEnd)(ConnectionData connectionData, ConnectionEndReason reason, void *userCookie)
Definition: TcpReassembly.h:232
uint32_t flowKey
Definition: TcpReassembly.h:73
ConnectionData()
Definition: TcpReassembly.h:78
void setSrcIpAddress(const IPAddress *sourceIP)
Definition: TcpReassembly.h:99
void setDstIpAddress(const IPAddress *destIP)
Definition: TcpReassembly.h:105
Definition: TcpReassembly.h:205
ConnectionData & operator=(const ConnectionData &other)
Definition: TcpReassembly.h:62
IPAddress * srcIP
Definition: TcpReassembly.h:65
TcpStreamData & operator=(const TcpStreamData &other)
Definition: IpAddress.h:27
void reassemblePacket(Packet &tcpData)
Definition: TcpReassembly.h:193
virtual IPAddress * clone() const =0
size_t srcPort
Definition: TcpReassembly.h:69
Definition: TcpReassembly.h:121
size_t dstPort
Definition: TcpReassembly.h:71
IPAddress * dstIP
Definition: TcpReassembly.h:67
void closeAllConnections()
ConnectionData getConnectionData()
Definition: TcpReassembly.h:176
uint8_t * getData()
Definition: TcpReassembly.h:164
size_t getDataLength()
Definition: TcpReassembly.h:170
void closeConnection(uint32_t flowKey)
TcpReassembly(OnTcpMessageReady onMessageReadyCallback, void *userCookie=NULL, OnTcpConnectionStart onConnectionStartCallback=NULL, OnTcpConnectionEnd onConnectionEndCallback=NULL)
int isConnectionOpen(const ConnectionData &connection)