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

#include <SCTPMessage.h>

Inheritance diagram for inet::sctp::SCTPErrorChunk:
inet::sctp::SCTPErrorChunk_Base inet::sctp::SCTPChunk

Public Member Functions

 SCTPErrorChunk (const char *name=nullptr, int32 kind=0)
 
 SCTPErrorChunk (const SCTPErrorChunk &other)
 
SCTPErrorChunkoperator= (const SCTPErrorChunk &other)
 
 ~SCTPErrorChunk ()
 
virtual SCTPErrorChunkdup () const override
 
virtual void setParametersArraySize (uint32 size) override
 
virtual uint32 getParametersArraySize () const override
 
virtual void setParameters (uint32 k, const cPacketPtr &parameters_var) override
 Generated but unused method, should not be called. More...
 
virtual cPacketPtrgetParameters (uint32 k) override
 Returns the kth parameter in this SCTP Reset Chunk. More...
 
virtual void addParameters (cPacket *msg)
 Adds a message object to the SCTP packet. More...
 
virtual cPacket * removeParameter ()
 Removes and returns the first message object in this SCTP packet. More...
 
- Public Member Functions inherited from inet::sctp::SCTPErrorChunk_Base
virtual ~SCTPErrorChunk_Base ()
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual bool getTBit () const
 
virtual void setTBit (bool TBit)
 
virtual bool getMBit () const
 
virtual void setMBit (bool MBit)
 
virtual void setParametersArraySize (unsigned int size)=0
 
virtual cPacketPtrgetParameters (unsigned int k)=0
 
virtual const cPacketPtrgetParameters (unsigned int k) const
 
virtual void setParameters (unsigned int k, const cPacketPtr &parameters)=0
 
- Public Member Functions inherited from inet::sctp::SCTPChunk
 SCTPChunk (const char *name=nullptr, short kind=0)
 
 SCTPChunk (const SCTPChunk &other)
 
virtual ~SCTPChunk ()
 
SCTPChunkoperator= (const SCTPChunk &other)
 
virtual uint8_t getChunkType () const
 
virtual void setChunkType (uint8_t chunkType)
 
virtual uint32_t getFlags () const
 
virtual void setFlags (uint32_t flags)
 

Protected Attributes

std::vector< cPacket * > parameterList
 
- Protected Attributes inherited from inet::sctp::SCTPErrorChunk_Base
bool TBit
 
bool MBit
 
- Protected Attributes inherited from inet::sctp::SCTPChunk
uint8_t chunkType
 
uint32_t flags
 

Private Member Functions

void copy (const SCTPErrorChunk &other)
 
void clean ()
 

Additional Inherited Members

- Protected Member Functions inherited from inet::sctp::SCTPErrorChunk_Base
bool operator== (const SCTPErrorChunk_Base &)
 
 SCTPErrorChunk_Base (const char *name=nullptr, short kind=0)
 
 SCTPErrorChunk_Base (const SCTPErrorChunk_Base &other)
 
SCTPErrorChunk_Baseoperator= (const SCTPErrorChunk_Base &other)
 
- Protected Member Functions inherited from inet::sctp::SCTPChunk
bool operator== (const SCTPChunk &)
 

Constructor & Destructor Documentation

inet::sctp::SCTPErrorChunk::SCTPErrorChunk ( const char *  name = nullptr,
int32  kind = 0 
)
inline
93 : SCTPErrorChunk_Base(name, kind) {};
SCTPErrorChunk_Base(const char *name=nullptr, short kind=0)
inet::sctp::SCTPErrorChunk::SCTPErrorChunk ( const SCTPErrorChunk other)
inline
94 : SCTPErrorChunk_Base(other) { copy(other); };
void copy(const SCTPErrorChunk &other)
Definition: SCTPMessage.cc:159
SCTPErrorChunk_Base(const char *name=nullptr, short kind=0)
inet::sctp::SCTPErrorChunk::~SCTPErrorChunk ( )
209 {
210  clean();
211 }
void clean()
Definition: SCTPMessage.cc:213

Member Function Documentation

void inet::sctp::SCTPErrorChunk::addParameters ( cPacket *  msg)
virtual

Adds a message object to the SCTP packet.

The packet length will be adjusted

