|
INET Framework for OMNeT++/OMNEST
|
#include <AnsaLSA.h>
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 |
| AnsaOSPF::ASExternalLSA::ASExternalLSA | ( | void | ) | [inline] |
Definition at line 124 of file AnsaLSA.h.
: OSPFASExternalLSA(), RoutingInfo(), LSATrackingInfo(), purgeable(false) {}
| AnsaOSPF::ASExternalLSA::ASExternalLSA | ( | const OSPFASExternalLSA & | lsa | ) | [inline] |
Definition at line 125 of file AnsaLSA.h.
: OSPFASExternalLSA(lsa), RoutingInfo(), LSATrackingInfo(), purgeable(false) {}
| AnsaOSPF::ASExternalLSA::ASExternalLSA | ( | const ASExternalLSA & | lsa | ) | [inline] |
Definition at line 126 of file AnsaLSA.h.
: OSPFASExternalLSA(lsa), RoutingInfo(lsa), LSATrackingInfo(lsa), purgeable(lsa.purgeable) {}
| virtual AnsaOSPF::ASExternalLSA::~ASExternalLSA | ( | void | ) | [inline, virtual] |
| bool AnsaOSPF::ASExternalLSA::DiffersFrom | ( | const OSPFASExternalLSA * | asExternalLSA | ) | const |
Definition at line 16 of file AnsaASExternalLSA.cc.
Referenced by Update().
{
const OSPFLSAHeader& lsaHeader = asExternalLSA->getHeader();
bool differentHeader = ((header_var.getLsOptions() != lsaHeader.getLsOptions()) ||
((header_var.getLsAge() == MAX_AGE) && (lsaHeader.getLsAge() != MAX_AGE)) ||
((header_var.getLsAge() != MAX_AGE) && (lsaHeader.getLsAge() == MAX_AGE)) ||
(header_var.getLsaLength() != lsaHeader.getLsaLength()));
bool differentBody = false;
if (!differentHeader) {
const OSPFASExternalLSAContents& lsaContents = asExternalLSA->getContents();
unsigned int tosInfoCount = contents_var.getExternalTOSInfoArraySize();
differentBody = ((contents_var.getNetworkMask() != lsaContents.getNetworkMask()) ||
(contents_var.getE_ExternalMetricType() != lsaContents.getE_ExternalMetricType()) ||
(contents_var.getRouteCost() != lsaContents.getRouteCost()) ||
(contents_var.getForwardingAddress() != lsaContents.getForwardingAddress()) ||
(contents_var.getExternalRouteTag() != lsaContents.getExternalRouteTag()) ||
(tosInfoCount != lsaContents.getExternalTOSInfoArraySize()));
if (!differentBody) {
for (unsigned int i = 0; i < tosInfoCount; i++) {
const ExternalTOSInfo& currentTOSInfo = contents_var.getExternalTOSInfo(i);
const ExternalTOSInfo& lsaTOSInfo = lsaContents.getExternalTOSInfo(i);
if ((currentTOSInfo.tosData.tos != lsaTOSInfo.tosData.tos) ||
(currentTOSInfo.tosData.tosMetric[0] != lsaTOSInfo.tosData.tosMetric[0]) ||
(currentTOSInfo.tosData.tosMetric[1] != lsaTOSInfo.tosData.tosMetric[1]) ||
(currentTOSInfo.tosData.tosMetric[2] != lsaTOSInfo.tosData.tosMetric[2]) ||
(currentTOSInfo.E_ExternalMetricType != lsaTOSInfo.E_ExternalMetricType) ||
(currentTOSInfo.forwardingAddress != lsaTOSInfo.forwardingAddress) ||
(currentTOSInfo.externalRouteTag != lsaTOSInfo.externalRouteTag))
{
differentBody = true;
break;
}
}
}
}
return (differentHeader || differentBody);
}
| bool AnsaOSPF::ASExternalLSA::GetPurgeable | ( | void | ) | const [inline] |
Definition at line 129 of file AnsaLSA.h.
Referenced by AnsaOSPF::Router::AgeDatabase().
{ return purgeable; }
| void AnsaOSPF::ASExternalLSA::SetPurgeable | ( | bool | purge = true | ) | [inline] |
| bool AnsaOSPF::ASExternalLSA::Update | ( | const OSPFASExternalLSA * | lsa | ) |
Definition at line 3 of file AnsaASExternalLSA.cc.
Referenced by AnsaOSPF::Router::AgeDatabase().
{
bool different = DiffersFrom(lsa);
(*this) = (*lsa);
ResetInstallTime();
if (different) {
ClearNextHops();
return true;
} else {
return false;
}
}
| bool AnsaOSPF::ASExternalLSA::ValidateLSChecksum | ( | ) | const [inline] |
Definition at line 132 of file AnsaLSA.h.
Referenced by AnsaOSPF::Router::AgeDatabase().
{ return true; } // not implemented
bool AnsaOSPF::ASExternalLSA::purgeable [protected] |
Definition at line 122 of file AnsaLSA.h.
Referenced by GetPurgeable(), and SetPurgeable().