INET Framework for OMNeT++/OMNEST
inet::sctp::SctpGapList Class Reference

#include <SctpGapList.h>

Public Types

enum  GapType { GT_Any = 0, GT_Revokable = 1, GT_NonRevokable = 2 }
 

Public Member Functions

 SctpGapList ()
 
 ~SctpGapList ()
 
void setInitialCumAckTsn (const uint32_t cumAckTsn)
 
uint32_t getCumAckTsn () const
 
uint32_t getHighestTsnReceived () const
 
uint32_t getNumGaps (const GapType type) const
 
bool tsnInGapList (const uint32_t tsn) const
 
bool tsnIsRevokable (const uint32_t tsn) const
 
bool tsnIsNonRevokable (const uint32_t tsn) const
 
uint32_t getGapStart (const GapType type, const uint32_t index) const
 
uint32_t getGapStop (const GapType type, const uint32_t index) const
 
void check () const
 
void print (std::ostream &os) const
 
void forwardCumAckTsn (const uint32_t cumAckTsn)
 
bool tryToAdvanceCumAckTsn ()
 
void removeFromGapList (const uint32_t removedTsn)
 
bool updateGapList (const uint32_t receivedTsn, bool &newChunkReceived, bool tsnIsRevokable=true)
 
void resetGaps (const uint32_t newCumAck)
 

Private Attributes

uint32_t CumAckTsn
 
SctpSimpleGapList RevokableGapList
 
SctpSimpleGapList NonRevokableGapList
 
SctpSimpleGapList CombinedGapList
 

Member Enumeration Documentation

◆ GapType

Enumerator
GT_Any 
GT_Revokable 
GT_NonRevokable 
94  {
95  GT_Any = 0,
96  GT_Revokable = 1,
97  GT_NonRevokable = 2
98  };

Constructor & Destructor Documentation

◆ SctpGapList()

inet::sctp::SctpGapList::SctpGapList ( )
301 {
302  CumAckTsn = 0;
303 }

◆ ~SctpGapList()

inet::sctp::SctpGapList::~SctpGapList ( )
307 {
308 }

Member Function Documentation

◆ check()

void inet::sctp::SctpGapList::check ( ) const

◆ forwardCumAckTsn()

void inet::sctp::SctpGapList::forwardCumAckTsn ( const uint32_t  cumAckTsn)

◆ getCumAckTsn()

◆ getGapStart()

uint32_t inet::sctp::SctpGapList::getGapStart ( const GapType  type,
const uint32_t  index 
) const
inline
129  {
130  if (type == GT_Revokable) {
131  return RevokableGapList.getGapStart(index);
132  }
133  else if (type == GT_NonRevokable) {
134  return NonRevokableGapList.getGapStart(index);
135  }
136  else {
137  return CombinedGapList.getGapStart(index);
138  }
139  }

Referenced by inet::sctp::SctpAssociation::processSackArrived().

◆ getGapStop()

uint32_t inet::sctp::SctpGapList::getGapStop ( const GapType  type,
const uint32_t  index 
) const
inline
142  {
143  if (type == GT_Revokable) {
144  return RevokableGapList.getGapStop(index);
145  }
146  else if (type == GT_NonRevokable) {
147  return NonRevokableGapList.getGapStop(index);
148  }
149  else {
150  return CombinedGapList.getGapStop(index);
151  }
152  }

Referenced by inet::sctp::SctpAssociation::processSackArrived().

◆ getHighestTsnReceived()

◆ getNumGaps()

uint32_t inet::sctp::SctpGapList::getNumGaps ( const GapType  type) const
inline

◆ print()

void inet::sctp::SctpGapList::print ( std::ostream &  os) const
320 {
321  os << "CumAck=" << CumAckTsn;
322  os << " Combined-Gaps=" << CombinedGapList;
323  os << " R-Gaps=" << RevokableGapList;
324  os << " NR-Gaps=" << NonRevokableGapList;
325 }

Referenced by inet::sctp::operator<<().

◆ removeFromGapList()

void inet::sctp::SctpGapList::removeFromGapList ( const uint32_t  removedTsn)

◆ resetGaps()

void inet::sctp::SctpGapList::resetGaps ( const uint32_t  newCumAck)

◆ setInitialCumAckTsn()

void inet::sctp::SctpGapList::setInitialCumAckTsn ( const uint32_t  cumAckTsn)
inline

◆ tryToAdvanceCumAckTsn()

bool inet::sctp::SctpGapList::tryToAdvanceCumAckTsn ( )

◆ tsnInGapList()

bool inet::sctp::SctpGapList::tsnInGapList ( const uint32_t  tsn) const
inline

◆ tsnIsNonRevokable()

bool inet::sctp::SctpGapList::tsnIsNonRevokable ( const uint32_t  tsn) const
inline
124  {
125  return NonRevokableGapList.tsnInGapList(tsn);
126  }

