Click
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ByteStreamMaintainer Class Reference

Class used to manage a flow. Stores the modifications in the flow (bytes removed or inserted) as well as information such as the MSS, ports, ips, last ack received, last ack sent, ... More...

#include <bytestreammaintainer.hh>

Public Member Functions

 ByteStreamMaintainer ()
 Construct a ByteStreamMaintainer ByteStreamMaintainer must be initialized before being used.
 
 ~ByteStreamMaintainer ()
 Destruct a ByteStreamMaintainer.
 
void reinit ()
 
uint32_t mapAck (uint32_t position)
 Map an ack number.
 
uint32_t mapSeq (uint32_t position)
 Map a sequence number.
 
int lastOffsetInAckTree ()
 Return the offset corresponding to the last modification in the ack tree.
 
void printTrees ()
 Print the ACK and SEQ trees in the console.
 
void initialize (RBTManager *rbtManager, uint32_t flowStart)
 Initialize the ByteStreamMaintainer (required before beging use)
 
void prune (uint32_t position)
 Prune the trees.
 
void setLastAckSent (uint32_t ackNumber)
 Sets the value of the last ack sent by this side of the connection.
 
uint32_t getLastAckSent ()
 Return the value of the last ack sent by this side of the connection.
 
bool isLastAckSentSet ()
 Indicate whether the "last ack sent" value has been set.
 
void setLastSeqSent (uint32_t seqNumber)
 Set the value of the "last seq sent" by this side of the connection.
 
void setLastPayloadLength (uint16_t payload)
 Set the size of the last packet payload, allows to compute next seq.
 
uint32_t getLastSeqSent ()
 Return the value of the "last seq sent" by this side of the connection.
 
uint16_t getLastPayloadLength ()
 
bool isLastSeqSentSet ()
 Indicate whether the "last seq sent" value has been set.
 
uint8_t getDupAcks ()
 Return the number of consecutive duplicate ACKs currently observed.
 
void setDupAcks (uint8_t dupAcks)
 Set the number of consecutive duplicate ACKs currently observed.
 
