INET Framework for OMNeT++/OMNEST
inet::ospf::SummaryLSA Class Reference

#include <LSA.h>

Inheritance diagram for inet::ospf::SummaryLSA:
inet::ospf::OSPFSummaryLSA inet::ospf::RoutingInfo inet::ospf::LSATrackingInfo inet::ospf::OSPFLSA

Public Member Functions

 SummaryLSA ()
 
 SummaryLSA (const OSPFSummaryLSA &lsa)
 
 SummaryLSA (const SummaryLSA &lsa)
 
virtual ~SummaryLSA ()
 
bool getPurgeable () const
 
void setPurgeable (bool purge=true)
 
bool validateLSChecksum () const
 
bool update (const OSPFSummaryLSA *lsa)
 
bool differsFrom (const OSPFSummaryLSA *summaryLSA) const
 
- Public Member Functions inherited from inet::ospf::OSPFSummaryLSA
 OSPFSummaryLSA ()
 
 OSPFSummaryLSA (const OSPFSummaryLSA &other)
 
virtual ~OSPFSummaryLSA ()
 
OSPFSummaryLSAoperator= (const OSPFSummaryLSA &other)
 
virtual OSPFSummaryLSAdup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual IPv4AddressgetNetworkMask ()
 
virtual const IPv4AddressgetNetworkMask () const
 
virtual void setNetworkMask (const IPv4Address &networkMask)
 
virtual unsigned long getRouteCost () const
 
virtual void setRouteCost (unsigned long routeCost)
 
virtual void setTosDataArraySize (unsigned int size)
 
virtual unsigned int getTosDataArraySize () const
 
virtual TOSDatagetTosData (unsigned int k)
 
virtual const TOSDatagetTosData (unsigned int k) const
 
virtual void setTosData (unsigned int k, const TOSData &tosData)
 
- Public Member Functions inherited from inet::ospf::OSPFLSA
 OSPFLSA ()
 
 OSPFLSA (const OSPFLSA &other)
 
virtual ~OSPFLSA ()
 
OSPFLSAoperator= (const OSPFLSA &other)
 
virtual OSPFLSAHeadergetHeader ()
 
virtual const OSPFLSAHeadergetHeader () const
 
virtual void setHeader (const OSPFLSAHeader &header)
 
- Public Member Functions inherited from inet::ospf::RoutingInfo
 RoutingInfo ()
 
 RoutingInfo (const RoutingInfo &routingInfo)
 
virtual ~RoutingInfo ()
 
void addNextHop (NextHop nextHop)
 
void clearNextHops ()
 
unsigned int getNextHopCount () const
 
NextHop getNextHop (unsigned int index) const
 
void setDistance (unsigned long d)
 
unsigned long getDistance () const
 
void setParent (OSPFLSA *p)
 
OSPFLSAgetParent () const
 
- Public Member Functions inherited from inet::ospf::LSATrackingInfo
 LSATrackingInfo ()
 
 LSATrackingInfo (const LSATrackingInfo &info)
 
void setSource (InstallSource installSource)
 
InstallSource getSource () const
 
void incrementInstallTime ()
 
void resetInstallTime ()
 
unsigned long getInstallTime () const
 

Protected Attributes

bool purgeable
 
- Protected Attributes inherited from inet::ospf::OSPFSummaryLSA
IPv4Address networkMask
 
unsigned long routeCost
 
TOSDatatosData
 
unsigned int tosData_arraysize
 
- Protected Attributes inherited from inet::ospf::OSPFLSA
OSPFLSAHeader header
 

Additional Inherited Members

- Public Types inherited from inet::ospf::LSATrackingInfo
enum  InstallSource { ORIGINATED = 0, FLOODED = 1 }
 
- Protected Member Functions inherited from inet::ospf::OSPFSummaryLSA
bool operator== (const OSPFSummaryLSA &)
 
- Protected Member Functions inherited from inet::ospf::OSPFLSA
bool operator== (const OSPFLSA &)
 

Constructor & Destructor Documentation

