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

◆ TcpStreamData() [1/3]

pcpp::TcpStreamData::TcpStreamData ( )

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

◆ TcpStreamData() [2/3]

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

◆ ~TcpStreamData()

pcpp::TcpStreamData::~TcpStreamData ( )

A d'tor for this class

◆ TcpStreamData() [3/3]

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

◆ getConnectionData()

ConnectionData pcpp::TcpStreamData::getConnectionData ( )
inline

A getter for the connection data

Returns
The connection data

◆ getData()

uint8_t* pcpp::TcpStreamData::getData ( )
inline

A getter for the data buffer

Returns
A pointer to the buffer

◆ getDataLength()

size_t pcpp::TcpStreamData::getDataLength ( )
inline

A getter for buffer length

Returns
Buffer length

◆ operator=()

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