void setWindowSize (uint16_t windowSize)
 Set the window size of the source (will be used as the receiver's windows size by the other side of the connection when sending packets)
 
uint16_t getWindowSize ()
 Return the window size of the source (will be used as the receiver's windows size by the other side of the connection when sending packets)
 
void setWindowScale (uint16_t windowScale)
 Set the window scale factor of the source.
 
uint16_t getWindowScale ()
 Return the window scale factor of the source.
 
void setUseWindowScale (bool useWindowScale)
 Indicate whether the connection uses the window scale option.
 
bool getUseWindowScale ()
 Return a boolean indicating whether the connection uses the window scale option.
 
uint16_t getMSS ()
 Return the MSS of the source.
 
void setMSS (uint16_t mss)
 Set the MSS of the source.
 
uint64_t getCongestionWindowSize ()
 Return the size of the congestion window for this side of the connection.
 
void setCongestionWindowSize (uint64_t congestionWindow)
 Set the size of the congestion window for this side of the connection.
 
void setSsthresh (uint64_t ssthresh)
 Set the ssthreshold (slow start threshold) for this side of the connection.
 
uint64_t getSsthresh ()
 Return the ssthreshold (slow start threshold) for this side of the connection.
 
void setIpSrc (uint32_t ipSrc)
 Set the IP address of the source.
 
uint32_t getIpSrc ()
 Return the IP address of the source.
 
void setIpDst (uint32_t ipDst)
 Set the IP address of the destination.
 
uint32_t getIpDst ()
 Return the IP address of the destination.
 
void setPortSrc (uint16_t portSrc)
 Set the port number of the source.
 
uint16_t getPortSrc ()
 Return the port number of the source.
 
void setPortDst (uint16_t portDst)
 Set the port number of the destination.
 
uint16_t getPortDst ()
 Return the port number of the destination.
 

Detailed Description

Class used to manage a flow. Stores the modifications in the flow (bytes removed or inserted) as well as information such as the MSS, ports, ips, last ack received, last ack sent, ...

Each side of a connection must have its own ByteStreamMaintainer.

Constructor & Destructor Documentation

◆ ByteStreamMaintainer()

ByteStreamMaintainer::ByteStreamMaintainer ( )

Construct a ByteStreamMaintainer ByteStreamMaintainer must be initialized before being used.

◆ ~ByteStreamMaintainer()

ByteStreamMaintainer::~ByteStreamMaintainer ( )

Destruct a ByteStreamMaintainer.

Member Function Documentation

◆ mapAck()

uint32_t ByteStreamMaintainer::mapAck ( uint32_t  position)

Map an ack number.

Parameters
positionInitial ack value
Returns
New value, taking into account the modifications in the flow

◆ mapSeq()

uint32_t ByteStreamMaintainer::mapSeq ( uint32_t  position)

Map a sequence number.

Parameters
positionInitial seq value
Returns
New value, taking into account the modifications in the flow

◆ lastOffsetInAckTree()

int ByteStreamMaintainer::lastOffsetInAckTree ( )

Return the offset corresponding to the last modification in the ack tree.

Returns
The offset with the greatest key in the ack tree or 0 if the tree is empty

◆ printTrees()

void ByteStreamMaintainer::printTrees ( )

Print the ACK and SEQ trees in the console.

◆ initialize()

void ByteStreamMaintainer::initialize ( RBTManager *  rbtManager,
uint32_t  flowStart 
)

Initialize the ByteStreamMaintainer (required before beging use)

Parameters
rbtManagerThe RBTManager used to manage the trees
flowStartThe first sequence number in the flow

◆ prune()

void ByteStreamMaintainer::prune ( uint32_t  position)

Prune the trees.

Parameters
positionValue of the last ACK sent by the destination

◆ setLastAckSent()

void ByteStreamMaintainer::setLastAckSent ( uint32_t  ackNumber)
inline

Sets the value of the last ack sent by this side of the connection.

Parameters
ackNumberValue of the last ack sent by this side of the connection

◆ getLastAckSent()

uint32_t ByteStreamMaintainer::getLastAckSent ( )
inline

Return the value of the last ack sent by this side of the connection.

Returns
Value of the last ack sent by this side of the connection

◆ isLastAckSentSet()

bool ByteStreamMaintainer::isLastAckSentSet ( )
inline

Indicate whether the "last ack sent" value has been set.

Returns
True if the "last ack sent" value has been set

◆ setLastSeqSent()

void ByteStreamMaintainer::setLastSeqSent ( uint32_t  seqNumber)
inline

Set the value of the "last seq sent" by this side of the connection.

Parameters
seqNumberValue of the "last seq sent" by this side of the connection

◆ setLastPayloadLength()

void ByteStreamMaintainer::setLastPayloadLength ( uint16_t  payload)
inline

Set the size of the last packet payload, allows to compute next seq.

◆ getLastSeqSent()

uint32_t ByteStreamMaintainer::getLastSeqSent ( )
inline

Return the value of the "last seq sent" by this side of the connection.

Returns
Value of the "last seq sent" by this side of the connection

◆ isLastSeqSentSet()

bool ByteStreamMaintainer::isLastSeqSentSet ( )
inline

Indicate whether the "last seq sent" value has been set.

Returns
True if the "last seq sent" value has been set

◆ getDupAcks()

uint8_t ByteStreamMaintainer::getDupAcks ( )
inline

Return the number of consecutive duplicate ACKs currently observed.

Returns
The number of consecutive duplicate ACKs currently observed

◆ setDupAcks()

void ByteStreamMaintainer::setDupAcks ( uint8_t  dupAcks)
inline

Set the number of consecutive duplicate ACKs currently observed.

Parameters
dupAcksThe number of consecutive duplicate ACKs currently observed

◆ setWindowSize()

void ByteStreamMaintainer::setWindowSize ( uint16_t  windowSize)
inline

Set the window size of the source (will be used as the receiver's windows size by the other side of the connection when sending packets)

Parameters
windowSizeThe window size of the source

◆ getWindowSize()

uint16_t ByteStreamMaintainer::getWindowSize ( )
inline

Return the window size of the source (will be used as the receiver's windows size by the other side of the connection when sending packets)

Returns
The window size of the source

◆ setWindowScale()

void ByteStreamMaintainer::setWindowScale ( uint16_t  windowScale)
inline

Set the window scale factor of the source.

Parameters
windowScaleWindow scale factor of the source

◆ getWindowScale()

uint16_t ByteStreamMaintainer::getWindowScale ( )
inline

Return the window scale factor of the source.

Returns
The window scale factor of the source

◆ setUseWindowScale()

void ByteStreamMaintainer::setUseWindowScale ( bool  useWindowScale)
inline

Indicate whether the connection uses the window scale option.

Parameters
useWindowScaleA boolean indicating whether the connection uses the window scale option

◆ getUseWindowScale()

bool ByteStreamMaintainer::getUseWindowScale ( )
inline

Return a boolean indicating whether the connection uses the window scale option.

Returns
A boolean indicating whether the connection uses the window scale option

◆ getMSS()

uint16_t ByteStreamMaintainer::getMSS ( )
inline

Return the MSS of the source.

Returns
The mss of the source

◆ setMSS()

void ByteStreamMaintainer::setMSS ( uint16_t  mss)
inline

Set the MSS of the source.

Parameters
mssThe mss of the source

◆ getCongestionWindowSize()

uint64_t ByteStreamMaintainer::getCongestionWindowSize ( )
inline

Return the size of the congestion window for this side of the connection.

Returns
Size of the congestion window for this side of the connection

◆ setCongestionWindowSize()

void ByteStreamMaintainer::setCongestionWindowSize ( uint64_t  congestionWindow)
inline

Set the size of the congestion window for this side of the connection.

Parameters
congestionWindowSize of the congestion window for this side of the connection

◆ setSsthresh()

void ByteStreamMaintainer::setSsthresh ( uint64_t  ssthresh)
inline

Set the ssthreshold (slow start threshold) for this side of the connection.

Parameters
ssthreshSsthreshold for this side of the connection

◆ getSsthresh()

uint64_t ByteStreamMaintainer::getSsthresh ( )
inline

Return the ssthreshold (slow start threshold) for this side of the connection.

Returns
Ssthreshold for this side of the connection

◆ setIpSrc()

void ByteStreamMaintainer::setIpSrc ( uint32_t  ipSrc)
inline

Set the IP address of the source.

Parameters
ipSrcIP address of the source

◆ getIpSrc()

uint32_t ByteStreamMaintainer::getIpSrc ( )
inline

Return the IP address of the source.

Returns
IP address of the source

◆ setIpDst()

void ByteStreamMaintainer::setIpDst ( uint32_t  ipDst)
inline

Set the IP address of the destination.

Parameters
ipDstIP address of the destination

◆ getIpDst()

uint32_t ByteStreamMaintainer::getIpDst ( )
inline

Return the IP address of the destination.

Returns
IP address of the destination

◆ setPortSrc()

void ByteStreamMaintainer::setPortSrc ( uint16_t  portSrc)
inline

Set the port number of the source.

Parameters
portSrcport number of the source

◆ getPortSrc()

uint16_t ByteStreamMaintainer::getPortSrc ( )
inline

Return the port number of the source.

Returns
port number of the source

◆ setPortDst()

void ByteStreamMaintainer::setPortDst ( uint16_t  portDst)
inline

Set the port number of the destination.

Parameters
portDstport number of the destination

◆ getPortDst()

uint16_t ByteStreamMaintainer::getPortDst ( )
inline

Return the port number of the destination.

Returns
port number of the destination

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