MPLSPacket Class Reference

#include <MPLSPacket.h>

List of all members.


Detailed Description

Represents a packet with MPLS headers


Public Member Functions

 MPLSPacket (const char *name=NULL)
 MPLSPacket (const MPLSPacket &p)
virtual MPLSPacketoperator= (const MPLSPacket &p)
virtual cObject * dup () const
void swapLabel (int newLabel)
void pushLabel (int newLabel)
void popLabel ()
bool hasLabel ()
int topLabel ()

Private Types

typedef std::stack< int > LabelStack

Private Attributes

LabelStack labels


Member Typedef Documentation

typedef std::stack<int> MPLSPacket::LabelStack [private]


Constructor & Destructor Documentation

MPLSPacket::MPLSPacket ( const char *  name = NULL  ) 

00021                                        : cMessage(name)
00022 {
00023 }

MPLSPacket::MPLSPacket ( const MPLSPacket p  ) 

00026 {
00027     setName(p.name());
00028     operator=(p);
00029 }


Member Function Documentation

virtual cObject* MPLSPacket::dup (  )  const [inline, virtual]

cloning function

00043 {return new MPLSPacket(*this);}

bool MPLSPacket::hasLabel (  )  [inline]

Returns true if the label stack is not empty

00063 {return !labels.empty();}

MPLSPacket & MPLSPacket::operator= ( const MPLSPacket p  )  [virtual]

00033 {
00034     cMessage::operator=(p);
00035     return *this;
00036 }

void MPLSPacket::popLabel (  )  [inline]

Pops the top label

00058 {labels.pop();addLength(-32);}

void MPLSPacket::pushLabel ( int  newLabel  )  [inline]

Pushes new label on the label stack

00053 {labels.push(newLabel);addLength(32);}

void MPLSPacket::swapLabel ( int  newLabel  )  [inline]

Swap Label operation

00048 {labels.top()=newLabel;}

int MPLSPacket::topLabel (  )  [inline]

Returns the top label

00068 {return labels.top();}


Member Data Documentation

LabelStack MPLSPacket::labels [private]


The documentation for this class was generated from the following files:
Generated on Wed Apr 4 13:20:22 2007 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.7