PcapPlusPlus  22.11
pcpp::TcpStreamData Class Reference

#include <TcpReassembly.h>

Public Member Functions

 TcpStreamData (const uint8_t *tcpData, size_t tcpDataLength, size_t missingBytes, const ConnectionData &connData, timeval timestamp)
 
const uint8_t * getData () const
 
size_t getDataLength () const
 
size_t getMissingByteCount () const
 
bool isBytesMissing () const
 
const ConnectionDatagetConnectionData () const
 
timeval getTimeStamp () const
 

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()

pcpp::TcpStreamData::TcpStreamData ( const uint8_t *  tcpData,
size_t  tcpDataLength,
size_t  missingBytes,
const ConnectionData connData,
timeval  timestamp 
)
inline

A c'tor for this class that get data from outside and set the internal members

Parameters
[in]tcpDataA pointer to buffer containing the TCP data piece
[in]tcpDataLengthThe length of the buffer
[in]missingBytesThe number of missing bytes due to packet loss.
[in]connDataTCP connection information for this TCP data
[in]timestampwhen this packet was received

Member Function Documentation

◆ getConnectionData()

const ConnectionData& pcpp::TcpStreamData::getConnectionData ( ) const
inline

A getter for the connection data

Returns
The const reference to connection data

◆ getData()

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

A getter for the data buffer

Returns
A pointer to the buffer

◆ getDataLength()

size_t pcpp::TcpStreamData::getDataLength ( ) const
inline

A getter for buffer length

Returns
Buffer length

◆ getMissingByteCount()

size_t pcpp::TcpStreamData::getMissingByteCount ( ) const
inline

A getter for missing byte count due to packet loss.

Returns
Missing byte count

◆ getTimeStamp()

timeval pcpp::TcpStreamData::getTimeStamp ( ) const
inline

A getter for the timestamp of this packet

Returns
The const timeval object with timestamp of this packet

◆ isBytesMissing()

bool pcpp::TcpStreamData::isBytesMissing ( ) const
inline

Determine if bytes are missing. getMissingByteCount can be called to determine the number of missing bytes.

Returns
true if bytes are missing.