OSPF::SummaryLSA Class Reference

#include <LSA.h>

Inheritance diagram for OSPF::SummaryLSA:

OSPF::RoutingInfo OSPF::LSATrackingInfo

List of all members.

Public Member Functions

 SummaryLSA (void)
 SummaryLSA (const OSPFSummaryLSA &lsa)
 SummaryLSA (const SummaryLSA &lsa)
virtual ~SummaryLSA (void)
bool GetPurgeable (void) const
void SetPurgeable (bool purge=true)
bool ValidateLSChecksum () const
bool Update (const OSPFSummaryLSA *lsa)
bool DiffersFrom (const OSPFSummaryLSA *summaryLSA) const

Protected Attributes

bool purgeable


Constructor & Destructor Documentation

OSPF::SummaryLSA::SummaryLSA ( void   )  [inline]

00120 : OSPFSummaryLSA(), RoutingInfo(), LSATrackingInfo(), purgeable(false) {}

OSPF::SummaryLSA::SummaryLSA ( const OSPFSummaryLSA &  lsa  )  [inline]

00121 : OSPFSummaryLSA(lsa), RoutingInfo(), LSATrackingInfo(), purgeable(false) {}

OSPF::SummaryLSA::SummaryLSA ( const SummaryLSA lsa  )  [inline]

00122 : OSPFSummaryLSA(lsa), RoutingInfo(lsa), LSATrackingInfo(lsa), purgeable(lsa.purgeable) {}

virtual OSPF::SummaryLSA::~SummaryLSA ( void   )  [inline, virtual]

00123 {}


Member Function Documentation

bool OSPF::SummaryLSA::GetPurgeable ( void   )  const [inline]

00125 { return purgeable; }

void OSPF::SummaryLSA::SetPurgeable ( bool  purge = true  )  [inline]

00126 { purgeable = purge; }

bool OSPF::SummaryLSA::ValidateLSChecksum (  )  const [inline]

Referenced by OSPF::Area::AgeDatabase().

00128 { return true; } // not implemented

bool OSPF::SummaryLSA::Update ( const OSPFSummaryLSA *  lsa  ) 

Referenced by OSPF::Area::AgeDatabase().

00021 {
00022     bool different = DiffersFrom(lsa);
00023     (*this) = (*lsa);
00024     ResetInstallTime();
00025     if (different) {
00026         ClearNextHops();
00027         return true;
00028     } else {
00029         return false;
00030     }
00031 }

bool OSPF::SummaryLSA::DiffersFrom ( const OSPFSummaryLSA *  summaryLSA  )  const

Referenced by Update().

00034 {
00035     const OSPFLSAHeader& lsaHeader = summaryLSA->getHeader();
00036     bool differentHeader = ((header_var.getLsOptions() != lsaHeader.getLsOptions()) ||
00037                             ((header_var.getLsAge() == MAX_AGE) && (lsaHeader.getLsAge() != MAX_AGE)) ||
00038                             ((header_var.getLsAge() != MAX_AGE) && (lsaHeader.getLsAge() == MAX_AGE)) ||
00039                             (header_var.getLsaLength() != lsaHeader.getLsaLength()));
00040     bool differentBody   = false;
00041 
00042     if (!differentHeader) {
00043         differentBody = ((networkMask_var != summaryLSA->getNetworkMask()) ||
00044                          (routeCost_var != summaryLSA->getRouteCost()) ||
00045                          (tosData_arraysize != summaryLSA->getTosDataArraySize()));
00046 
00047         if (!differentBody) {
00048             unsigned int tosCount = tosData_arraysize;
00049             for (unsigned int i = 0; i < tosCount; i++) {
00050                 if ((tosData_var[i].tos != summaryLSA->getTosData(i).tos) ||
00051                     (tosData_var[i].tosMetric[0] != summaryLSA->getTosData(i).tosMetric[0]) ||
00052                     (tosData_var[i].tosMetric[1] != summaryLSA->getTosData(i).tosMetric[1]) ||
00053                     (tosData_var[i].tosMetric[2] != summaryLSA->getTosData(i).tosMetric[2]))
00054                 {
00055                     differentBody = true;
00056                     break;
00057                 }
00058             }
00059         }
00060     }
00061 
00062     return (differentHeader || differentBody);
00063 }


Member Data Documentation

bool OSPF::SummaryLSA::purgeable [protected]

Referenced by GetPurgeable(), and SetPurgeable().


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

Generated on Fri Mar 20 18:51:23 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5