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

#include <LSA.h>

Inheritance diagram for inet::ospf::ASExternalLSA:
inet::ospf::OSPFASExternalLSA inet::ospf::RoutingInfo inet::ospf::LSATrackingInfo inet::ospf::OSPFLSA

Public Member Functions

 ASExternalLSA ()
 
 ASExternalLSA (const OSPFASExternalLSA &lsa)
 
 ASExternalLSA (const ASExternalLSA &lsa)
 
virtual ~ASExternalLSA ()
 
bool getPurgeable () const
 
void setPurgeable (bool purge=true)
 
bool validateLSChecksum () const
 
bool update (const OSPFASExternalLSA *lsa)
 
bool differsFrom (const OSPFASExternalLSA *asExternalLSA) const
 
- Public Member Functions inherited from inet::ospf::OSPFASExternalLSA
 OSPFASExternalLSA ()
 
 OSPFASExternalLSA (const OSPFASExternalLSA &other)
 
virtual ~OSPFASExternalLSA ()
 
OSPFASExternalLSAoperator= (const OSPFASExternalLSA &other)
 
virtual OSPFASExternalLSAdup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual OSPFASExternalLSAContentsgetContents ()
 
virtual const OSPFASExternalLSAContentsgetContents () const
 
virtual void setContents (const OSPFASExternalLSAContents &contents)
 
- 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::OSPFASExternalLSA
OSPFASExternalLSAContents contents
 
- 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::OSPFASExternalLSA
bool operator== (const OSPFASExternalLSA &)
 
- Protected Member Functions inherited from inet::ospf::OSPFLSA
bool operator== (const OSPFLSA &)
 

Constructor & Destructor Documentation

inet::ospf::ASExternalLSA::ASExternalLSA ( )
inline
LSATrackingInfo()
Definition: LSA.h:74
bool purgeable
Definition: LSA.h:143
RoutingInfo()
Definition: LSA.h:47
inet::ospf::ASExternalLSA::ASExternalLSA ( const OSPFASExternalLSA lsa)
inline
LSATrackingInfo()
Definition: LSA.h:74
bool purgeable
Definition: LSA.h:143
RoutingInfo()
Definition: LSA.h:47
inet::ospf::ASExternalLSA::ASExternalLSA ( const ASExternalLSA lsa)
inline
148 : OSPFASExternalLSA(lsa), RoutingInfo(lsa), LSATrackingInfo(lsa), purgeable(lsa.purgeable) {}
LSATrackingInfo()
Definition: LSA.h:74
bool purgeable
Definition: LSA.h:143
RoutingInfo()
Definition: LSA.h:47
virtual inet::ospf::ASExternalLSA::~ASExternalLSA ( )
inlinevirtual
149 {}

Member Function Documentation

bool inet::ospf::ASExternalLSA::differsFrom ( const OSPFASExternalLSA asExternalLSA) const

Referenced by update().

39 {
40  const OSPFLSAHeader& thisHeader = getHeader();
41  const OSPFLSAHeader& lsaHeader = asExternalLSA->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  const OSPFASExternalLSAContents& thisContents = getContents();
50  const OSPFASExternalLSAContents& lsaContents = asExternalLSA->getContents();
51 
52  unsigned int thisTosInfoCount = thisContents.getExternalTOSInfoArraySize();
53 
54  differentBody = ((thisContents.getNetworkMask() != lsaContents.getNetworkMask()) ||
55  (thisContents.getE_ExternalMetricType() != lsaContents.getE_ExternalMetricType()) ||
56  (thisContents.getRouteCost() != lsaContents.getRouteCost()) ||
57  (thisContents.getForwardingAddress() != lsaContents.getForwardingAddress()) ||
58  (thisContents.getExternalRouteTag() != lsaContents.getExternalRouteTag()) ||
59  (thisTosInfoCount != lsaContents.getExternalTOSInfoArraySize()));
60 
61  if (!differentBody) {
62  for (unsigned int i = 0; i < thisTosInfoCount; i++) {
63  const ExternalTOSInfo& thisTOSInfo = thisContents.getExternalTOSInfo(i);
64  const ExternalTOSInfo& lsaTOSInfo = lsaContents.getExternalTOSInfo(i);
65 
66  if ((thisTOSInfo.tosData.tos != lsaTOSInfo.tosData.tos) ||
67  (thisTOSInfo.tosData.tosMetric[0] != lsaTOSInfo.tosData.tosMetric[0]) ||
68  (thisTOSInfo.tosData.tosMetric[1] != lsaTOSInfo.tosData.tosMetric[1]) ||
69  (thisTOSInfo.tosData.tosMetric[2] != lsaTOSInfo.tosData.tosMetric[2]) ||
70  (thisTOSInfo.E_ExternalMetricType != lsaTOSInfo.E_ExternalMetricType) ||
71  (thisTOSInfo.forwardingAddress != lsaTOSInfo.forwardingAddress) ||
72  (thisTOSInfo.externalRouteTag != lsaTOSInfo.externalRouteTag))
73  {
74  differentBody = true;
75  break;
76  }
77  }
78  }
79  }
80 
81  return differentHeader || differentBody;
82 }
virtual OSPFASExternalLSAContents & getContents()
#define MAX_AGE
Definition: OSPFcommon.h:36
virtual OSPFLSAHeader & getHeader()
bool inet::ospf::ASExternalLSA::getPurgeable ( ) const
inline

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

151 { return purgeable; }
bool purgeable
Definition: LSA.h:143
void inet::ospf::ASExternalLSA::setPurgeable ( bool  purge = true)
inline
152 { purgeable = purge; }
bool purgeable
Definition: LSA.h:143
bool inet::ospf::ASExternalLSA::update ( const OSPFASExternalLSA lsa)

Referenced by inet::ospf::Router::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 OSPFASExternalLSA *asExternalLSA) const
Definition: ASExternalLSA.cc:38
bool inet::ospf::ASExternalLSA::validateLSChecksum ( ) const
inline

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

154 { return true; } // not implemented

Member Data Documentation

bool inet::ospf::ASExternalLSA::purgeable
protected

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