|
PcapPlusPlus
20.08
|
Go to the documentation of this file. 1 #ifndef PACKETPP_TCP_REASSEMBLY
2 #define PACKETPP_TCP_REASSEMBLY
132 : m_Data(tcpData), m_DataLen(tcpDataLength), m_Connection(connData)
140 const uint8_t*
getData()
const {
return m_Data; }
155 const uint8_t* m_Data;
371 TcpFragment() : sequence(0), dataLength(0), data(NULL) {}
372 ~TcpFragment() {
delete [] data; }
375 struct TcpOneSideData
380 PointerVector<TcpFragment> tcpFragmentList;
383 TcpOneSideData() : srcPort(0), sequence(0), gotFinOrRst(false) {}
386 struct TcpReassemblyData
391 TcpOneSideData twoSides[2];
392 ConnectionData connData;
394 TcpReassemblyData() : closed(false), numOfSides(0), prevSide(-1) {}
397 typedef std::map<uint32_t, TcpReassemblyData> ConnectionList;
398 typedef std::map<time_t, std::list<uint32_t> > CleanupList;
404 ConnectionList m_ConnectionList;
406 CleanupList m_CleanupList;
407 bool m_RemoveConnInfo;
408 uint32_t m_ClosedConnectionDelay;
409 uint32_t m_MaxNumToClean;
410 time_t m_PurgeTimepoint;
412 void checkOutOfOrderFragments(TcpReassemblyData* tcpReassemblyData, int8_t sideIndex,
bool cleanWholeFragList);
414 void handleFinOrRst(TcpReassemblyData* tcpReassemblyData, int8_t sideIndex, uint32_t flowKey);
418 void insertIntoCleanupList(uint32_t flowKey);
const uint8_t * getData() const
Definition: TcpReassembly.h:140
void closeConnection(uint32_t flowKey)
ConnectionEndReason
Definition: TcpReassembly.h:204
ConnectionData()
Definition: TcpReassembly.h:98
@ Ignore_PacketWithNoData
Definition: TcpReassembly.h:245
void setEndTime(const timeval &endTime)
Definition: TcpReassembly.h:110
ReassemblyStatus reassemblePacket(Packet &tcpData)
void setStartTime(const timeval &startTime)
Definition: TcpReassembly.h:104
void(* OnTcpMessageReady)(int8_t side, const TcpStreamData &tcpData, void *userCookie)
Definition: TcpReassembly.h:286
@ Ignore_PacketOfClosedFlow
Definition: TcpReassembly.h:250
Definition: TcpReassembly.h:78
uint32_t closedConnectionDelay
Definition: TcpReassembly.h:173
**
Definition: IpAddress.h:236
@ NonTcpPacket
Definition: TcpReassembly.h:265
TcpReassemblyConfiguration(bool removeConnInfo=true, uint32_t closedConnectionDelay=5, uint32_t maxNumToClean=30)
Definition: TcpReassembly.h:186
void closeAllConnections()
TcpReassembly(OnTcpMessageReady onMessageReadyCallback, void *userCookie=NULL, OnTcpConnectionStart onConnectionStartCallback=NULL, OnTcpConnectionEnd onConnectionEndCallback=NULL, const TcpReassemblyConfiguration &config=TcpReassemblyConfiguration())
Definition: TcpReassembly.h:122
@ Error_PacketDoesNotMatchFlow
Definition: TcpReassembly.h:271
Definition: TcpReassembly.h:165
timeval endTime
Definition: TcpReassembly.h:93
void(* OnTcpConnectionStart)(const ConnectionData &connectionData, void *userCookie)
Definition: TcpReassembly.h:294
uint32_t maxNumToClean
Definition: TcpReassembly.h:178
@ FIN_RSTWithNoData
Definition: TcpReassembly.h:239
@ TcpReassemblyConnectionClosedManually
Definition: TcpReassembly.h:209
Definition: TcpReassembly.h:197
int isConnectionOpen(const ConnectionData &connection) const
ReassemblyStatus
Definition: TcpReassembly.h:215
uint16_t dstPort
Definition: TcpReassembly.h:87
The main namespace for the PcapPlusPlus lib.
void(* OnTcpConnectionEnd)(const ConnectionData &connectionData, ConnectionEndReason reason, void *userCookie)
Definition: TcpReassembly.h:303
@ Ignore_Retransimission
Definition: TcpReassembly.h:255
const ConnectionData & getConnectionData() const
Definition: TcpReassembly.h:152
TcpStreamData(const uint8_t *tcpData, size_t tcpDataLength, const ConnectionData &connData)
Definition: TcpReassembly.h:131
size_t getDataLength() const
Definition: TcpReassembly.h:146
uint32_t flowKey
Definition: TcpReassembly.h:89
@ TcpMessageHandled
Definition: TcpReassembly.h:225
@ OutOfOrderTcpMessageBuffered
Definition: TcpReassembly.h:233
timeval startTime
Definition: TcpReassembly.h:91
@ NonIpPacket
Definition: TcpReassembly.h:260
uint16_t srcPort
Definition: TcpReassembly.h:85
std::map< uint32_t, ConnectionData > ConnectionInfoList
Definition: TcpReassembly.h:277
uint32_t purgeClosedConnections(uint32_t maxNumToClean=0)
@ TcpReassemblyConnectionClosedByFIN_RST
Definition: TcpReassembly.h:207
IPAddress srcIP
Definition: TcpReassembly.h:81
bool removeConnInfo
Definition: TcpReassembly.h:168
IPAddress dstIP
Definition: TcpReassembly.h:83
Definition: RawPacket.h:252
const ConnectionInfoList & getConnectionInformation() const
Definition: TcpReassembly.h:348