Referenced by inet::sctp::SctpAssociation::processSackArrived().

◆ tsnIsRevokable()

bool inet::sctp::SctpGapList::tsnIsRevokable ( const uint32_t  tsn) const
inline

◆ updateGapList()

bool inet::sctp::SctpGapList::updateGapList ( const uint32_t  receivedTsn,
bool &  newChunkReceived,
bool  tsnIsRevokable = true 
)
359 {
360  uint32_t oldCumAckTsn = CumAckTsn;
361  if (tsnIsRevokable) {
362  // Once a TSN become non-revokable, it cannot become revokable again!
363  // However, if the list became too long, updateGapList() may be called
364  // again when the chunk is received again.
365  RevokableGapList.updateGapList(receivedTsn, oldCumAckTsn, newChunkReceived);
366  }
367  else {
368  if (NonRevokableGapList.updateGapList(receivedTsn, oldCumAckTsn, newChunkReceived) == true) {
369  // TSN has moved from revokable to non-revokable!
370  RevokableGapList.removeFromGapList(receivedTsn);
371  }
372  }
373 
374  // Finally, add TSN to combined list and set CumAckTSN.
375  oldCumAckTsn = CumAckTsn;
376  const bool newChunk = CombinedGapList.updateGapList(receivedTsn, CumAckTsn, newChunkReceived);
377  if (oldCumAckTsn != CumAckTsn) {
380  }
381  return newChunk;
382 }

Referenced by inet::sctp::SctpAssociation::processDataArrived(), inet::sctp::SctpAssociation::processForwardTsnArrived(), and inet::sctp::SctpAssociation::processSackArrived().

Member Data Documentation

◆ CombinedGapList

SctpSimpleGapList inet::sctp::SctpGapList::CombinedGapList
private

◆ CumAckTsn

uint32_t inet::sctp::SctpGapList::CumAckTsn
private

◆ NonRevokableGapList

SctpSimpleGapList inet::sctp::SctpGapList::NonRevokableGapList
private

◆ RevokableGapList

SctpSimpleGapList inet::sctp::SctpGapList::RevokableGapList
private

The documentation for this class was generated from the following files:
inet::sctp::SctpSimpleGapList::updateGapList
bool updateGapList(const uint32_t receivedTsn, uint32_t &cTsnAck, bool &newChunkReceived)
Definition: SctpGapList.cc:175
inet::sctp::SctpGapList::RevokableGapList
SctpSimpleGapList RevokableGapList
Definition: SctpGapList.h:169
inet::sctp::SctpSimpleGapList::resetGaps
void resetGaps()
Definition: SctpGapList.cc:44
inet::sctp::SctpSimpleGapList::removeFromGapList
void removeFromGapList(const uint32_t removedTsn)
Definition: SctpGapList.cc:131
inet::sctp::SctpSimpleGapList::tryToAdvanceCumAckTsn
bool tryToAdvanceCumAckTsn(uint32_t &cTsnAck)
Definition: SctpGapList.cc:107
inet::sctp::SctpGapList::GT_Any
@ GT_Any
Definition: SctpGapList.h:95
inet::sctp::SctpSimpleGapList::getGapStop
uint32_t getGapStop(const uint32_t index) const
Definition: SctpGapList.h:42
inet::sctp::SctpGapList::NonRevokableGapList
SctpSimpleGapList NonRevokableGapList
Definition: SctpGapList.h:170
inet::sctp::SctpGapList::CombinedGapList
SctpSimpleGapList CombinedGapList
Definition: SctpGapList.h:171
type
removed type
Definition: IUdp-gates.txt:7
inet::sctp::SctpGapList::GT_Revokable
@ GT_Revokable
Definition: SctpGapList.h:96
inet::sctp::SctpSimpleGapList::tsnInGapList
bool tsnInGapList(const uint32_t tsn) const
Definition: SctpGapList.cc:67
inet::sctp::SctpGapList::GT_NonRevokable
@ GT_NonRevokable
Definition: SctpGapList.h:97
inet::sctp::SctpSimpleGapList::getNumGaps
uint32_t getNumGaps() const
Definition: SctpGapList.h:31
inet::sctp::SctpSimpleGapList::forwardCumAckTsn
void forwardCumAckTsn(const uint32_t cTsnAck)
Definition: SctpGapList.cc:78
inet::sctp::SctpGapList::tsnIsRevokable
bool tsnIsRevokable(const uint32_t tsn) const
Definition: SctpGapList.h:118
inet::sctp::SctpSimpleGapList::check
void check(const uint32_t cTsnAck) const
Definition: SctpGapList.cc:31
inet::sctp::SctpGapList::CumAckTsn
uint32_t CumAckTsn
Definition: SctpGapList.h:168
inet::sctp::SctpSimpleGapList::getGapStart
uint32_t getGapStart(const uint32_t index) const
Definition: SctpGapList.h:36