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

#include <Lsa.h>

Inheritance diagram for inet::ospfv2::NetworkLsa:
inet::ospfv2::Ospfv2NetworkLsa inet::ospfv2::RoutingInfo inet::ospfv2::LsaTrackingInfo inet::ospfv2::Ospfv2Lsa

Public Member Functions

 NetworkLsa ()
 
 NetworkLsa (const Ospfv2NetworkLsa &lsa)
 
 NetworkLsa (const NetworkLsa &lsa)
 
virtual ~NetworkLsa ()
 
bool validateLSChecksum () const
 
bool update (const Ospfv2NetworkLsa *lsa)
 
bool differsFrom (const Ospfv2NetworkLsa *networkLSA) const
 
- Public Member Functions inherited from inet::ospfv2::Ospfv2NetworkLsa
 Ospfv2NetworkLsa ()
 
 Ospfv2NetworkLsa (const Ospfv2NetworkLsa &other)
 
virtual ~Ospfv2NetworkLsa ()
 
Ospfv2NetworkLsaoperator= (const Ospfv2NetworkLsa &other)
 
virtual Ospfv2NetworkLsadup () 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 void setAttachedRoutersArraySize (size_t size)
 
virtual size_t getAttachedRoutersArraySize () const
 
virtual const ::inet::Ipv4AddressgetAttachedRouters (size_t k) const
 
virtual ::inet::Ipv4AddressgetAttachedRoutersForUpdate (size_t k)
 
virtual void setAttachedRouters (size_t k, const ::inet::Ipv4Address &attachedRouters)
 
virtual void insertAttachedRouters (size_t k, const ::inet::Ipv4Address &attachedRouters)
 
void insertAttachedRouters (const ::inet::Ipv4Address &attachedRouters)
 
virtual void appendAttachedRouters (const ::inet::Ipv4Address &attachedRouters)
 
virtual void eraseAttachedRouters (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
 

Additional Inherited Members

- Public Types inherited from inet::ospfv2::LsaTrackingInfo
enum  InstallSource { ORIGINATED = 0, FLOODED = 1 }
 
- Protected Member Functions inherited from inet::ospfv2::Ospfv2NetworkLsa
bool operator== (const Ospfv2NetworkLsa &)=delete
 
- Protected Member Functions inherited from inet::ospfv2::Ospfv2Lsa
bool operator== (const Ospfv2Lsa &)=delete
 
- Protected Attributes inherited from inet::ospfv2::Ospfv2NetworkLsa
::inet::Ipv4Address networkMask
 
::inet::Ipv4AddressattachedRouters = nullptr
 
size_t attachedRouters_arraysize = 0
 
- Protected Attributes inherited from inet::ospfv2::Ospfv2Lsa
Ospfv2LsaHeader header
 

Constructor & Destructor Documentation

◆ NetworkLsa() [1/3]

inet::ospfv2::NetworkLsa::NetworkLsa ( )
inline

◆ NetworkLsa() [2/3]

inet::ospfv2::NetworkLsa::NetworkLsa ( const Ospfv2NetworkLsa lsa)
inline

◆ NetworkLsa() [3/3]

inet::ospfv2::NetworkLsa::NetworkLsa ( const NetworkLsa lsa)
inline
96 : Ospfv2NetworkLsa(lsa), RoutingInfo(lsa), LsaTrackingInfo(lsa) {}

◆ ~NetworkLsa()

virtual inet::ospfv2::NetworkLsa::~NetworkLsa ( )
inlinevirtual
97 {}

Member Function Documentation

◆ differsFrom()

bool inet::ospfv2::NetworkLsa::differsFrom ( const Ospfv2NetworkLsa networkLSA) const
28 {
29  const Ospfv2LsaHeader& thisHeader = getHeader();
30  const Ospfv2LsaHeader& lsaHeader = networkLSA->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() != networkLSA->getNetworkMask()) ||
39  (getAttachedRoutersArraySize() != networkLSA->getAttachedRoutersArraySize()));
40 
41  if (!differentBody) {
42  unsigned int routerCount = attachedRouters_arraysize;
43  for (unsigned int i = 0; i < routerCount; i++) {
44  if (getAttachedRouters(i) != networkLSA->getAttachedRouters(i)) {
45  differentBody = true;
46  break;
47  }
48  }
49  }
50  }
51 
52  return differentHeader || differentBody;
53 }

Referenced by update().

◆ update()

bool inet::ospfv2::NetworkLsa::update ( const Ospfv2NetworkLsa 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(), and inet::ospfv2::NeighborState::updateLsa().

◆ validateLSChecksum()

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

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


The documentation for this class was generated from the following files:
inet::ospfv2::Ospfv2NetworkLsa::Ospfv2NetworkLsa
Ospfv2NetworkLsa()
inet::ospfv2::Ospfv2NetworkLsa::getAttachedRouters
virtual const ::inet::Ipv4Address & getAttachedRouters(size_t k) const
inet::ospfv2::NetworkLsa::differsFrom
bool differsFrom(const Ospfv2NetworkLsa *networkLSA) const
Definition: NetworkLsa.cc:27
inet::ospfv2::RoutingInfo::clearNextHops
void clearNextHops()
Definition: Lsa.h:41
MAX_AGE
#define MAX_AGE
Definition: Ospfv2Common.h:27
inet::ospfv2::Ospfv2NetworkLsa::getAttachedRoutersArraySize
virtual size_t getAttachedRoutersArraySize() const
inet::ospfv2::LsaTrackingInfo::LsaTrackingInfo
LsaTrackingInfo()
Definition: Lsa.h:63
inet::ospfv2::Ospfv2NetworkLsa::attachedRouters_arraysize
size_t attachedRouters_arraysize
Definition: Ospfv2Packet_m.h:625
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::Ospfv2Lsa::getHeader
virtual const Ospfv2LsaHeader & getHeader() const
inet::ospfv2::Ospfv2NetworkLsa::getNetworkMask
virtual const ::inet::Ipv4Address & getNetworkMask() const
inet::ospfv2::RoutingInfo::RoutingInfo
RoutingInfo()
Definition: Lsa.h:36