Referenced by PacketDrill::buildErrorChunk(), inet::serializer::SCTPSerializer::parse(), inet::sctp::SCTPNatHook::sendBackError(), inet::sctp::SCTPAssociation::sendHMacError(), and inet::sctp::SCTPAssociation::sendInvalidStreamError().

189 {
190  take(msg);
191 
192  this->setByteLength(this->getByteLength() + ADD_PADDING(msg->getByteLength()));
193  parameterList.push_back(msg);
194 }
std::vector< cPacket * > parameterList
Definition: SCTPMessage.h:86
#define ADD_PADDING(x)
Definition: SCTPAssociation.h:261
void inet::sctp::SCTPErrorChunk::clean ( )
private
214 {
215  while (!parameterList.empty()) {
216  cPacket *msg = parameterList.front();
217  parameterList.erase(parameterList.begin());
218  dropAndDelete(msg);
219  }
220 }
std::vector< cPacket * > parameterList
Definition: SCTPMessage.h:86
void inet::sctp::SCTPErrorChunk::copy ( const SCTPErrorChunk other)
private
160 {
161  for (const auto & elem : other.parameterList) {
162  cPacket *param = (elem)->dup();
163  take(param);
164  parameterList.push_back(param);
165  }
166 }
std::vector< cPacket * > parameterList
Definition: SCTPMessage.h:86
virtual SCTPErrorChunk * dup() const override
Definition: SCTPMessage.h:98
virtual SCTPErrorChunk* inet::sctp::SCTPErrorChunk::dup ( ) const
inlineoverridevirtual

Reimplemented from inet::sctp::SCTPErrorChunk_Base.

98 { return new SCTPErrorChunk(*this); }
SCTPErrorChunk(const char *name=nullptr, int32 kind=0)
Definition: SCTPMessage.h:93
cPacketPtr & inet::sctp::SCTPErrorChunk::getParameters ( uint32  k)
overridevirtual

Returns the kth parameter in this SCTP Reset Chunk.

Referenced by inet::PacketDrillApp::compareSctpPacket(), inet::serializer::SCTPSerializer::deserialize(), inet::sctp::SCTPAssociation::processErrorArrived(), and inet::PacketDump::sctpDump().

179 {
180  return parameterList.at(k);
181 }
std::vector< cPacket * > parameterList
Definition: SCTPMessage.h:86
const double k
Definition: QAM16Modulation.cc:24
uint32 inet::sctp::SCTPErrorChunk::getParametersArraySize ( ) const
overridevirtual
SCTPErrorChunk & inet::sctp::SCTPErrorChunk::operator= ( const SCTPErrorChunk other)
150 {
151  if (this == &other)
152  return *this;
153  clean();
155  copy(other);
156  return *this;
157 }
void clean()
Definition: SCTPMessage.cc:213
SCTPErrorChunk_Base & operator=(const SCTPErrorChunk_Base &other)
void copy(const SCTPErrorChunk &other)
Definition: SCTPMessage.cc:159
cPacket * inet::sctp::SCTPErrorChunk::removeParameter ( )
virtual

Removes and returns the first message object in this SCTP packet.

197 {
198  if (parameterList.empty())
199  return nullptr;
200 
201  cPacket *msg = parameterList.front();
202  parameterList.erase(parameterList.begin());
203  drop(msg);
204  this->setByteLength(this->getByteLength() + ADD_PADDING(msg->getByteLength()));
205  return msg;
206 }
std::vector< cPacket * > parameterList
Definition: SCTPMessage.h:86
#define ADD_PADDING(x)
Definition: SCTPAssociation.h:261
void inet::sctp::SCTPErrorChunk::setParameters ( uint32  k,
const cPacketPtr parameters_var 
)
overridevirtual

Generated but unused method, should not be called.

184 {
185  throw new cException(this, "setParameter() not supported, use addParameter()");
186 }
void inet::sctp::SCTPErrorChunk::setParametersArraySize ( uint32  size)
overridevirtual
169 {
170  throw new cException(this, "setParametersArraySize() not supported, use addParameter()");
171 }

Member Data Documentation

std::vector<cPacket *> inet::sctp::SCTPErrorChunk::parameterList
protected

Referenced by copy().


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