INET Framework for OMNeT++/OMNEST
inet::bgp::BGPUpdateMessage_Base Class Reference

Class generated from inet/routing/bgpv4/BGPMessage/BGPUpdate.msg:82 by nedtool. More...

#include <BGPUpdate_m.h>

Inheritance diagram for inet::bgp::BGPUpdateMessage_Base:
inet::bgp::BGPHeader inet::bgp::BGPUpdateMessage

Public Member Functions

virtual ~BGPUpdateMessage_Base ()
 
virtual BGPUpdateMessage_Base * dup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual void setWithdrawnRoutesArraySize (unsigned int size)
 
virtual unsigned int getWithdrawnRoutesArraySize () const
 
virtual BGPUpdateWithdrawnRoutes & getWithdrawnRoutes (unsigned int k)
 
virtual const BGPUpdateWithdrawnRoutes & getWithdrawnRoutes (unsigned int k) const
 
virtual void setWithdrawnRoutes (unsigned int k, const BGPUpdateWithdrawnRoutes &withdrawnRoutes)
 
virtual void setPathAttributeListArraySize (unsigned int size)
 
virtual unsigned int getPathAttributeListArraySize () const
 
virtual BGPUpdatePathAttributeList & getPathAttributeList (unsigned int k)
 
virtual const BGPUpdatePathAttributeList & getPathAttributeList (unsigned int k) const
 
virtual void setPathAttributeList (unsigned int k, const BGPUpdatePathAttributeList &pathAttributeList)
 
virtual BGPUpdateNLRI & getNLRI ()
 
virtual const BGPUpdateNLRI & getNLRI () const
 
virtual void setNLRI (const BGPUpdateNLRI &NLRI)
 
- Public Member Functions inherited from inet::bgp::BGPHeader
 BGPHeader (const char *name=nullptr, short kind=0)
 
 BGPHeader (const BGPHeader &other)
 
virtual ~BGPHeader ()
 
BGPHeader & operator= (const BGPHeader &other)
 
virtual char getType () const
 
virtual void setType (char type)
 

Protected Member Functions

bool operator== (const BGPUpdateMessage_Base &)
 
 BGPUpdateMessage_Base (const char *name=nullptr, short kind=0)
 
 BGPUpdateMessage_Base (const BGPUpdateMessage_Base &other)
 
BGPUpdateMessage_Base & operator= (const BGPUpdateMessage_Base &other)
 
- Protected Member Functions inherited from inet::bgp::BGPHeader
bool operator== (const BGPHeader &)
 

Protected Attributes

BGPUpdateWithdrawnRoutes * withdrawnRoutes
 
unsigned int withdrawnRoutes_arraysize
 
BGPUpdatePathAttributeList * pathAttributeList
 
unsigned int pathAttributeList_arraysize
 
BGPUpdateNLRI NLRI
 
- Protected Attributes inherited from inet::bgp::BGPHeader
char type
 

Private Member Functions

void copy (const BGPUpdateMessage_Base &other)
 

Detailed Description

Class generated from inet/routing/bgpv4/BGPMessage/BGPUpdate.msg:82 by nedtool.

//
// Represents a BGPv4 UPDATE message.
//
// BGP UPDATE fields modelled:
//   - Unfeasible routes length: 2 octets (number of withdrawn routes)
//   - Withdrawn routes : variable size  (list of IP prefixes of unfeasible routes)
//   - Total Path Attributes Length: 1 octet (if = 0, no Path Attributes)
//   - Path Attributes:
//     - Attribute Type (2 octets)
//     - Attribute Length
//     - Attribute Values (variable size)
// - Network Layer Reachability Information: (variable size)
//    - Length : 1 octet
//    - prefix : variable size (contains the IP prefix; IPv4: 4 octets)
//
packet BGPUpdateMessage extends BGPHeader
{
    @customize(true);
    type = BGP_UPDATE;
    byteLength = BGP_HEADER_OCTETS + BGP_EMPTY_UPDATE_OCTETS;
    BGPUpdateWithdrawnRoutes withdrawnRoutes[];
    BGPUpdatePathAttributeList pathAttributeList[]; // optional field (size is either 0 or 1)
    BGPUpdateNLRI NLRI;
}

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

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

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

Register_Class(BGPUpdateMessage)

Constructor & Destructor Documentation

inet::bgp::BGPUpdateMessage_Base::BGPUpdateMessage_Base ( const char *  name = nullptr,
short  kind = 0 
)
protected
inet::bgp::BGPUpdateMessage_Base::BGPUpdateMessage_Base ( const BGPUpdateMessage_Base &  other)
protected
virtual inet::bgp::BGPUpdateMessage_Base::~BGPUpdateMessage_Base ( )
virtual

Member Function Documentation

