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

#include <LSA.h>

Inheritance diagram for inet::ospf::NetworkLSA:
inet::ospf::OSPFNetworkLSA inet::ospf::RoutingInfo inet::ospf::LSATrackingInfo inet::ospf::OSPFLSA

Public Member Functions

 NetworkLSA ()
 
 NetworkLSA (const OSPFNetworkLSA &lsa)
 
 NetworkLSA (const NetworkLSA &lsa)
 
virtual ~NetworkLSA ()
 
bool validateLSChecksum () const
 
bool update (const OSPFNetworkLSA *lsa)
 
bool differsFrom (const OSPFNetworkLSA *networkLSA) const
 
- Public Member Functions inherited from inet::ospf::OSPFNetworkLSA
 OSPFNetworkLSA ()
 
 OSPFNetworkLSA (const OSPFNetworkLSA &other)
 
virtual ~OSPFNetworkLSA ()
 
OSPFNetworkLSAoperator= (const OSPFNetworkLSA &other)
 
virtual OSPFNetworkLSAdup () 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 void setAttachedRoutersArraySize (unsigned int size)
 
virtual unsigned int getAttachedRoutersArraySize () const
 
virtual IPv4AddressgetAttachedRouters (unsigned int k)
 
virtual const IPv4AddressgetAttachedRouters (unsigned int k) const
 
virtual void setAttachedRouters (unsigned int k, const IPv4Address &attachedRouters)
 
- 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
 

Additional Inherited Members

- Public Types inherited from inet::ospf::LSATrackingInfo
enum  InstallSource { ORIGINATED = 0, FLOODED = 1 }
 
- Protected Member Functions inherited from inet::ospf::OSPFNetworkLSA
bool operator== (const OSPFNetworkLSA &)
 
- Protected Member Functions inherited from inet::ospf::OSPFLSA
bool operator== (const OSPFLSA &)
 
- Protected Attributes inherited from inet::ospf::OSPFNetworkLSA
IPv4Address networkMask
 
IPv4AddressattachedRouters
 
unsigned int attachedRouters_arraysize
 
- Protected Attributes inherited from inet::ospf::OSPFLSA
OSPFLSAHeader header
 

Constructor & Destructor Documentation

inet::ospf::NetworkLSA::NetworkLSA ( )
inline
LSATrackingInfo()
Definition: LSA.h:74
RoutingInfo()
Definition: LSA.h:47
inet::ospf::NetworkLSA::NetworkLSA ( const OSPFNetworkLSA lsa)
inline
LSATrackingInfo()
Definition: LSA.h:74
RoutingInfo()
Definition: LSA.h:47
inet::ospf::NetworkLSA::NetworkLSA ( const NetworkLSA lsa)
inline
107 : OSPFNetworkLSA(lsa), RoutingInfo(lsa), LSATrackingInfo(lsa) {}
LSATrackingInfo()
Definition: LSA.h:74
RoutingInfo()
Definition: LSA.h:47
virtual inet::ospf::NetworkLSA::~NetworkLSA ( )
inlinevirtual
108 {}

Member Function Documentation

bool inet::ospf::NetworkLSA::differsFrom ( const OSPFNetworkLSA networkLSA) const

Referenced by update().

39 {
40  const OSPFLSAHeader& thisHeader = getHeader();
41  const OSPFLSAHeader& lsaHeader = networkLSA->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() != networkLSA->getNetworkMask()) ||
50  (getAttachedRoutersArraySize() != networkLSA->getAttachedRoutersArraySize()));
51 
52  if (!differentBody) {
53  unsigned int routerCount = attachedRouters_arraysize;
54  for (unsigned int i = 0; i < routerCount; i++) {
55  if (getAttachedRouters(i) != networkLSA->getAttachedRouters(i)) {
56  differentBody = true;
57  break;
58  }
59  }
60  }
61  }
62 
63  return differentHeader || differentBody;
64 }
virtual IPv4Address & getAttachedRouters(unsigned int k)
unsigned int attachedRouters_arraysize
Definition: OSPFPacket_m.h:541
virtual IPv4Address & getNetworkMask()
#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 int getAttachedRoutersArraySize() const
virtual OSPFLSAHeader & getHeader()
bool inet::ospf::NetworkLSA::update ( const OSPFNetworkLSA lsa)

Referenced by inet::ospf::Area::ageDatabase(), and inet::ospf::NeighborState::changeState().

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
bool differsFrom(const OSPFNetworkLSA *networkLSA) const
Definition: NetworkLSA.cc:38
void clearNextHops()
Definition: LSA.h:52
bool inet::ospf::NetworkLSA::validateLSChecksum ( ) const
inline

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

110 { return true; } // not implemented

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