SCTPErrorChunk Class Reference

#include <SCTPMessage.h>

List of all members.

Public Member Functions

 SCTPErrorChunk (const char *name=NULL, int32 kind=0)
 SCTPErrorChunk (const SCTPErrorChunk &other)
SCTPErrorChunkoperator= (const SCTPErrorChunk &other)
virtual SCTPErrorChunkdup () const
virtual void setParametersArraySize (uint32 size)
virtual uint32 getParametersArraySize () const
virtual void setParameters (uint32 k, const cPacketPtr &parameters_var)
virtual cPacketPtr & getParameters (uint32 k)
virtual void addParameters (cPacket *msg)
virtual cPacket * removeParameter ()

Protected Attributes

std::list< cPacket * > parameterList


Constructor & Destructor Documentation

SCTPErrorChunk::SCTPErrorChunk ( const char *  name = NULL,
int32  kind = 0 
) [inline]

Referenced by dup().

00082 : SCTPErrorChunk_Base(name, kind) {};

SCTPErrorChunk::SCTPErrorChunk ( const SCTPErrorChunk other  )  [inline]

00083 : SCTPErrorChunk_Base(other.getName()) {operator=(other);};


Member Function Documentation

SCTPErrorChunk & SCTPErrorChunk::operator= ( const SCTPErrorChunk other  ) 

Referenced by SCTPErrorChunk().

00132 {
00133     SCTPErrorChunk_Base::operator=(other);
00134 
00135     this->setBitLength(4*8);
00136     for (std::list<cPacket*>::const_iterator i=other.parameterList.begin(); i!=other.parameterList.end(); ++i)
00137         addParameters((cPacket *)(*i)->dup());
00138 
00139     return *this;
00140 }

virtual SCTPErrorChunk* SCTPErrorChunk::dup (  )  const [inline, virtual]

00086 {return new SCTPErrorChunk(*this);}

void SCTPErrorChunk::setParametersArraySize ( uint32  size  )  [virtual]

00143 {
00144     throw new cException(this, "setParametersArraySize() not supported, use addParameter()");
00145 }

uint32 SCTPErrorChunk::getParametersArraySize (  )  const [virtual]

Referenced by TCPDumper::sctpDump().

00148 {
00149     return parameterList.size();
00150 }

void SCTPErrorChunk::setParameters ( uint32  k,
const cPacketPtr &  parameters_var 
) [virtual]

Generated but unused method, should not be called.

00161 {
00162     throw new cException(this, "setParameter() not supported, use addParameter()");
00163 }

cPacketPtr & SCTPErrorChunk::getParameters ( uint32  k  )  [virtual]

Returns the kth parameter in this SCTP Reset Chunk

Referenced by TCPDumper::sctpDump().

00153 {
00154     std::list<cPacket*>::iterator i = parameterList.begin();
00155     while (k>0 && i!=parameterList.end())
00156         (++i, --k);
00157     return *i;
00158 }

void SCTPErrorChunk::addParameters ( cPacket *  msg  )  [virtual]

Adds a message object to the SCTP packet. The packet length will be adjusted

Referenced by operator=().

00168 {
00169     take(msg);
00170 
00171     this->setBitLength(this->getBitLength()+ADD_PADDING(msg->getBitLength()));
00172     parameterList.push_back(msg);
00173 }

cPacket * SCTPErrorChunk::removeParameter (  )  [virtual]

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

00176 {
00177     if (parameterList.empty())
00178         return NULL;
00179 
00180     cPacket *msg = parameterList.front();
00181     parameterList.pop_front();
00182     drop(msg);
00183     this->setBitLength(this->getBitLength()-ADD_PADDING(msg->getBitLength()/8)*8);
00184     return msg;
00185 }


Member Data Documentation

std::list<cPacket*> SCTPErrorChunk::parameterList [protected]


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

Generated on Fri Mar 20 18:51:21 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5