INET Framework for OMNeT++/OMNEST
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]
: OSPFASExternalLSA(), RoutingInfo(), LSATrackingInfo(), purgeable(false) {}
OSPF::ASExternalLSA::ASExternalLSA ( const OSPFASExternalLSA &  lsa) [inline]
: OSPFASExternalLSA(lsa), RoutingInfo(), LSATrackingInfo(), purgeable(false) {}
OSPF::ASExternalLSA::ASExternalLSA ( const ASExternalLSA lsa) [inline]
: OSPFASExternalLSA(lsa), RoutingInfo(lsa), LSATrackingInfo(lsa), purgeable(lsa.purgeable) {}
virtual OSPF::ASExternalLSA::~ASExternalLSA ( void  ) [inline, virtual]
{}

Member Function Documentation

bool OSPF::ASExternalLSA::DiffersFrom ( const OSPFASExternalLSA *  asExternalLSA) const

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 OSPF::ASExternalLSA::GetPurgeable ( void  ) const [inline]

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

{ return purgeable; }
void OSPF::ASExternalLSA::SetPurgeable ( bool  purge = true) [inline]
{ purgeable = purge; }
bool OSPF::ASExternalLSA::Update ( const OSPFASExternalLSA *  lsa)

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

{
    bool different = DiffersFrom(lsa);
    (*this) = (*lsa);
    ResetInstallTime();
    if (different) {
        ClearNextHops();
        return true;
    } else {
        return false;
    }
}
bool OSPF::ASExternalLSA::ValidateLSChecksum ( ) const [inline]

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

{ return true; } // not implemented

Member Data Documentation

Referenced by GetPurgeable(), and SetPurgeable().


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