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 cumAckTSN)
 
uint32 getCumAckTSN () const
 
uint32 getHighestTSNReceived () const
 
uint32 getNumGaps (const GapType type) const
 
bool tsnInGapList (const uint32 tsn) const
 
bool tsnIsRevokable (const uint32 tsn) const
 
bool tsnIsNonRevokable (const uint32 tsn) const
 
uint32 getGapStart (const GapType type, const uint32 index) const
 
uint32 getGapStop (const GapType type, const uint32 index) const
 
void check () const
 
void print (std::ostream &os) const
 
void forwardCumAckTSN (const uint32 cumAckTSN)
 
bool tryToAdvanceCumAckTSN ()
 
void removeFromGapList (const uint32 removedTSN)
 
bool updateGapList (const uint32 receivedTSN, bool &newChunkReceived, bool tsnIsRevokable=true)
 
void resetGaps (const uint32 newCumAck)
 

Private Attributes

uint32 CumAckTSN
 
SCTPSimpleGapList RevokableGapList
 
SCTPSimpleGapList NonRevokableGapList
 
SCTPSimpleGapList CombinedGapList
 

Member Enumeration Documentation

Enumerator
GT_Any 
GT_Revokable 
GT_NonRevokable 
106  {
107  GT_Any = 0,
108  GT_Revokable = 1,
109  GT_NonRevokable = 2
110  };
Definition: SCTPGapList.h:108
Definition: SCTPGapList.h:107
Definition: SCTPGapList.h:109

Constructor & Destructor Documentation

inet::sctp::SCTPGapList::SCTPGapList ( )
312 {
313  CumAckTSN = 0;
314 }
uint32 CumAckTSN
Definition: SCTPGapList.h:180
inet::sctp::SCTPGapList::~SCTPGapList ( )
318 {
319 }

Member Function Documentation

void inet::sctp::SCTPGapList::check ( ) const
323 {
327 }
void check(const uint32 cTsnAck) const
Definition: SCTPGapList.cc:42
uint32 CumAckTSN
Definition: SCTPGapList.h:180
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
void inet::sctp::SCTPGapList::forwardCumAckTSN ( const uint32  cumAckTSN)

Referenced by inet::sctp::SCTPAssociation::processResetResponseArrived(), and inet::sctp::SCTPAssociation::sendInitAck().

340 {
341  CumAckTSN = cumAckTSN;
345 }
uint32 CumAckTSN
Definition: SCTPGapList.h:180
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
void forwardCumAckTSN(const uint32 cTsnAck)
Definition: SCTPGapList.cc:89
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
uint32 inet::sctp::SCTPGapList::getGapStart ( const GapType  type,
const uint32  index 
) const
inline

Referenced by inet::sctp::SCTPAssociation::createForwardTsnChunk(), and inet::sctp::SCTPAssociation::processSackArrived().

141  {
142  if (type == GT_Revokable) {
143  return RevokableGapList.getGapStart(index);
144  }
145  else if (type == GT_NonRevokable) {
146  return NonRevokableGapList.getGapStart(index);
147  }
148  else {
149  return CombinedGapList.getGapStart(index);
150  }
151  }
uint32 getGapStart(const uint32 index) const
Definition: SCTPGapList.h:48
Definition: SCTPGapList.h:108
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
Definition: SCTPGapList.h:109
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
uint32 inet::sctp::SCTPGapList::getGapStop ( const GapType  type,
const uint32  index 
) const
inline

Referenced by inet::sctp::SCTPAssociation::createForwardTsnChunk(), and inet::sctp::SCTPAssociation::processSackArrived().

154  {
155  if (type == GT_Revokable) {
156  return RevokableGapList.getGapStop(index);
157  }
158  else if (type == GT_NonRevokable) {
159  return NonRevokableGapList.getGapStop(index);
160  }
161  else {
162  return CombinedGapList.getGapStop(index);
163  }
164  }
Definition: SCTPGapList.h:108
uint32 getGapStop(const uint32 index) const
Definition: SCTPGapList.h:54
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
Definition: SCTPGapList.h:109
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
uint32 inet::sctp::SCTPGapList::getHighestTSNReceived ( ) const
inline
uint32 inet::sctp::SCTPGapList::getNumGaps ( const GapType  type) const
inline

Referenced by inet::sctp::SCTPAssociation::createForwardTsnChunk(), inet::sctp::SCTPAssociation::createSack(), inet::sctp::SCTPAssociation::processSackArrived(), and inet::sctp::SCTPAssociation::timeForSack().

113  {
114  if (type == GT_Revokable) {
115  return RevokableGapList.getNumGaps();
116  }
117  else if (type == GT_NonRevokable) {
119  }
120  else {
121  return CombinedGapList.getNumGaps();
122  }
123  }
Definition: SCTPGapList.h:108
uint32 getNumGaps() const
Definition: SCTPGapList.h:43
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
Definition: SCTPGapList.h:109
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
void inet::sctp::SCTPGapList::print ( std::ostream &  os) const

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

331 {
332  os << "CumAck=" << CumAckTSN;
333  os << " Combined-Gaps=" << CombinedGapList;
334  os << " R-Gaps=" << RevokableGapList;
335  os << " NR-Gaps=" << NonRevokableGapList;
336 }
uint32 CumAckTSN
Definition: SCTPGapList.h:180
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
void inet::sctp::SCTPGapList::removeFromGapList ( const uint32  removedTSN)

