INET Framework for OMNeT++/OMNEST
TCPSegment_Base Class Reference

#include <TCPSegment_m.h>

Inheritance diagram for TCPSegment_Base:
TCPSegment

List of all members.

Public Member Functions

virtual ~TCPSegment_Base ()
virtual TCPSegment_Basedup () const
virtual void parsimPack (cCommBuffer *b)
virtual void parsimUnpack (cCommBuffer *b)
virtual unsigned short getSrcPort () const
virtual void setSrcPort (unsigned short srcPort)
virtual unsigned short getDestPort () const
virtual void setDestPort (unsigned short destPort)
virtual unsigned int getSequenceNo () const
virtual void setSequenceNo (unsigned int sequenceNo)
virtual unsigned int getAckNo () const
virtual void setAckNo (unsigned int ackNo)
virtual unsigned short getHeaderLength () const
virtual void setHeaderLength (unsigned short headerLength)
virtual bool getUrgBit () const
virtual void setUrgBit (bool urgBit)
virtual bool getAckBit () const
virtual void setAckBit (bool ackBit)
virtual bool getPshBit () const
virtual void setPshBit (bool pshBit)
virtual bool getRstBit () const
virtual void setRstBit (bool rstBit)
virtual bool getSynBit () const
virtual void setSynBit (bool synBit)
virtual bool getFinBit () const
virtual void setFinBit (bool finBit)
virtual unsigned short getWindow () const
virtual void setWindow (unsigned short window)
virtual unsigned short getUrgentPointer () const
virtual void setUrgentPointer (unsigned short urgentPointer)
virtual void setOptionsArraySize (unsigned int size)
virtual unsigned int getOptionsArraySize () const
virtual TCPOptiongetOptions (unsigned int k)
virtual const TCPOptiongetOptions (unsigned int k) const
virtual void setOptions (unsigned int k, const TCPOption &options)
virtual unsigned long getPayloadLength () const
virtual void setPayloadLength (unsigned long payloadLength)
virtual void setPayloadArraySize (unsigned int size)=0
virtual unsigned int getPayloadArraySize () const =0
virtual TCPPayloadMessagegetPayload (unsigned int k)=0
virtual const TCPPayloadMessagegetPayload (unsigned int k) const
virtual void setPayload (unsigned int k, const TCPPayloadMessage &payload)=0

Protected Member Functions

bool operator== (const TCPSegment_Base &)
 TCPSegment_Base (const char *name=NULL, int kind=0)
 TCPSegment_Base (const TCPSegment_Base &other)
TCPSegment_Baseoperator= (const TCPSegment_Base &other)

Protected Attributes

unsigned short srcPort_var
unsigned short destPort_var
unsigned int sequenceNo_var
unsigned int ackNo_var
unsigned short headerLength_var
bool urgBit_var
bool ackBit_var
bool pshBit_var
bool rstBit_var
bool synBit_var
bool finBit_var
unsigned short window_var
unsigned short urgentPointer_var
TCPOptionoptions_var
unsigned int options_arraysize
unsigned long payloadLength_var

Private Member Functions

void copy (const TCPSegment_Base &other)

Detailed Description

Class generated from transport/tcp/TCPSegment.msg by opp_msgc.

 packet TCPSegment
 {
     (true);
     unsigned short srcPort;
     unsigned short destPort;
     unsigned int sequenceNo;
     unsigned int ackNo;
     unsigned short headerLength = TCP_HEADER_OCTETS;
     bool urgBit; 
     bool ackBit; 
     bool pshBit; 
     bool rstBit; 
     bool synBit; 
     bool finBit;
     unsigned short window;
     unsigned short urgentPointer;
     TCPOption options[];
     unsigned long payloadLength;
     abstract TCPPayloadMessage payload[];
 }
 

TCPSegment_Base is only useful if it gets subclassed, and TCPSegment is derived from it. The minimum code to be written for TCPSegment is the following:

 class TCPSegment : public TCPSegment_Base
 {
   private:
     void copy(const TCPSegment& other) { ... }
   public:
     TCPSegment(const char *name=NULL, int kind=0) : TCPSegment_Base(name,kind) {}
     TCPSegment(const TCPSegment& other) : TCPSegment_Base(other) {copy(other);}
     TCPSegment& operator=(const TCPSegment& other) {if (this==&other) return *this; TCPSegment_Base::operator=(other); copy(other); return *this;}
     virtual TCPSegment *dup() const {return new TCPSegment(*this);}
     // ADD CODE HERE to redefine and implement pure virtual functions from TCPSegment_Base
 };
 

The following should go into a .cc (.cpp) file:

 Register_Class(TCPSegment);
 

Definition at line 290 of file TCPSegment_m.h.


Constructor & Destructor Documentation

