#include <LSA.h>
Inheritance diagram for OSPF::ASExternalLSA:
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 |
OSPF::ASExternalLSA::ASExternalLSA | ( | void | ) | [inline] |
OSPF::ASExternalLSA::ASExternalLSA | ( | const OSPFASExternalLSA & | lsa | ) | [inline] |
OSPF::ASExternalLSA::ASExternalLSA | ( | const ASExternalLSA & | lsa | ) | [inline] |
00126 : OSPFASExternalLSA (lsa), RoutingInfo (lsa), LSATrackingInfo (lsa), purgeable (lsa.purgeable) {}
bool OSPF::ASExternalLSA::DiffersFrom | ( | const OSPFASExternalLSA * | asExternalLSA | ) | const |
00017 { 00018 const OSPFLSAHeader& lsaHeader = asExternalLSA->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 const OSPFASExternalLSAContents& lsaContents = asExternalLSA->getContents (); 00027 unsigned int tosInfoCount = contents_var.getExternalTOSInfoArraySize (); 00028 00029 differentBody = ((contents_var.getNetworkMask () != lsaContents.getNetworkMask ()) || 00030 (contents_var.getE_ExternalMetricType () != lsaContents.getE_ExternalMetricType ()) || 00031 (contents_var.getRouteCost () != lsaContents.getRouteCost ()) || 00032 (contents_var.getForwardingAddress () != lsaContents.getForwardingAddress ()) || 00033 (contents_var.getExternalRouteTag () != lsaContents.getExternalRouteTag ()) || 00034 (tosInfoCount != lsaContents.getExternalTOSInfoArraySize ())); 00035 00036 if (!differentBody) { 00037 for (unsigned int i = 0; i < tosInfoCount; i++) { 00038 const ExternalTOSInfo& currentTOSInfo = contents_var.getExternalTOSInfo (i); 00039 const ExternalTOSInfo& lsaTOSInfo = lsaContents.getExternalTOSInfo (i); 00040 00041 if ((currentTOSInfo.tosData.tos != lsaTOSInfo.tosData.tos) || 00042 (currentTOSInfo.tosData.tosMetric[0] != lsaTOSInfo.tosData.tosMetric[0]) || 00043 (currentTOSInfo.tosData.tosMetric[1] != lsaTOSInfo.tosData.tosMetric[1]) || 00044 (currentTOSInfo.tosData.tosMetric[2] != lsaTOSInfo.tosData.tosMetric[2]) || 00045 (currentTOSInfo.E_ExternalMetricType != lsaTOSInfo.E_ExternalMetricType) || 00046 (currentTOSInfo.forwardingAddress != lsaTOSInfo.forwardingAddress) || 00047 (currentTOSInfo.externalRouteTag != lsaTOSInfo.externalRouteTag)) 00048 { 00049 differentBody = true; 00050 break; 00051 } 00052 } 00053 } 00054 } 00055 00056 return (differentHeader || differentBody); 00057 }
bool OSPF::ASExternalLSA::GetPurgeable | ( | void | ) | const [inline] |
void OSPF::ASExternalLSA::SetPurgeable | ( | bool | purge = true |
) | [inline] |
bool OSPF::ASExternalLSA::Update | ( | const OSPFASExternalLSA * | 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::ASExternalLSA::ValidateLSChecksum | ( | ) | const [inline] |
bool OSPF::ASExternalLSA::purgeable [protected] |