1 #ifndef PACKETPP_TCP_REASSEMBLY 2 #define PACKETPP_TCP_REASSEMBLY 82 ConnectionData() : srcIP(NULL), dstIP(NULL), srcPort(0), dstPort(0), flowKey(0), startTime(), endTime() {}
198 bool m_DeleteDataOnDestruction;
200 void setDeleteDataOnDestruction(
bool flag) { m_DeleteDataOnDestruction = flag; }
312 TcpFragment() { sequence = 0; dataLength = 0; data = NULL; }
313 ~TcpFragment() {
if (data != NULL)
delete [] data; }
316 struct TcpOneSideData
321 PointerVector<TcpFragment> tcpFragmentList;
324 void setSrcIP(IPAddress* sourrcIP);
326 TcpOneSideData() { srcIP = NULL; srcPort = 0; sequence = 0; gotFinOrRst =
false; }
328 ~TcpOneSideData() {
if (srcIP != NULL)
delete srcIP; }
331 struct TcpReassemblyData
335 TcpOneSideData twoSides[2];
336 ConnectionData connData;
338 TcpReassemblyData() { numOfSides = 0; prevSide = -1; }
345 std::map<uint32_t, TcpReassemblyData*> m_ConnectionList;
346 std::map<uint32_t, bool> m_ClosedConnectionList;
347 std::vector<ConnectionData> m_ConnectionInfo;
349 void checkOutOfOrderFragments(TcpReassemblyData* tcpReassemblyData,
int sideIndex,
bool cleanWholeFragList);
351 std::string prepareMissingDataMessage(uint32_t missingDataLen);
353 void handleFinOrRst(TcpReassemblyData* tcpReassemblyData,
int sideIndex, uint32_t flowKey);
void(* OnTcpConnectionStart)(ConnectionData connectionData, void *userCookie)
Definition: TcpReassembly.h:239
ConnectionData()
Definition: TcpReassembly.h:82
void closeAllConnections()
ConnectionEndReason
Definition: TcpReassembly.h:216
void reassemblePacket(Packet &tcpData)
size_t srcPort
Definition: TcpReassembly.h:69
void(* OnTcpMessageReady)(int side, TcpStreamData tcpData, void *userCookie)
Definition: TcpReassembly.h:231
IPAddress * srcIP
Definition: TcpReassembly.h:65
size_t dstPort
Definition: TcpReassembly.h:71
TcpStreamData & operator=(const TcpStreamData &other)
void(* OnTcpConnectionEnd)(ConnectionData connectionData, ConnectionEndReason reason, void *userCookie)
Definition: TcpReassembly.h:248
virtual IPAddress * clone() const =0
size_t getDataLength()
Definition: TcpReassembly.h:186
TcpReassembly(OnTcpMessageReady onMessageReadyCallback, void *userCookie=NULL, OnTcpConnectionStart onConnectionStartCallback=NULL, OnTcpConnectionEnd onConnectionEndCallback=NULL)
timeval endTime
Definition: TcpReassembly.h:77
ConnectionData & operator=(const ConnectionData &other)
uint32_t flowKey
Definition: TcpReassembly.h:73
Definition: RawPacket.h:219
Definition: TcpReassembly.h:137
void setEndTime(const timeval &endTime)
Definition: TcpReassembly.h:121
uint8_t * getData()
Definition: TcpReassembly.h:180
Definition: IpAddress.h:27
void setStartTime(const timeval &startTime)
Definition: TcpReassembly.h:115
IPAddress * dstIP
Definition: TcpReassembly.h:67
void setDstIpAddress(const IPAddress *destIP)
Definition: TcpReassembly.h:109
const std::vector< ConnectionData > & getConnectionInformation() const
Definition: TcpReassembly.h:219
ConnectionData getConnectionData()
Definition: TcpReassembly.h:192
Definition: TcpReassembly.h:62
Definition: TcpReassembly.h:221
int isConnectionOpen(const ConnectionData &connection)
Definition: TcpReassembly.h:209
timeval startTime
Definition: TcpReassembly.h:75
void setSrcIpAddress(const IPAddress *sourceIP)
Definition: TcpReassembly.h:103
void closeConnection(uint32_t flowKey)
The main namespace for the PcapPlusPlus lib.