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

#include <Lsa.h>

Inheritance diagram for inet::ospfv2::AsExternalLsa:
inet::ospfv2::Ospfv2AsExternalLsa inet::ospfv2::RoutingInfo inet::ospfv2::LsaTrackingInfo inet::ospfv2::Ospfv2Lsa

Public Member Functions

 AsExternalLsa ()
 
 AsExternalLsa (const Ospfv2AsExternalLsa &lsa)
 
 AsExternalLsa (const AsExternalLsa &lsa)
 
virtual ~AsExternalLsa ()
 
bool getPurgeable () const
 
void setPurgeable (bool purge=true)
 
bool validateLSChecksum () const
 
bool update (const Ospfv2AsExternalLsa *lsa)
 
bool differsFrom (const Ospfv2AsExternalLsa *asExternalLSA) const
 
- Public Member Functions inherited from inet::ospfv2::Ospfv2AsExternalLsa
 Ospfv2AsExternalLsa ()
 
 Ospfv2AsExternalLsa (const Ospfv2AsExternalLsa &other)
 
virtual ~Ospfv2AsExternalLsa ()
 
Ospfv2AsExternalLsaoperator= (const Ospfv2AsExternalLsa &other)
 
virtual Ospfv2AsExternalLsadup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual const Ospfv2AsExternalLsaContentsgetContents () const
 
virtual Ospfv2AsExternalLsaContentsgetContentsForUpdate ()
 
virtual void setContents (const Ospfv2AsExternalLsaContents &contents)
 
- 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::Ospfv2AsExternalLsa
Ospfv2AsExternalLsaContents contents
 
- 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::Ospfv2AsExternalLsa
bool operator== (const Ospfv2AsExternalLsa &)=delete
 
- Protected Member Functions inherited from inet::ospfv2::Ospfv2Lsa
bool operator== (const Ospfv2Lsa &)=delete
 

Constructor & Destructor Documentation

◆ AsExternalLsa() [1/3]

inet::ospfv2::AsExternalLsa::AsExternalLsa ( )
inline

◆ AsExternalLsa() [2/3]

inet::ospfv2::AsExternalLsa::AsExternalLsa ( const Ospfv2AsExternalLsa lsa)
inline

◆ AsExternalLsa() [3/3]

inet::ospfv2::AsExternalLsa::AsExternalLsa ( const AsExternalLsa lsa)
inline
137 : Ospfv2AsExternalLsa(lsa), RoutingInfo(lsa), LsaTrackingInfo(lsa), purgeable(lsa.purgeable) {}

◆ ~AsExternalLsa()

virtual inet::ospfv2::AsExternalLsa::~AsExternalLsa ( )
inlinevirtual
138 {}

Member Function Documentation

◆ differsFrom()

bool inet::ospfv2::AsExternalLsa::differsFrom ( const Ospfv2AsExternalLsa asExternalLSA) const
24 {
25  const Ospfv2LsaHeader& thisHeader = getHeader();
26  const Ospfv2LsaHeader& lsaHeader = asExternalLSA->getHeader();
27  bool differentHeader = ((thisHeader.getLsOptions() != lsaHeader.getLsOptions()) ||
28  ((thisHeader.getLsAge() == MAX_AGE) && (lsaHeader.getLsAge() != MAX_AGE)) ||
29  ((thisHeader.getLsAge() != MAX_AGE) && (lsaHeader.getLsAge() == MAX_AGE)) ||
30  (thisHeader.getLsaLength() != lsaHeader.getLsaLength()));
31  bool differentBody = false;
32 
33  if (!differentHeader) {
34  const Ospfv2AsExternalLsaContents& thisContents = getContents();
35  const Ospfv2AsExternalLsaContents& lsaContents = asExternalLSA->getContents();
36 
37  unsigned int thisTosInfoCount = thisContents.getExternalTOSInfoArraySize();
38 
39  differentBody = ((thisContents.getNetworkMask() != lsaContents.getNetworkMask()) ||
40  (thisTosInfoCount != lsaContents.getExternalTOSInfoArraySize()));
41 
42  if (!differentBody) {
43  for (unsigned int i = 0; i < thisTosInfoCount; i++) {
44  const auto& thisTOSInfo = thisContents.getExternalTOSInfo(i);
45  const auto& lsaTOSInfo = lsaContents.getExternalTOSInfo(i);
46 
47  if ((thisTOSInfo.E_ExternalMetricType != lsaTOSInfo.E_ExternalMetricType) ||
48  (thisTOSInfo.routeCost != lsaTOSInfo.routeCost) ||
49  (thisTOSInfo.forwardingAddress != lsaTOSInfo.forwardingAddress) ||
50  (thisTOSInfo.externalRouteTag != lsaTOSInfo.externalRouteTag) ||
51  (thisTOSInfo.tos != lsaTOSInfo.tos))
52  {
53  differentBody = true;
54  break;
55  }
56  }
57  }
58  }
59 
60  return differentHeader || differentBody;
61 }

Referenced by update().

◆ getPurgeable()

bool inet::ospfv2::AsExternalLsa::getPurgeable ( ) const
inline
140 { return purgeable; }

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

◆ setPurgeable()

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

◆ update()

bool inet::ospfv2::AsExternalLsa::update ( const Ospfv2AsExternalLsa lsa)
13 {
14  bool different = differsFrom(lsa);
15  (*this) = (*lsa);
17  if (different) {
18  clearNextHops();
19  }
20  return different;
21 }

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

◆ validateLSChecksum()

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

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

Member Data Documentation

◆ purgeable

bool inet::ospfv2::AsExternalLsa::purgeable
protected

The documentation for this class was generated from the following files:
inet::ospfv2::RoutingInfo::clearNextHops
void clearNextHops()
Definition: Lsa.h:41
MAX_AGE
#define MAX_AGE
Definition: Ospfv2Common.h:27
inet::ospfv2::LsaTrackingInfo::LsaTrackingInfo
LsaTrackingInfo()
Definition: Lsa.h:63
inet::ospfv2::Ospfv2AsExternalLsa::getContents
virtual const Ospfv2AsExternalLsaContents & getContents() const
inet::ospfv2::LsaTrackingInfo::resetInstallTime
void resetInstallTime()
Definition: Lsa.h:69
inet::ospfv2::Ospfv2AsExternalLsa::Ospfv2AsExternalLsa
Ospfv2AsExternalLsa()
inet::ospfv2::AsExternalLsa::differsFrom
bool differsFrom(const Ospfv2AsExternalLsa *asExternalLSA) const
Definition: AsExternalLsa.cc:23
inet::ospfv2::AsExternalLsa::purgeable
bool purgeable
Definition: Lsa.h:132
inet::ospfv2::Ospfv2Lsa::getHeader
virtual const Ospfv2LsaHeader & getHeader() const
inet::ospfv2::RoutingInfo::RoutingInfo
RoutingInfo()
Definition: Lsa.h:36