inet::ospf::SummaryLSA::SummaryLSA ( )
inline
LSATrackingInfo()
Definition: LSA.h:74
bool purgeable
Definition: LSA.h:121
RoutingInfo()
Definition: LSA.h:47
inet::ospf::SummaryLSA::SummaryLSA ( const OSPFSummaryLSA lsa)
inline
125 : OSPFSummaryLSA(lsa), RoutingInfo(), LSATrackingInfo(), purgeable(false) {}
LSATrackingInfo()
Definition: LSA.h:74
bool purgeable
Definition: LSA.h:121
RoutingInfo()
Definition: LSA.h:47
inet::ospf::SummaryLSA::SummaryLSA ( const SummaryLSA lsa)
inline
126 : OSPFSummaryLSA(lsa), RoutingInfo(lsa), LSATrackingInfo(lsa), purgeable(lsa.purgeable) {}
LSATrackingInfo()
Definition: LSA.h:74
bool purgeable
Definition: LSA.h:121
RoutingInfo()
Definition: LSA.h:47
virtual inet::ospf::SummaryLSA::~SummaryLSA ( )
inlinevirtual
127 {}

Member Function Documentation

bool inet::ospf::SummaryLSA::differsFrom ( const OSPFSummaryLSA summaryLSA) const

Referenced by update().

39 {
40  const OSPFLSAHeader& thisHeader = getHeader();
41  const OSPFLSAHeader& lsaHeader = summaryLSA->getHeader();
42  bool differentHeader = ((thisHeader.getLsOptions() != lsaHeader.getLsOptions()) ||
43  ((thisHeader.getLsAge() == MAX_AGE) && (lsaHeader.getLsAge() != MAX_AGE)) ||
44  ((thisHeader.getLsAge() != MAX_AGE) && (lsaHeader.getLsAge() == MAX_AGE)) ||
45  (thisHeader.getLsaLength() != lsaHeader.getLsaLength()));
46  bool differentBody = false;
47 
48  if (!differentHeader) {
49  differentBody = ((getNetworkMask() != summaryLSA->getNetworkMask()) ||
50  (getRouteCost() != summaryLSA->getRouteCost()) ||
51  (getTosDataArraySize() != summaryLSA->getTosDataArraySize()));
52 
53  if (!differentBody) {
54  unsigned int tosCount = tosData_arraysize;
55  for (unsigned int i = 0; i < tosCount; i++) {
56  auto thisTosData = getTosData(i);
57  auto lsaTosData = summaryLSA->getTosData(i);
58  if ((thisTosData.tos != summaryLSA->getTosData(i).tos) ||
59  (thisTosData.tosMetric[0] != lsaTosData.tosMetric[0]) ||
60  (thisTosData.tosMetric[1] != lsaTosData.tosMetric[1]) ||
61  (thisTosData.tosMetric[2] != lsaTosData.tosMetric[2]))
62  {
63  differentBody = true;
64  break;
65  }
66  }
67  }
68  }
69 
70  return differentHeader || differentBody;
71 }
virtual IPv4Address & getNetworkMask()
virtual TOSData & getTosData(unsigned int k)
virtual unsigned int getTosDataArraySize() const
#define MAX_AGE
Definition: OSPFcommon.h:36
IPv4Address getNetworkMask() const
Returns an address with the network mask corresponding to the address class.
Definition: IPv4Address.cc:189
virtual unsigned long getRouteCost() const
unsigned int tosData_arraysize
Definition: OSPFPacket_m.h:593
virtual OSPFLSAHeader & getHeader()
bool inet::ospf::SummaryLSA::getPurgeable ( ) const
inline
129 { return purgeable; }
bool purgeable
Definition: LSA.h:121
void inet::ospf::SummaryLSA::setPurgeable ( bool  purge = true)
inline
130 { purgeable = purge; }
bool purgeable
Definition: LSA.h:121
bool inet::ospf::SummaryLSA::update ( const OSPFSummaryLSA lsa)

Referenced by inet::ospf::Area::ageDatabase().

25 {
26  bool different = differsFrom(lsa);
27  (*this) = (*lsa);
29  if (different) {
30  clearNextHops();
31  return true;
32  }
33  else {
34  return false;
35  }
36 }
void resetInstallTime()
Definition: LSA.h:80
void clearNextHops()
Definition: LSA.h:52
bool differsFrom(const OSPFSummaryLSA *summaryLSA) const
Definition: SummaryLSA.cc:38
bool inet::ospf::SummaryLSA::validateLSChecksum ( ) const
inline

Referenced by inet::ospf::Area::ageDatabase().

132 { return true; } // not implemented

Member Data Documentation

bool inet::ospf::SummaryLSA::purgeable
protected

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