INET Framework for OMNeT++/OMNEST
inet::IPv6ControlInfo_Base Class Referenceabstract

Class generated from inet/networklayer/contract/ipv6/IPv6ControlInfo.msg:68 by nedtool. More...

#include <IPv6ControlInfo_m.h>

Inheritance diagram for inet::IPv6ControlInfo_Base:
inet::IPv6ControlInfo

Public Member Functions

virtual ~IPv6ControlInfo_Base ()
 
virtual IPv6ControlInfo_Basedup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual short getProtocol () const
 
virtual void setProtocol (short protocol)
 
virtual IPv6AddressgetDestAddr ()
 
virtual const IPv6AddressgetDestAddr () const
 
virtual void setDestAddr (const IPv6Address &destAddr)
 
virtual IPv6AddressgetSrcAddr ()
 
virtual const IPv6AddressgetSrcAddr () const
 
virtual void setSrcAddr (const IPv6Address &srcAddr)
 
virtual unsigned char getTrafficClass () const
 
virtual void setTrafficClass (unsigned char trafficClass)
 
virtual int getDiffServCodePoint () const =0
 
virtual void setDiffServCodePoint (int diffServCodePoint)=0
 
virtual int getExplicitCongestionNotification () const =0
 
virtual void setExplicitCongestionNotification (int explicitCongestionNotification)=0
 
virtual short getHopLimit () const
 
virtual void setHopLimit (short hopLimit)
 
virtual int getInterfaceId () const
 
virtual void setInterfaceId (int interfaceId)
 
virtual bool getMulticastLoop () const
 
virtual void setMulticastLoop (bool multicastLoop)
 
virtual void setExtensionHeaderArraySize (unsigned int size)=0
 
virtual unsigned int getExtensionHeaderArraySize () const =0
 
virtual IPv6ExtensionHeaderPtrgetExtensionHeader (unsigned int k)=0
 
virtual const IPv6ExtensionHeaderPtrgetExtensionHeader (unsigned int k) const
 
virtual void setExtensionHeader (unsigned int k, const IPv6ExtensionHeaderPtr &extensionHeader)=0
 

Protected Member Functions

bool operator== (const IPv6ControlInfo_Base &)
 
 IPv6ControlInfo_Base ()
 
 IPv6ControlInfo_Base (const IPv6ControlInfo_Base &other)
 
IPv6ControlInfo_Baseoperator= (const IPv6ControlInfo_Base &other)
 

Protected Attributes

short protocol
 
IPv6Address destAddr
 
IPv6Address srcAddr
 
unsigned char trafficClass
 
short hopLimit
 
int interfaceId
 
bool multicastLoop
 

Private Member Functions

void copy (const IPv6ControlInfo_Base &other)
 

Detailed Description

Class generated from inet/networklayer/contract/ipv6/IPv6ControlInfo.msg:68 by nedtool.

//
// Control information for sending/receiving packets over IPv6.
//
// To send a packet over IPv6, fill in an ~IPv6ControlInfo object,
// attach it to the packet with the C++ method setControlInfo(),
// the send it to the ~IPv6 module.
//
// When sending, the following fields are required:
// - protocol: a value from ~IPProtocolId
// - destAddr
//
// Optional fields:
// - srcAddr: it will be set to the address of the outgoing interface
// - timeToLive
//
// When ~IPv6 delivers a packet to higher layers, it also attaches an
// ~IPv6ControlInfo to it. It fills in the following fields:
//  - srcAddr, destAddr, protocol, hopLimit: values from the original datagram
//  - interfaceId: the interface on which the datagram arrived, or -1 if it was
//    created locally
//
// ~IPv6 also puts the original datagram object into the control info, because
// it may be needed by higher layers.
//
class IPv6ControlInfo
{
    @customize(true);
    short protocol @enum(IPProtocolId);  // transport layer protocol
    IPv6Address destAddr; // destination IPv6 address
    IPv6Address srcAddr;  // source IPv6 address
    unsigned char trafficClass;  // Traffic Class byte (low 6 bits: DSCP; highest 2 bits: ECN)
    abstract int diffServCodePoint;  // maps to bits 0-5 of trafficClass
    abstract int explicitCongestionNotification;  // maps to bits 6-7 of trafficClass
    short hopLimit;       // hop limit
    int interfaceId = -1; // interface on which the datagram was received, or
                          // should be sent (see ~InterfaceTable)
    bool multicastLoop;   // if true, sent multicast datagrams will be looped back
    abstract IPv6ExtensionHeaderPtr extensionHeader[]; // array of extension headers, subclassed from ~IPv6ExtensionHeader
}

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

class INET_API IPv6ControlInfo : public IPv6ControlInfo_Base
{
  private:
    void copy(const IPv6ControlInfo& other) { ... }
  public:
    IPv6ControlInfo() : IPv6ControlInfo_Base() {}
    IPv6ControlInfo(const IPv6ControlInfo& other) : IPv6ControlInfo_Base(other) {copy(other);}
    IPv6ControlInfo& operator=(const IPv6ControlInfo& other) {if (this==&other) return *this; IPv6ControlInfo_Base::operator=(other); copy(other); return *this;}
    virtual IPv6ControlInfo *dup() const override {return new IPv6ControlInfo(*this);}
    // ADD CODE HERE to redefine and implement pure virtual functions from IPv6ControlInfo_Base
};

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

