INET Framework for OMNeT++/OMNEST
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]
: SCTPErrorChunk_Base(name, kind) {};
SCTPErrorChunk::SCTPErrorChunk ( const SCTPErrorChunk other) [inline]
: SCTPErrorChunk_Base(other.getName()) {operator=(other);};

Member Function Documentation

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

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

Referenced by operator=().

{
     take(msg);

     this->setBitLength(this->getBitLength()+ADD_PADDING(msg->getBitLength()));
     parameterList.push_back(msg);
}
virtual SCTPErrorChunk* SCTPErrorChunk::dup ( ) const [inline, virtual]
{return new SCTPErrorChunk(*this);}
cPacketPtr & SCTPErrorChunk::getParameters ( uint32  k) [virtual]

Returns the kth parameter in this SCTP Reset Chunk

Referenced by TCPDumper::sctpDump().

{
     std::list<cPacket*>::iterator i = parameterList.begin();
     while (k>0 && i!=parameterList.end())
          (++i, --k);
     return *i;
}
uint32 SCTPErrorChunk::getParametersArraySize ( ) const [virtual]

Referenced by TCPDumper::sctpDump().

{
     return parameterList.size();
}
SCTPErrorChunk & SCTPErrorChunk::operator= ( const SCTPErrorChunk other)
{
     SCTPErrorChunk_Base::operator=(other);

     this->setBitLength(4*8);
     for (std::list<cPacket*>::const_iterator i=other.parameterList.begin(); i!=other.parameterList.end(); ++i)
          addParameters((cPacket *)(*i)->dup());

     return *this;
}
cPacket * SCTPErrorChunk::removeParameter ( ) [virtual]

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

{
    if (parameterList.empty())
        return NULL;

    cPacket *msg = parameterList.front();
    parameterList.pop_front();
    drop(msg);
    this->setBitLength(this->getBitLength()-ADD_PADDING(msg->getBitLength()/8)*8);
    return msg;
}
void SCTPErrorChunk::setParameters ( uint32  k,
const cPacketPtr &  parameters_var 
) [virtual]

Generated but unused method, should not be called.

{
     throw new cException(this, "setParameter() not supported, use addParameter()");
}
void SCTPErrorChunk::setParametersArraySize ( uint32  size) [virtual]
{
     throw new cException(this, "setParametersArraySize() not supported, use addParameter()");
}

Member Data Documentation


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