PcapPlusPlus
pcpp::TcpStreamData Class Reference

#include <TcpReassembly.h>

Public Member Functions

 TcpStreamData ()
 
 TcpStreamData (uint8_t *tcpData, size_t tcpDataLength, ConnectionData connData)
 
 ~TcpStreamData ()
 
 TcpStreamData (TcpStreamData &other)
 
TcpStreamDataoperator= (const TcpStreamData &other)
 
uint8_t * getData ()
 
size_t getDataLength ()
 
ConnectionData getConnectionData ()
 

Detailed Description

When following a TCP connection each packet may contain a piece of the data transferred between the client and the server. This class represents these pieces: each instance of it contains a piece of data, usually extracted from a single packet, as well as information about the connection

Constructor & Destructor Documentation

pcpp::TcpStreamData::TcpStreamData ( )

A c'tor for this class that basically zeros all members

pcpp::TcpStreamData::TcpStreamData ( uint8_t *  tcpData,
size_t  tcpDataLength,
ConnectionData  connData 
)

A c'tor for this class that get data from outside and set the internal members. Notice that when this class is destroyed it also frees the TCP data it stores

Parameters
[in]tcpDataA buffer containing the TCP data piece
[in]tcpDataLengthThe length of the buffer
[in]connDataTCP connection information for this TCP data
pcpp::TcpStreamData::~TcpStreamData ( )

A d'tor for this class

pcpp::TcpStreamData::TcpStreamData ( TcpStreamData other)

A copy c'tor for this class. Notice the data buffer is copied from the source instance to this instance, so even if the source instance is destroyed the data in this instance stays valid. When this instance is destroyed it also frees the data buffer

Parameters
[in]otherThe instance to copy from

Member Function Documentation

ConnectionData pcpp::TcpStreamData::getConnectionData ( )
inline

A getter for the connection data

Returns
The connection data
uint8_t* pcpp::TcpStreamData::getData ( )
inline

A getter for the data buffer

Returns
A pointer to the buffer
size_t pcpp::TcpStreamData::getDataLength ( )
inline

A getter for buffer length

Returns
Buffer length
TcpStreamData& pcpp::TcpStreamData::operator= ( const TcpStreamData other)

Overload of the assignment operator. Notice the data buffer is copied from the source instance to this instance, so even if the source instance is destroyed the data in this instance stays valid. When this instance is destroyed it also frees the data buffer

Parameters
[in]otherThe instance to copy from
Returns
A reference to this instance