Register_Class(IPv6ControlInfo)

Constructor & Destructor Documentation

inet::IPv6ControlInfo_Base::IPv6ControlInfo_Base ( )
protected
inet::IPv6ControlInfo_Base::IPv6ControlInfo_Base ( const IPv6ControlInfo_Base other)
protected
virtual inet::IPv6ControlInfo_Base::~IPv6ControlInfo_Base ( )
virtual

Member Function Documentation

void inet::IPv6ControlInfo_Base::copy ( const IPv6ControlInfo_Base other)
private
virtual IPv6ControlInfo_Base* inet::IPv6ControlInfo_Base::dup ( ) const
inlineoverridevirtual

Reimplemented in inet::IPv6ControlInfo.

141 {throw omnetpp::cRuntimeError("You forgot to manually add a dup() function to class IPv6ControlInfo");}
virtual const IPv6Address& inet::IPv6ControlInfo_Base::getDestAddr ( ) const
inlinevirtual

Referenced by getDestAddr().

149 {return const_cast<IPv6ControlInfo_Base*>(this)->getDestAddr();}
virtual IPv6Address & getDestAddr()
virtual int inet::IPv6ControlInfo_Base::getDiffServCodePoint ( ) const
pure virtual

Implemented in inet::IPv6ControlInfo.

virtual int inet::IPv6ControlInfo_Base::getExplicitCongestionNotification ( ) const
pure virtual

Implemented in inet::IPv6ControlInfo.

virtual IPv6ExtensionHeaderPtr& inet::IPv6ControlInfo_Base::getExtensionHeader ( unsigned int  k)
pure virtual

Implemented in inet::IPv6ControlInfo.

virtual const IPv6ExtensionHeaderPtr& inet::IPv6ControlInfo_Base::getExtensionHeader ( unsigned int  k) const
inlinevirtual

Referenced by getExtensionHeader().

169 {return const_cast<IPv6ControlInfo_Base*>(this)->getExtensionHeader(k);}
virtual IPv6ExtensionHeaderPtr & getExtensionHeader(unsigned int k)=0
const double k
Definition: QAM16Modulation.cc:24
virtual unsigned int inet::IPv6ControlInfo_Base::getExtensionHeaderArraySize ( ) const
pure virtual

Implemented in inet::IPv6ControlInfo.

virtual short inet::IPv6ControlInfo_Base::getHopLimit ( ) const
virtual
virtual int inet::IPv6ControlInfo_Base::getInterfaceId ( ) const
virtual
virtual bool inet::IPv6ControlInfo_Base::getMulticastLoop ( ) const
virtual
virtual const IPv6Address& inet::IPv6ControlInfo_Base::getSrcAddr ( ) const
inlinevirtual

Referenced by getSrcAddr().

152 {return const_cast<IPv6ControlInfo_Base*>(this)->getSrcAddr();}
virtual IPv6Address & getSrcAddr()
virtual unsigned char inet::IPv6ControlInfo_Base::getTrafficClass ( ) const
virtual
IPv6ControlInfo_Base& inet::IPv6ControlInfo_Base::operator= ( const IPv6ControlInfo_Base other)
protected
bool inet::IPv6ControlInfo_Base::operator== ( const IPv6ControlInfo_Base )
protected
virtual void inet::IPv6ControlInfo_Base::parsimPack ( omnetpp::cCommBuffer *  b) const
overridevirtual
virtual void inet::IPv6ControlInfo_Base::parsimUnpack ( omnetpp::cCommBuffer *  b)
overridevirtual
virtual void inet::IPv6ControlInfo_Base::setDiffServCodePoint ( int  diffServCodePoint)
pure virtual

Implemented in inet::IPv6ControlInfo.

virtual void inet::IPv6ControlInfo_Base::setExplicitCongestionNotification ( int  explicitCongestionNotification)
pure virtual

Implemented in inet::IPv6ControlInfo.

virtual void inet::IPv6ControlInfo_Base::setExtensionHeader ( unsigned int  k,
const IPv6ExtensionHeaderPtr extensionHeader 
)
pure virtual

Implemented in inet::IPv6ControlInfo.

virtual void inet::IPv6ControlInfo_Base::setExtensionHeaderArraySize ( unsigned int  size)
pure virtual

Implemented in inet::IPv6ControlInfo.

virtual void inet::IPv6ControlInfo_Base::setHopLimit ( short  hopLimit)
virtual
virtual void inet::IPv6ControlInfo_Base::setInterfaceId ( int  interfaceId)
virtual
virtual void inet::IPv6ControlInfo_Base::setMulticastLoop ( bool  multicastLoop)
virtual

Referenced by inet::UDP::sendDown().

virtual void inet::IPv6ControlInfo_Base::setTrafficClass ( unsigned char  trafficClass)
virtual

Member Data Documentation

IPv6Address inet::IPv6ControlInfo_Base::destAddr
protected
short inet::IPv6ControlInfo_Base::hopLimit
protected
int inet::IPv6ControlInfo_Base::interfaceId
protected
bool inet::IPv6ControlInfo_Base::multicastLoop
protected
short inet::IPv6ControlInfo_Base::protocol
protected
IPv6Address inet::IPv6ControlInfo_Base::srcAddr
protected
unsigned char inet::IPv6ControlInfo_Base::trafficClass
protected

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