OSPF::SummaryLSA Class Reference

#include <LSA.h>

Inheritance diagram for OSPF::SummaryLSA:

OSPFSummaryLSA OSPF::RoutingInfo OSPF::LSATrackingInfo OSPFLSA 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]

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

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

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

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

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

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

00106 {}


Member Function Documentation

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

00017 {
00018     const OSPFLSAHeader& lsaHeader = summaryLSA->getHeader ();
00019     bool differentHeader = ((header_var.getLsOptions () != lsaHeader.getLsOptions ()) ||
00020                             ((header_var.getLsAge () == MAX_AGE) && (lsaHeader.getLsAge () != MAX_AGE)) ||
00021                             ((header_var.getLsAge () != MAX_AGE) && (lsaHeader.getLsAge () == MAX_AGE)) ||
00022                             (header_var.getLength () != lsaHeader.getLength ()));
00023     bool differentBody   = false;
00024 
00025     if (!differentHeader) {
00026         differentBody = ((networkMask_var != summaryLSA->getNetworkMask ()) ||
00027                          (routeCost_var != summaryLSA->getRouteCost ()) ||
00028                          (tosData_arraysize != summaryLSA->getTosDataArraySize ()));
00029 
00030         if (!differentBody) {
00031             unsigned int tosCount = tosData_arraysize;
00032             for (unsigned int i = 0; i < tosCount; i++) {
00033                 if ((tosData_var[i].tos != summaryLSA->getTosData (i).tos) ||
00034                     (tosData_var[i].tosMetric[0] != summaryLSA->getTosData (i).tosMetric[0]) ||
00035                     (tosData_var[i].tosMetric[1] != summaryLSA->getTosData (i).tosMetric[1]) ||
00036                     (tosData_var[i].tosMetric[2] != summaryLSA->getTosData (i).tosMetric[2]))
00037                 {
00038                     differentBody = true;
00039                     break;
00040                 }
00041             }
00042         }
00043     }
00044 
00045     return (differentHeader || differentBody);
00046 }

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

00108 { return purgeable; }

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

00109 { purgeable = purge; }

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

00004 {
00005     bool different = DiffersFrom (lsa);
00006     (*this) = (*lsa);
00007     ResetInstallTime ();
00008     if (different) {
00009         ClearNextHops ();
00010         return true;
00011     } else {
00012         return false;
00013     }
00014 }

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

00111 { return true; } // not implemented


Member Data Documentation

bool OSPF::SummaryLSA::purgeable [protected]


The documentation for this class was generated from the following files:
Generated on Wed Apr 4 13:20:25 2007 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.7