TCPSegment_Base::TCPSegment_Base ( const char *  name = NULL,
int  kind = 0 
) [protected]
TCPSegment_Base::TCPSegment_Base ( const TCPSegment_Base other) [protected]
virtual TCPSegment_Base::~TCPSegment_Base ( ) [virtual]

Member Function Documentation

void TCPSegment_Base::copy ( const TCPSegment_Base other) [private]
virtual TCPSegment_Base* TCPSegment_Base::dup ( ) const [inline, virtual]

Reimplemented in TCPSegment.

Definition at line 324 of file TCPSegment_m.h.

{throw cRuntimeError("You forgot to manually add a dup() function to class TCPSegment");}
virtual const TCPOption& TCPSegment_Base::getOptions ( unsigned int  k) const [inline, virtual]

Definition at line 358 of file TCPSegment_m.h.

Referenced by getOptions().

{return const_cast<TCPSegment_Base*>(this)->getOptions(k);}
virtual TCPPayloadMessage& TCPSegment_Base::getPayload ( unsigned int  k) [pure virtual]

Implemented in TCPSegment.

virtual const TCPPayloadMessage& TCPSegment_Base::getPayload ( unsigned int  k) const [inline, virtual]

Definition at line 365 of file TCPSegment_m.h.

Referenced by getPayload().

{return const_cast<TCPSegment_Base*>(this)->getPayload(k);}
virtual unsigned int TCPSegment_Base::getPayloadArraySize ( ) const [pure virtual]

Implemented in TCPSegment.

TCPSegment_Base& TCPSegment_Base::operator= ( const TCPSegment_Base other) [protected]

Referenced by TCPSegment::TCPSegment().

bool TCPSegment_Base::operator== ( const TCPSegment_Base ) [protected]
virtual void TCPSegment_Base::parsimPack ( cCommBuffer *  b) [virtual]

Reimplemented in TCPSegment.

virtual void TCPSegment_Base::parsimUnpack ( cCommBuffer *  b) [virtual]

Reimplemented in TCPSegment.

virtual void TCPSegment_Base::setHeaderLength ( unsigned short  headerLength) [virtual]
virtual void TCPSegment_Base::setPayload ( unsigned int  k,
const TCPPayloadMessage payload 
) [pure virtual]

Implemented in TCPSegment.

virtual void TCPSegment_Base::setPayloadArraySize ( unsigned int  size) [pure virtual]

Implemented in TCPSegment.

virtual void TCPSegment_Base::setPshBit ( bool  pshBit) [virtual]

Referenced by TCPSerializer::parse().

virtual void TCPSegment_Base::setUrgBit ( bool  urgBit) [virtual]

Referenced by TCPSerializer::parse().

virtual void TCPSegment_Base::setUrgentPointer ( unsigned short  urgentPointer) [virtual]

Referenced by TCPSerializer::parse().


Member Data Documentation

bool TCPSegment_Base::ackBit_var [protected]

Definition at line 299 of file TCPSegment_m.h.

unsigned int TCPSegment_Base::ackNo_var [protected]

Definition at line 296 of file TCPSegment_m.h.

unsigned short TCPSegment_Base::destPort_var [protected]

Definition at line 294 of file TCPSegment_m.h.

bool TCPSegment_Base::finBit_var [protected]

Definition at line 303 of file TCPSegment_m.h.

unsigned short TCPSegment_Base::headerLength_var [protected]

Definition at line 297 of file TCPSegment_m.h.

unsigned int TCPSegment_Base::options_arraysize [protected]

Definition at line 307 of file TCPSegment_m.h.

Definition at line 306 of file TCPSegment_m.h.

unsigned long TCPSegment_Base::payloadLength_var [protected]

Definition at line 308 of file TCPSegment_m.h.

Referenced by TCPSegment::truncateSegment().

bool TCPSegment_Base::pshBit_var [protected]

Definition at line 300 of file TCPSegment_m.h.

bool TCPSegment_Base::rstBit_var [protected]

Definition at line 301 of file TCPSegment_m.h.

unsigned int TCPSegment_Base::sequenceNo_var [protected]

Definition at line 295 of file TCPSegment_m.h.

Referenced by TCPSegment::truncateSegment().

unsigned short TCPSegment_Base::srcPort_var [protected]

Definition at line 293 of file TCPSegment_m.h.

bool TCPSegment_Base::synBit_var [protected]

Definition at line 302 of file TCPSegment_m.h.

bool TCPSegment_Base::urgBit_var [protected]

Definition at line 298 of file TCPSegment_m.h.

unsigned short TCPSegment_Base::urgentPointer_var [protected]

Definition at line 305 of file TCPSegment_m.h.

unsigned short TCPSegment_Base::window_var [protected]

Definition at line 304 of file TCPSegment_m.h.


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