Referenced by inet::sctp::SCTPAssociation::makeRoomForTsn().

360 {
364 }
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
void removeFromGapList(const uint32 removedTSN)
Definition: SCTPGapList.cc:142
void inet::sctp::SCTPGapList::resetGaps ( const uint32  newCumAck)

Referenced by inet::sctp::SCTPAssociation::resetGapLists().

396 {
397  CumAckTSN = newCumAck;
401 }
uint32 CumAckTSN
Definition: SCTPGapList.h:180
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
void resetGaps()
Definition: SCTPGapList.cc:55
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
void inet::sctp::SCTPGapList::setInitialCumAckTSN ( const uint32  cumAckTSN)
inline

Referenced by inet::sctp::SCTPAssociation::processInitAckArrived(), inet::sctp::SCTPAssociation::processInitArrived(), and inet::sctp::SCTPAssociation::processSackArrived().

86  {
87  assert(CombinedGapList.getNumGaps() == 0);
88  CumAckTSN = cumAckTSN;
89  }
uint32 CumAckTSN
Definition: SCTPGapList.h:180
uint32 getNumGaps() const
Definition: SCTPGapList.h:43
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
bool inet::sctp::SCTPGapList::tryToAdvanceCumAckTSN ( )

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

349 {
353  return true;
354  }
355  return false;
356 }
uint32 CumAckTSN
Definition: SCTPGapList.h:180
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
void forwardCumAckTSN(const uint32 cTsnAck)
Definition: SCTPGapList.cc:89
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
bool tryToAdvanceCumAckTSN(uint32 &cTsnAck)
Definition: SCTPGapList.cc:118
bool inet::sctp::SCTPGapList::tsnInGapList ( const uint32  tsn) const
inline

Referenced by inet::sctp::SCTPAssociation::processForwardTsnArrived(), and inet::sctp::SCTPAssociation::tsnIsDuplicate().

126  {
127  return CombinedGapList.tsnInGapList(tsn);
128  }
bool tsnInGapList(const uint32 tsn) const
Definition: SCTPGapList.cc:78
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
bool inet::sctp::SCTPGapList::tsnIsNonRevokable ( const uint32  tsn) const
inline

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

136  {
137  return NonRevokableGapList.tsnInGapList(tsn);
138  }
bool tsnInGapList(const uint32 tsn) const
Definition: SCTPGapList.cc:78
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
bool inet::sctp::SCTPGapList::tsnIsRevokable ( const uint32  tsn) const
inline

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

131  {
132  return RevokableGapList.tsnInGapList(tsn);
133  }
bool tsnInGapList(const uint32 tsn) const
Definition: SCTPGapList.cc:78
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
bool inet::sctp::SCTPGapList::updateGapList ( const uint32  receivedTSN,
bool &  newChunkReceived,
bool  tsnIsRevokable = true 
)

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

370 {
371  uint32 oldCumAckTSN = CumAckTSN;
372  if (tsnIsRevokable) {
373  // Once a TSN become non-revokable, it cannot become revokable again!
374  // However, if the list became too long, updateGapList() may be called
375  // again when the chunk is received again.
376  RevokableGapList.updateGapList(receivedTSN, oldCumAckTSN, newChunkReceived);
377  }
378  else {
379  if (NonRevokableGapList.updateGapList(receivedTSN, oldCumAckTSN, newChunkReceived) == true) {
380  // TSN has moved from revokable to non-revokable!
381  RevokableGapList.removeFromGapList(receivedTSN);
382  }
383  }
384 
385  // Finally, add TSN to combined list and set CumAckTSN.
386  oldCumAckTSN = CumAckTSN;
387  const bool newChunk = CombinedGapList.updateGapList(receivedTSN, CumAckTSN, newChunkReceived);
388  if (oldCumAckTSN != CumAckTSN) {
391  }
392  return newChunk;
393 }
bool tsnIsRevokable(const uint32 tsn) const
Definition: SCTPGapList.h:130
uint32 CumAckTSN
Definition: SCTPGapList.h:180
bool updateGapList(const uint32 receivedTSN, uint32 &cTsnAck, bool &newChunkReceived)
Definition: SCTPGapList.cc:186
SCTPSimpleGapList CombinedGapList
Definition: SCTPGapList.h:183
void forwardCumAckTSN(const uint32 cTsnAck)
Definition: SCTPGapList.cc:89
uint32_t uint32
Definition: Compat.h:30
SCTPSimpleGapList RevokableGapList
Definition: SCTPGapList.h:181
SCTPSimpleGapList NonRevokableGapList
Definition: SCTPGapList.h:182
void removeFromGapList(const uint32 removedTSN)
Definition: SCTPGapList.cc:142

Member Data Documentation

SCTPSimpleGapList inet::sctp::SCTPGapList::CombinedGapList
private
uint32 inet::sctp::SCTPGapList::CumAckTSN
private
SCTPSimpleGapList inet::sctp::SCTPGapList::NonRevokableGapList
private
SCTPSimpleGapList inet::sctp::SCTPGapList::RevokableGapList
private

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