1 #ifndef PACKETPP_TCP_REASSEMBLY 2 #define PACKETPP_TCP_REASSEMBLY 99 ConnectionData() : srcPort(0), dstPort(0), flowKey(0), startTime(), endTime() {}
134 : m_Data(tcpData), m_DataLen(tcpDataLength), m_MissingBytes(missingBytes), m_Connection(connData)
142 const uint8_t*
getData()
const {
return m_Data; }
169 const uint8_t* m_Data;
171 size_t m_MissingBytes;
207 TcpReassemblyConfiguration(
bool removeConnInfo =
true, uint32_t closedConnectionDelay = 5, uint32_t maxNumToClean = 30, uint32_t maxOutOfOrderFragments = 0) :
208 removeConnInfo(removeConnInfo), closedConnectionDelay(closedConnectionDelay), maxNumToClean(maxNumToClean), maxOutOfOrderFragments(maxOutOfOrderFragments)
230 TcpReassemblyConnectionClosedManually
307 typedef void (*OnTcpMessageReady)(int8_t side,
const TcpStreamData& tcpData,
void* userCookie);
315 typedef void (*OnTcpConnectionStart)(
const ConnectionData& connectionData,
void* userCookie);
357 void closeConnection(uint32_t
flowKey);
363 void closeAllConnections();
383 uint32_t purgeClosedConnections(uint32_t maxNumToClean = 0);
392 TcpFragment() : sequence(0), dataLength(0), data(NULL) {}
393 ~TcpFragment() {
delete [] data; }
396 struct TcpOneSideData
404 TcpOneSideData() :
srcPort(0), sequence(0), gotFinOrRst(
false) {}
407 struct TcpReassemblyData
412 TcpOneSideData twoSides[2];
415 TcpReassemblyData() : closed(
false), numOfSides(0), prevSide(-1) {}
418 typedef std::map<uint32_t, TcpReassemblyData> ConnectionList;
419 typedef std::map<time_t, std::list<uint32_t> > CleanupList;
421 OnTcpMessageReady m_OnMessageReadyCallback;
422 OnTcpConnectionStart m_OnConnStart;
423 OnTcpConnectionEnd m_OnConnEnd;
425 ConnectionList m_ConnectionList;
426 ConnectionInfoList m_ConnectionInfo;
427 CleanupList m_CleanupList;
428 bool m_RemoveConnInfo;
429 uint32_t m_ClosedConnectionDelay;
430 uint32_t m_MaxNumToClean;
431 size_t m_MaxOutOfOrderFragments;
432 time_t m_PurgeTimepoint;
434 void checkOutOfOrderFragments(TcpReassemblyData* tcpReassemblyData, int8_t sideIndex,
bool cleanWholeFragList);
436 void handleFinOrRst(TcpReassemblyData* tcpReassemblyData, int8_t sideIndex, uint32_t
flowKey);
440 void insertIntoCleanupList(uint32_t flowKey);
The main namespace for the PcapPlusPlus lib.
std::map< uint32_t, ConnectionData > ConnectionInfoList
Definition: TcpReassembly.h:298
Definition: TcpReassembly.h:271
ConnectionData()
Definition: TcpReassembly.h:99
TcpStreamData(const uint8_t *tcpData, size_t tcpDataLength, size_t missingBytes, const ConnectionData &connData)
Definition: TcpReassembly.h:133
const ConnectionInfoList & getConnectionInformation() const
Definition: TcpReassembly.h:369
uint16_t srcPort
Definition: TcpReassembly.h:86
ConnectionEndReason
Definition: TcpReassembly.h:225
const ConnectionData & getConnectionData() const
Definition: TcpReassembly.h:166
timeval endTime
Definition: TcpReassembly.h:94
Definition: TcpReassembly.h:292
IPAddress dstIP
Definition: TcpReassembly.h:84
Definition: TcpReassembly.h:180
Definition: RawPacket.h:252
Definition: TcpReassembly.h:218
Definition: TcpReassembly.h:286
const uint8_t * getData() const
Definition: TcpReassembly.h:142
uint16_t dstPort
Definition: TcpReassembly.h:88
uint32_t closedConnectionDelay
Definition: TcpReassembly.h:188
uint32_t maxNumToClean
Definition: TcpReassembly.h:193
uint32_t maxOutOfOrderFragments
Definition: TcpReassembly.h:198
Definition: TcpReassembly.h:281
ReassemblyStatus
Definition: TcpReassembly.h:236
void setEndTime(const timeval &endTime)
Definition: TcpReassembly.h:111
Definition: TcpReassembly.h:246
uint32_t flowKey
Definition: TcpReassembly.h:90
TcpReassemblyConfiguration(bool removeConnInfo=true, uint32_t closedConnectionDelay=5, uint32_t maxNumToClean=30, uint32_t maxOutOfOrderFragments=0)
Definition: TcpReassembly.h:207
size_t getMissingByteCount() const
Definition: TcpReassembly.h:154
bool removeConnInfo
Definition: TcpReassembly.h:183
Definition: TcpReassembly.h:123
bool isBytesMissing() const
Definition: TcpReassembly.h:160
Definition: TcpReassembly.h:266
timeval startTime
Definition: TcpReassembly.h:92
size_t getDataLength() const
Definition: TcpReassembly.h:148
Definition: TcpReassembly.h:79
Definition: IpAddress.h:265
IPAddress srcIP
Definition: TcpReassembly.h:82
void setStartTime(const timeval &startTime)
Definition: TcpReassembly.h:105
Definition: TcpReassembly.h:276
Definition: TcpReassembly.h:254
Definition: TcpReassembly.h:228
Definition: TcpReassembly.h:260