INET Framework for OMNeT++/OMNEST
inet::ospfv2::SummaryLsa Class Reference

#include <Lsa.h>

Inheritance diagram for inet::ospfv2::SummaryLsa:
inet::ospfv2::Ospfv2SummaryLsa inet::ospfv2::RoutingInfo inet::ospfv2::LsaTrackingInfo inet::ospfv2::Ospfv2Lsa

Public Member Functions

 SummaryLsa ()
 
 SummaryLsa (const Ospfv2SummaryLsa &lsa)
 
 SummaryLsa (const SummaryLsa &lsa)
 
virtual ~SummaryLsa ()
 
bool getPurgeable () const
 
void setPurgeable (bool purge=true)
 
bool validateLSChecksum () const
 
bool update (const Ospfv2SummaryLsa *lsa)
 
bool differsFrom (const Ospfv2SummaryLsa *summaryLSA) const
 
- Public Member Functions inherited from inet::ospfv2::Ospfv2SummaryLsa
 Ospfv2SummaryLsa ()
 
 Ospfv2SummaryLsa (const Ospfv2SummaryLsa &other)
 
virtual ~Ospfv2SummaryLsa ()
 
Ospfv2SummaryLsaoperator= (const Ospfv2SummaryLsa &other)
 
virtual Ospfv2SummaryLsadup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual const ::inet::Ipv4AddressgetNetworkMask () const
 
virtual ::inet::Ipv4AddressgetNetworkMaskForUpdate ()
 
virtual void setNetworkMask (const ::inet::Ipv4Address &networkMask)
 
virtual unsigned long getRouteCost () const
 
virtual void setRouteCost (unsigned long routeCost)
 
virtual void setTosDataArraySize (size_t size)
 
virtual size_t getTosDataArraySize () const
 
virtual const Ospfv2TosDatagetTosData (size_t k) const
 
virtual Ospfv2TosDatagetTosDataForUpdate (size_t k)
 
virtual void setTosData (size_t k, const Ospfv2TosData &tosData)
 
virtual void insertTosData (size_t k, const Ospfv2TosData &tosData)
 
void insertTosData (const Ospfv2TosData &tosData)
 
virtual void appendTosData (const Ospfv2TosData &tosData)
 
virtual void eraseTosData (size_t k)
 
- Public Member Functions inherited from inet::ospfv2::Ospfv2Lsa
 Ospfv2Lsa ()
 
 Ospfv2Lsa (const Ospfv2Lsa &other)
 
virtual ~Ospfv2Lsa ()
 
Ospfv2Lsaoperator= (const Ospfv2Lsa &other)
 
virtual const Ospfv2LsaHeadergetHeader () const
 
virtual Ospfv2LsaHeadergetHeaderForUpdate ()
 
virtual void setHeader (const Ospfv2LsaHeader &header)
 
- Public Member Functions inherited from inet::ospfv2::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 (Ospfv2Lsa *p)
 
Ospfv2LsagetParent () const
 
- Public Member Functions inherited from inet::ospfv2::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::ospfv2::Ospfv2SummaryLsa
::inet::Ipv4Address networkMask
 
unsigned long routeCost = 1
 
Ospfv2TosDatatosData = nullptr
 
size_t tosData_arraysize = 0
 
- Protected Attributes inherited from inet::ospfv2::Ospfv2Lsa
Ospfv2LsaHeader header
 

Additional Inherited Members

- Public Types inherited from inet::ospfv2::LsaTrackingInfo
enum  InstallSource { ORIGINATED = 0, FLOODED = 1 }
 
- Protected Member Functions inherited from inet::ospfv2::Ospfv2SummaryLsa
bool operator== (const Ospfv2SummaryLsa &)=delete
 
- Protected Member Functions inherited from inet::ospfv2::Ospfv2Lsa
bool operator== (const Ospfv2Lsa &)=delete
 

Constructor & Destructor Documentation

◆ SummaryLsa() [1/3]

inet::ospfv2::SummaryLsa::SummaryLsa ( )
inline

◆ SummaryLsa() [2/3]

inet::ospfv2::SummaryLsa::SummaryLsa ( const Ospfv2SummaryLsa lsa)
inline

◆ SummaryLsa() [3/3]

inet::ospfv2::SummaryLsa::SummaryLsa ( const SummaryLsa lsa)
inline
115 : Ospfv2SummaryLsa(lsa), RoutingInfo(lsa), LsaTrackingInfo(lsa), purgeable(lsa.purgeable) {}

◆ ~SummaryLsa()

virtual inet::ospfv2::SummaryLsa::~SummaryLsa ( )
inlinevirtual
116 {}

Member Function Documentation

◆ differsFrom()

