OSPF::ASExternalLSA Class Reference

#include <LSA.h>

Inheritance diagram for OSPF::ASExternalLSA:

OSPF::RoutingInfo OSPF::LSATrackingInfo

List of all members.

Public Member Functions

 ASExternalLSA (void)
 ASExternalLSA (const OSPFASExternalLSA &lsa)
 ASExternalLSA (const ASExternalLSA &lsa)
virtual ~ASExternalLSA (void)
bool GetPurgeable (void) const
void SetPurgeable (bool purge=true)
bool ValidateLSChecksum () const
bool Update (const OSPFASExternalLSA *lsa)
bool DiffersFrom (const OSPFASExternalLSA *asExternalLSA) const

Protected Attributes

bool purgeable


Constructor & Destructor Documentation

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

00141 : OSPFASExternalLSA(), RoutingInfo(), LSATrackingInfo(), purgeable(false) {}

OSPF::ASExternalLSA::ASExternalLSA ( const OSPFASExternalLSA &  lsa  )  [inline]

00142 : OSPFASExternalLSA(lsa), RoutingInfo(), LSATrackingInfo(), purgeable(false) {}

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

00143 : OSPFASExternalLSA(lsa), RoutingInfo(lsa), LSATrackingInfo(lsa), purgeable(lsa.purgeable) {}

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

00144 {}


Member Function Documentation

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

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

00146 { return purgeable; }

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

00147 { purgeable = purge; }

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

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

00149 { return true; } // not implemented

bool OSPF::ASExternalLSA::Update ( const OSPFASExternalLSA *  lsa  ) 

Referenced by OSPF::Router::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::ASExternalLSA::DiffersFrom ( const OSPFASExternalLSA *  asExternalLSA  )  const

Referenced by Update().

00034 {
00035     const OSPFLSAHeader& lsaHeader = asExternalLSA->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         const OSPFASExternalLSAContents& lsaContents  = asExternalLSA->getContents();
00044         unsigned int                     tosInfoCount = contents_var.getExternalTOSInfoArraySize();
00045 
00046         differentBody = ((contents_var.getNetworkMask() != lsaContents.getNetworkMask()) ||
00047                          (contents_var.getE_ExternalMetricType() != lsaContents.getE_ExternalMetricType()) ||
00048                          (contents_var.getRouteCost() != lsaContents.getRouteCost()) ||
00049                          (contents_var.getForwardingAddress() != lsaContents.getForwardingAddress()) ||
00050                          (contents_var.getExternalRouteTag() != lsaContents.getExternalRouteTag()) ||
00051                          (tosInfoCount != lsaContents.getExternalTOSInfoArraySize()));
00052 
00053         if (!differentBody) {
00054             for (unsigned int i = 0; i < tosInfoCount; i++) {
00055                 const ExternalTOSInfo& currentTOSInfo = contents_var.getExternalTOSInfo(i);
00056                 const ExternalTOSInfo& lsaTOSInfo     = lsaContents.getExternalTOSInfo(i);
00057 
00058                 if ((currentTOSInfo.tosData.tos != lsaTOSInfo.tosData.tos) ||
00059                     (currentTOSInfo.tosData.tosMetric[0] != lsaTOSInfo.tosData.tosMetric[0]) ||
00060                     (currentTOSInfo.tosData.tosMetric[1] != lsaTOSInfo.tosData.tosMetric[1]) ||
00061                     (currentTOSInfo.tosData.tosMetric[2] != lsaTOSInfo.tosData.tosMetric[2]) ||
00062                     (currentTOSInfo.E_ExternalMetricType != lsaTOSInfo.E_ExternalMetricType) ||
00063                     (currentTOSInfo.forwardingAddress != lsaTOSInfo.forwardingAddress) ||
00064                     (currentTOSInfo.externalRouteTag != lsaTOSInfo.externalRouteTag))
00065                 {
00066                     differentBody = true;
00067                     break;
00068                 }
00069             }
00070         }
00071     }
00072 
00073     return (differentHeader || differentBody);
00074 }


Member Data Documentation

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