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

#include <BGPUpdate.h>

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

Public Member Functions

 BGPUpdateMessage (const char *name=nullptr, int kind=0)
 
virtual BGPUpdateMessagedup () const override
 
void setWithdrawnRoutesArraySize (unsigned int size) override
 
void setPathAttributeList (const BGPUpdatePathAttributeList &pathAttributeList_var)
 
void setNLRI (const BGPUpdateNLRI &NLRI_var) override
 
- Public Member Functions inherited from inet::bgp::BGPUpdateMessage_Base
virtual ~BGPUpdateMessage_Base ()
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual unsigned int getWithdrawnRoutesArraySize () const
 
virtual BGPUpdateWithdrawnRoutesgetWithdrawnRoutes (unsigned int k)
 
virtual const BGPUpdateWithdrawnRoutesgetWithdrawnRoutes (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 BGPUpdatePathAttributeListgetPathAttributeList (unsigned int k)
 
virtual const BGPUpdatePathAttributeListgetPathAttributeList (unsigned int k) const
 
virtual void setPathAttributeList (unsigned int k, const BGPUpdatePathAttributeList &pathAttributeList)
 
virtual BGPUpdateNLRIgetNLRI ()
 
virtual const BGPUpdateNLRIgetNLRI () const
 
- Public Member Functions inherited from inet::bgp::BGPHeader
 BGPHeader (const char *name=nullptr, short kind=0)
 
 BGPHeader (const BGPHeader &other)
 
virtual ~BGPHeader ()
 
BGPHeaderoperator= (const BGPHeader &other)
 
virtual char getType () const
 
virtual void setType (char type)
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from inet::bgp::BGPUpdateMessage_Base
BGPUpdateWithdrawnRouteswithdrawnRoutes
 
unsigned int withdrawnRoutes_arraysize
 
BGPUpdatePathAttributeListpathAttributeList
 
unsigned int pathAttributeList_arraysize
 
BGPUpdateNLRI NLRI
 
- Protected Attributes inherited from inet::bgp::BGPHeader
char type
 

Constructor & Destructor Documentation

inet::bgp::BGPUpdateMessage::BGPUpdateMessage ( const char *  name = nullptr,
int  kind = 0 
)
inline
33 : BGPUpdateMessage_Base(name, kind) {}
BGPUpdateMessage_Base(const char *name=nullptr, short kind=0)

Member Function Documentation

unsigned short inet::bgp::BGPUpdateMessage::computePathAttributesBytes ( const BGPUpdatePathAttributeList pathAttrs)
protected

Referenced by setPathAttributeList().

34 {
35  unsigned short nb_path_attr = 2 + pathAttrs.getAsPathArraySize()
36  + pathAttrs.getLocalPrefArraySize()
37  + pathAttrs.getAtomicAggregateArraySize();
38 
39  // BGPUpdatePathAttributes (4)
40  unsigned short contentBytes = nb_path_attr * 4;
41  // BGPUpdatePathAttributesOrigin (1)
42  contentBytes += 1;
43  // BGPUpdatePathAttributesASPath
44  for (unsigned int i = 0; i < pathAttrs.getAsPathArraySize(); i++)
45  contentBytes += 2 + pathAttrs.getAsPath(i).getLength(); // type (1) + length (1) + value
46  // BGPUpdatePathAttributesNextHop (4)
47  contentBytes += 4;
48  // BGPUpdatePathAttributesLocalPref (4)
49  contentBytes = 4 * pathAttrs.getLocalPrefArraySize();
50  return contentBytes;
51 }
virtual BGPUpdateMessage* inet::bgp::BGPUpdateMessage::dup ( ) const
inlineoverridevirtual

Reimplemented from inet::bgp::BGPUpdateMessage_Base.

34 { return new BGPUpdateMessage(*this); }
BGPUpdateMessage(const char *name=nullptr, int kind=0)
Definition: BGPUpdate.h:33
void inet::bgp::BGPUpdateMessage::setNLRI ( const BGPUpdateNLRI NLRI_var)
overridevirtual

Reimplemented from inet::bgp::BGPUpdateMessage_Base.

Referenced by inet::bgp::BGPRouting::updateSendProcess().

65 {
66  setByteLength(getByteLength() + 5); //5 = NLRI (length (1) + IPv4Address (4))
67  BGPUpdateMessage_Base::NLRI = NLRI_var;
68 }
BGPUpdateNLRI NLRI
Definition: BGPUpdate_m.h:211
void inet::bgp::BGPUpdateMessage::setPathAttributeList ( const BGPUpdatePathAttributeList pathAttributeList_var)

Referenced by inet::bgp::BGPRouting::updateSendProcess().

54 {
55  unsigned int old_bytes = getPathAttributeListArraySize() == 0 ? 0 : computePathAttributesBytes(getPathAttributeList(0));
56  unsigned int delta_bytes = computePathAttributesBytes(pathAttrs) - old_bytes;
57 
60 
61  setByteLength(getByteLength() + delta_bytes);
62 }
virtual void setPathAttributeListArraySize(unsigned int size)
virtual unsigned int getPathAttributeListArraySize() const
virtual void setPathAttributeList(unsigned int k, const BGPUpdatePathAttributeList &pathAttributeList)
virtual BGPUpdatePathAttributeList & getPathAttributeList(unsigned int k)
unsigned short computePathAttributesBytes(const BGPUpdatePathAttributeList &pathAttrs)
Definition: BGPUpdate.cc:33
void inet::bgp::BGPUpdateMessage::setWithdrawnRoutesArraySize ( unsigned int  size)
overridevirtual

Reimplemented from inet::bgp::BGPUpdateMessage_Base.


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