bool inet::ospfv2::SummaryLsa::differsFrom ( const Ospfv2SummaryLsa summaryLSA) const
28 {
29  const Ospfv2LsaHeader& thisHeader = getHeader();
30  const Ospfv2LsaHeader& lsaHeader = summaryLSA->getHeader();
31  bool differentHeader = ((thisHeader.getLsOptions() != lsaHeader.getLsOptions()) ||
32  ((thisHeader.getLsAge() == MAX_AGE) && (lsaHeader.getLsAge() != MAX_AGE)) ||
33  ((thisHeader.getLsAge() != MAX_AGE) && (lsaHeader.getLsAge() == MAX_AGE)) ||
34  (thisHeader.getLsaLength() != lsaHeader.getLsaLength()));
35  bool differentBody = false;
36 
37  if (!differentHeader) {
38  differentBody = ((getNetworkMask() != summaryLSA->getNetworkMask()) ||
39  (getRouteCost() != summaryLSA->getRouteCost()) ||
40  (getTosDataArraySize() != summaryLSA->getTosDataArraySize()));
41 
42  if (!differentBody) {
43  unsigned int tosCount = tosData_arraysize;
44  for (unsigned int i = 0; i < tosCount; i++) {
45  auto thisTosData = getTosData(i);
46  auto lsaTosData = summaryLSA->getTosData(i);
47  if ((thisTosData.tos != summaryLSA->getTosData(i).tos) ||
48  (thisTosData.tosMetric != lsaTosData.tosMetric))
49  {
50  differentBody = true;
51  break;
52  }
53  }
54  }
55  }
56 
57  return differentHeader || differentBody;
58 }

Referenced by update().

◆ getPurgeable()

bool inet::ospfv2::SummaryLsa::getPurgeable ( ) const
inline
118 { return purgeable; }

◆ setPurgeable()

void inet::ospfv2::SummaryLsa::setPurgeable ( bool  purge = true)
inline
119 { purgeable = purge; }

◆ update()

bool inet::ospfv2::SummaryLsa::update ( const Ospfv2SummaryLsa lsa)
14 {
15  bool different = differsFrom(lsa);
16  (*this) = (*lsa);
18  if (different) {
19  clearNextHops();
20  return true;
21  }
22  else {
23  return false;
24  }
25 }

Referenced by inet::ospfv2::Ospfv2Area::ageDatabase().

◆ validateLSChecksum()

bool inet::ospfv2::SummaryLsa::validateLSChecksum ( ) const
inline
121 { return true; } // not implemented

Referenced by inet::ospfv2::Ospfv2Area::ageDatabase().

Member Data Documentation

◆ purgeable

bool inet::ospfv2::SummaryLsa::purgeable
protected

The documentation for this class was generated from the following files:
inet::ospfv2::Ospfv2SummaryLsa::getTosData
virtual const Ospfv2TosData & getTosData(size_t k) const
inet::ospfv2::Ospfv2SummaryLsa::getTosDataArraySize
virtual size_t getTosDataArraySize() const
inet::ospfv2::RoutingInfo::clearNextHops
void clearNextHops()
Definition: Lsa.h:41
MAX_AGE
#define MAX_AGE
Definition: Ospfv2Common.h:27
inet::ospfv2::SummaryLsa::purgeable
bool purgeable
Definition: Lsa.h:110
inet::ospfv2::LsaTrackingInfo::LsaTrackingInfo
LsaTrackingInfo()
Definition: Lsa.h:63
inet::ospfv2::Ospfv2SummaryLsa::Ospfv2SummaryLsa
Ospfv2SummaryLsa()
inet::ospfv2::SummaryLsa::differsFrom
bool differsFrom(const Ospfv2SummaryLsa *summaryLSA) const
Definition: SummaryLsa.cc:27
inet::ospfv2::LsaTrackingInfo::resetInstallTime
void resetInstallTime()
Definition: Lsa.h:69
inet::Ipv4Address::getNetworkMask
Ipv4Address getNetworkMask() const
Returns an address with the network mask corresponding to the address class.
Definition: Ipv4Address.cc:178
inet::ospfv2::Ospfv2SummaryLsa::getRouteCost
virtual unsigned long getRouteCost() const
inet::ospfv2::Ospfv2SummaryLsa::getNetworkMask
virtual const ::inet::Ipv4Address & getNetworkMask() const
inet::ospfv2::Ospfv2SummaryLsa::tosData_arraysize
size_t tosData_arraysize
Definition: Ospfv2Packet_m.h:681
inet::ospfv2::Ospfv2Lsa::getHeader
virtual const Ospfv2LsaHeader & getHeader() const
inet::ospfv2::RoutingInfo::RoutingInfo
RoutingInfo()
Definition: Lsa.h:36