|
PcapPlusPlus
19.12
|
Go to the documentation of this file. 1 #ifndef PACKETPP_TCP_REASSEMBLY
2 #define PACKETPP_TCP_REASSEMBLY
163 : m_Data(tcpData), m_DataLen(tcpDataLength), m_Connection(connData)
171 const uint8_t*
getData()
const {
return m_Data; }
186 const uint8_t* m_Data;
344 TcpFragment() { sequence = 0; dataLength = 0; data = NULL; }
345 ~TcpFragment() {
if (data != NULL)
delete [] data; }
348 struct TcpOneSideData
353 PointerVector<TcpFragment> tcpFragmentList;
356 void setSrcIP(IPAddress* sourrcIP);
358 TcpOneSideData() { srcIP = NULL; srcPort = 0; sequence = 0; gotFinOrRst =
false; }
360 ~TcpOneSideData() {
if (srcIP != NULL)
delete srcIP; }
363 struct TcpReassemblyData
367 TcpOneSideData twoSides[2];
368 ConnectionData connData;
370 TcpReassemblyData() { numOfSides = 0; prevSide = -1; }
373 typedef std::map<uint32_t, TcpReassemblyData *> ConnectionList;
374 typedef std::map<time_t, std::list<uint32_t> > CleanupList;
380 ConnectionList m_ConnectionList;
382 CleanupList m_CleanupList;
383 bool m_RemoveConnInfo;
384 uint32_t m_ClosedConnectionDelay;
385 uint32_t m_MaxNumToClean;
386 time_t m_PurgeTimepoint;
388 void checkOutOfOrderFragments(TcpReassemblyData* tcpReassemblyData,
int sideIndex,
bool cleanWholeFragList);
390 std::string prepareMissingDataMessage(uint32_t missingDataLen);
392 void handleFinOrRst(TcpReassemblyData* tcpReassemblyData,
int sideIndex, uint32_t flowKey);
396 void insertIntoCleanupList(uint32_t flowKey);
void setDstIpAddress(const IPAddress *destIP)
Definition: TcpReassembly.h:125
const uint8_t * getData() const
Definition: TcpReassembly.h:171
void closeConnection(uint32_t flowKey)
ConnectionEndReason
Definition: TcpReassembly.h:235
ConnectionData()
Definition: TcpReassembly.h:98
void setEndTime(const timeval &endTime)
Definition: TcpReassembly.h:137
void setStartTime(const timeval &startTime)
Definition: TcpReassembly.h:131
Definition: TcpReassembly.h:78
uint32_t closedConnectionDelay
Definition: TcpReassembly.h:204
Definition: IpAddress.h:28
TcpReassemblyConfiguration(bool removeConnInfo=true, uint32_t closedConnectionDelay=5, uint32_t maxNumToClean=30)
Definition: TcpReassembly.h:217
void closeAllConnections()
TcpReassembly(OnTcpMessageReady onMessageReadyCallback, void *userCookie=NULL, OnTcpConnectionStart onConnectionStartCallback=NULL, OnTcpConnectionEnd onConnectionEndCallback=NULL, const TcpReassemblyConfiguration &config=TcpReassemblyConfiguration())
void(* OnTcpMessageReady)(int side, const TcpStreamData &tcpData, void *userCookie)
Definition: TcpReassembly.h:255
Definition: TcpReassembly.h:153
Definition: TcpReassembly.h:196
timeval endTime
Definition: TcpReassembly.h:93
void(* OnTcpConnectionStart)(const ConnectionData &connectionData, void *userCookie)
Definition: TcpReassembly.h:263
uint32_t maxNumToClean
Definition: TcpReassembly.h:209
Definition: TcpReassembly.h:240
Definition: TcpReassembly.h:228
int isConnectionOpen(const ConnectionData &connection) const
uint16_t dstPort
Definition: TcpReassembly.h:87
The main namespace for the PcapPlusPlus lib.
IPAddress * srcIP
Definition: TcpReassembly.h:81
void(* OnTcpConnectionEnd)(const ConnectionData &connectionData, ConnectionEndReason reason, void *userCookie)
Definition: TcpReassembly.h:272
const ConnectionData & getConnectionData() const
Definition: TcpReassembly.h:183
TcpStreamData(const uint8_t *tcpData, size_t tcpDataLength, const ConnectionData &connData)
Definition: TcpReassembly.h:162
IPAddress * dstIP
Definition: TcpReassembly.h:83
size_t getDataLength() const
Definition: TcpReassembly.h:177
ConnectionData & operator=(const ConnectionData &other)
uint32_t flowKey
Definition: TcpReassembly.h:89
timeval startTime
Definition: TcpReassembly.h:91
uint16_t srcPort
Definition: TcpReassembly.h:85
std::map< uint32_t, ConnectionData > ConnectionInfoList
Definition: TcpReassembly.h:246
uint32_t purgeClosedConnections(uint32_t maxNumToClean=0)
Definition: TcpReassembly.h:238
void reassemblePacket(Packet &tcpData)
bool removeConnInfo
Definition: TcpReassembly.h:199
void setSrcIpAddress(const IPAddress *sourceIP)
Definition: TcpReassembly.h:119
Definition: RawPacket.h:219
virtual IPAddress * clone() const =0
const ConnectionInfoList & getConnectionInformation() const
Definition: TcpReassembly.h:321