void inet::bgp::BGPUpdateMessage_Base::copy ( const BGPUpdateMessage_Base &  other)
private
virtual BGPUpdateMessage_Base* inet::bgp::BGPUpdateMessage_Base::dup ( ) const
inlineoverridevirtual

Reimplemented from inet::bgp::BGPHeader.

Reimplemented in inet::bgp::BGPUpdateMessage.

227 {throw omnetpp::cRuntimeError("You forgot to manually add a dup() function to class BGPUpdateMessage");}
virtual BGPUpdateNLRI& inet::bgp::BGPUpdateMessage_Base::getNLRI ( )
virtual
virtual const BGPUpdateNLRI& inet::bgp::BGPUpdateMessage_Base::getNLRI ( ) const
inlinevirtual

Referenced by getNLRI().

243 {return const_cast<BGPUpdateMessage_Base*>(this)->getNLRI();}
BGPUpdateMessage_Base(const char *name=nullptr, short kind=0)
virtual BGPUpdateNLRI & getNLRI()
virtual BGPUpdatePathAttributeList& inet::bgp::BGPUpdateMessage_Base::getPathAttributeList ( unsigned int  k)
virtual
virtual const BGPUpdatePathAttributeList& inet::bgp::BGPUpdateMessage_Base::getPathAttributeList ( unsigned int  k) const
inlinevirtual

Referenced by getPathAttributeList().

240 {return const_cast<BGPUpdateMessage_Base*>(this)->getPathAttributeList(k);}
BGPUpdateMessage_Base(const char *name=nullptr, short kind=0)
virtual BGPUpdatePathAttributeList & getPathAttributeList(unsigned int k)
const double k
Definition: QAM16Modulation.cc:24
virtual unsigned int inet::bgp::BGPUpdateMessage_Base::getPathAttributeListArraySize ( ) const
virtual
virtual BGPUpdateWithdrawnRoutes& inet::bgp::BGPUpdateMessage_Base::getWithdrawnRoutes ( unsigned int  k)
virtual
virtual const BGPUpdateWithdrawnRoutes& inet::bgp::BGPUpdateMessage_Base::getWithdrawnRoutes ( unsigned int  k) const
inlinevirtual

Referenced by getWithdrawnRoutes().

235 {return const_cast<BGPUpdateMessage_Base*>(this)->getWithdrawnRoutes(k);}
BGPUpdateMessage_Base(const char *name=nullptr, short kind=0)
virtual BGPUpdateWithdrawnRoutes & getWithdrawnRoutes(unsigned int k)
const double k
Definition: QAM16Modulation.cc:24
virtual unsigned int inet::bgp::BGPUpdateMessage_Base::getWithdrawnRoutesArraySize ( ) const
virtual
BGPUpdateMessage_Base& inet::bgp::BGPUpdateMessage_Base::operator= ( const BGPUpdateMessage_Base &  other)
protected
bool inet::bgp::BGPUpdateMessage_Base::operator== ( const BGPUpdateMessage_Base &  )
protected
virtual void inet::bgp::BGPUpdateMessage_Base::parsimPack ( omnetpp::cCommBuffer *  b) const
overridevirtual

Reimplemented from inet::bgp::BGPHeader.

virtual void inet::bgp::BGPUpdateMessage_Base::parsimUnpack ( omnetpp::cCommBuffer *  b)
overridevirtual

Reimplemented from inet::bgp::BGPHeader.

virtual void inet::bgp::BGPUpdateMessage_Base::setNLRI ( const BGPUpdateNLRI &  NLRI)
virtual

Reimplemented in inet::bgp::BGPUpdateMessage.

virtual void inet::bgp::BGPUpdateMessage_Base::setPathAttributeList ( unsigned int  k,
const BGPUpdatePathAttributeList &  pathAttributeList 
)
virtual
virtual void inet::bgp::BGPUpdateMessage_Base::setPathAttributeListArraySize ( unsigned int  size)
virtual
virtual void inet::bgp::BGPUpdateMessage_Base::setWithdrawnRoutes ( unsigned int  k,
const BGPUpdateWithdrawnRoutes &  withdrawnRoutes 
)
virtual
virtual void inet::bgp::BGPUpdateMessage_Base::setWithdrawnRoutesArraySize ( unsigned int  size)
virtual

Reimplemented in inet::bgp::BGPUpdateMessage.

Member Data Documentation

BGPUpdateNLRI inet::bgp::BGPUpdateMessage_Base::NLRI
protected
BGPUpdatePathAttributeList* inet::bgp::BGPUpdateMessage_Base::pathAttributeList
protected
unsigned int inet::bgp::BGPUpdateMessage_Base::pathAttributeList_arraysize
protected
BGPUpdateWithdrawnRoutes* inet::bgp::BGPUpdateMessage_Base::withdrawnRoutes
protected
unsigned int inet::bgp::BGPUpdateMessage_Base::withdrawnRoutes_arraysize
protected

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