libtins  3.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Types | Public Member Functions | List of all members
Tins::TCPStream Class Reference

Represents a TCP stream. More...

#include <tcp_stream.h>

Classes

struct  StreamInfo
 

Public Types

typedef std::vector< uint8_t > payload_type
 

Public Member Functions

 TCPStream (IP *ip, TCP *tcp, uint64_t identifier)
 TCPStream constructor. More...
 
 TCPStream (const TCPStream &rhs)
 
TCPStreamoperator= (const TCPStream &rhs)
 
 ~TCPStream ()
 
const payload_typeclient_payload () const
 Retrieves the client payload. More...
 
payload_typeclient_payload ()
 Retrieves the client payload. More...
 
const payload_typeserver_payload () const
 Retrieves the server payload. More...
 
payload_typeserver_payload ()
 Retrieves the server payload. More...
 
uint64_t id () const
 Retrieves this stream's identification number. More...
 
const StreamInfostream_info () const
 Retrieves the stream information. More...
 
bool is_finished () const
 Checks whether this stream is finished. More...
 
bool update (IP *ip, TCP *tcp)
 Updates the stream data. More...
 

Detailed Description

Represents a TCP stream.

Member Typedef Documentation

typedef std::vector<uint8_t> Tins::TCPStream::payload_type

The type used to store the payload.

Constructor & Destructor Documentation

Tins::TCPStream::TCPStream ( IP ip,
TCP tcp,
uint64_t  identifier 
)

TCPStream constructor.

Parameters
ipThe IP PDU from which to take the initial parameters.
tcpThe TCP PDU from which to take the initial parameters.
identifierThis stream's identifier number
Tins::TCPStream::TCPStream ( const TCPStream rhs)

Copy constructor.

Tins::TCPStream::~TCPStream ( )

Destructor.

Member Function Documentation

const payload_type& Tins::TCPStream::client_payload ( ) const
inline

Retrieves the client payload.

This is the payload that the connection's client has sent so far.

Returns
const payload_type& containing the payload.
payload_type& Tins::TCPStream::client_payload ( )
inline

Retrieves the client payload.

This is the payload that the connection's client has sent so far.

Returns
payload_type& containing the payload.
uint64_t Tins::TCPStream::id ( ) const
inline

Retrieves this stream's identification number.

Returns
uint64_t containing the identification number.
bool Tins::TCPStream::is_finished ( ) const
inline

Checks whether this stream is finished.

A stream is considered to be finished, if at least one of the peers sends a TCP segment containing the FIN bit on.

Returns
bool indicating whether the stream is finished.
TCPStream & Tins::TCPStream::operator= ( const TCPStream rhs)

Copy assignment operator.

const payload_type& Tins::TCPStream::server_payload ( ) const
inline

Retrieves the server payload.

This is the payload that the connection's server has sent so far.

Returns
const payload_type& containing the payload.
payload_type& Tins::TCPStream::server_payload ( )
inline

Retrieves the server payload.

This is the payload that the connection's server has sent so far.

Returns
payload_type& containing the payload.
const StreamInfo& Tins::TCPStream::stream_info ( ) const
inline

Retrieves the stream information.

Returns
const StreamInfo& containing the stream information.
bool Tins::TCPStream::update ( IP ip,
TCP tcp 
)

Updates the stream data.

This may update both the payload and the expected sequence numbers.

Parameters
ipThe IP PDU from which to take information.
tcpThe TCP PDU from which to take information.
Returns
bool indicating whether any changes have been done to any of the stored payloads.

The documentation for this class was generated from the following files: