INET Framework for OMNeT++/OMNEST
AnsaOSPF::RoutingTableEntry Class Reference

#include <AnsaOSPFRoutingTableEntry.h>

Inheritance diagram for AnsaOSPF::RoutingTableEntry:
IPRoute

List of all members.

Public Types

enum  RoutingPathType { IntraArea = 0, InterArea = 1, Type1External = 2, Type2External = 3 }
typedef unsigned char RoutingDestinationType

Public Member Functions

 RoutingTableEntry (void)
 RoutingTableEntry (const RoutingTableEntry &entry)
virtual ~RoutingTableEntry (void)
bool operator== (const RoutingTableEntry &entry) const
bool operator!= (const RoutingTableEntry &entry) const
void SetDestinationType (RoutingDestinationType type)
RoutingDestinationType GetDestinationType (void) const
void SetDestinationID (IPAddress destID)
IPAddress GetDestinationID (void) const
void SetAddressMask (IPAddress destMask)
IPAddress GetAddressMask (void) const
void SetOptionalCapabilities (OSPFOptions options)
OSPFOptions GetOptionalCapabilities (void) const
void SetArea (AreaID source)
AreaID GetArea (void) const
void SetPathType (RoutingPathType type)
RoutingPathType GetPathType (void) const
void SetCost (Metric pathCost)
Metric GetCost (void) const
void SetType2Cost (Metric pathCost)
Metric GetType2Cost (void) const
void SetLinkStateOrigin (const OSPFLSA *lsa)
const OSPFLSAGetLinkStateOrigin (void) const
void AddNextHop (NextHop hop)
void ClearNextHops (void)
unsigned int GetNextHopCount (void) const
NextHop GetNextHop (unsigned int index) const

Static Public Attributes

static const unsigned char NetworkDestination = 0
static const unsigned char AreaBorderRouterDestination = 1
static const unsigned char ASBoundaryRouterDestination = 2

Private Attributes

RoutingDestinationType destinationType
OSPFOptions optionalCapabilities
AreaID area
RoutingPathType pathType
Metric cost
Metric type2Cost
const OSPFLSAlinkStateOrigin
std::vector< NextHopnextHops

Detailed Description

Definition at line 11 of file AnsaOSPFRoutingTableEntry.h.


Member Typedef Documentation

Definition at line 21 of file AnsaOSPFRoutingTableEntry.h.


Member Enumeration Documentation

Enumerator:
IntraArea 
InterArea 
Type1External 
Type2External 

Definition at line 14 of file AnsaOSPFRoutingTableEntry.h.


Constructor & Destructor Documentation

Definition at line 89 of file AnsaOSPFRoutingTableEntry.h.

                                                                                  :
    destinationType(entry.destinationType),
    optionalCapabilities(entry.optionalCapabilities),
    area(entry.area),
    pathType(entry.pathType),
    cost(entry.cost),
    type2Cost(entry.type2Cost),
    linkStateOrigin(entry.linkStateOrigin),
    nextHops(entry.nextHops)
{
    host          = entry.host;
    netmask       = entry.netmask;
    gateway       = entry.gateway;
    interfacePtr  = entry.interfacePtr;
    type          = entry.type;
    source        = entry.source;
    metric        = entry.metric;
}
virtual AnsaOSPF::RoutingTableEntry::~RoutingTableEntry ( void  ) [inline, virtual]

Definition at line 45 of file AnsaOSPFRoutingTableEntry.h.

{}

Member Function Documentation

Definition at line 141 of file AnsaOSPFRoutingTableEntry.h.

{
    if (nextHops.size() == 0) {
        InterfaceEntry*    routingInterface = InterfaceTableAccess().get()->getInterfaceById(hop.ifIndex);

        interfacePtr = routingInterface;
        gateway = ULongFromIPv4Address(hop.hopAddress); // TODO: verify this isn't necessary
    }
    nextHops.push_back(hop);
}

Definition at line 69 of file AnsaOSPFRoutingTableEntry.h.

{ nextHops.clear(); }

Definition at line 55 of file AnsaOSPFRoutingTableEntry.h.

Referenced by operator<<(), and AnsaOSPF::Area::OriginateSummaryLSA().

{ return netmask; }
AreaID AnsaOSPF::RoutingTableEntry::GetArea ( void  ) const [inline]

Definition at line 59 of file AnsaOSPFRoutingTableEntry.h.

Referenced by operator<<().

{ return area; }
Metric AnsaOSPF::RoutingTableEntry::GetCost ( void  ) const [inline]

Definition at line 63 of file AnsaOSPFRoutingTableEntry.h.

Referenced by AnsaOSPF::Area::FindSameOrWorseCostRoute(), and operator<<().

{ return cost; }
const OSPFLSA* AnsaOSPF::RoutingTableEntry::GetLinkStateOrigin ( void  ) const [inline]

Definition at line 67 of file AnsaOSPFRoutingTableEntry.h.

Referenced by operator<<().

{ return linkStateOrigin; }
NextHop AnsaOSPF::RoutingTableEntry::GetNextHop ( unsigned int  index) const [inline]
unsigned int AnsaOSPF::RoutingTableEntry::GetNextHopCount ( void  ) const [inline]

Definition at line 70 of file AnsaOSPFRoutingTableEntry.h.

Referenced by AnsaOSPF::Area::CreateRoutingTableEntryFromSummaryLSA(), and operator<<().

{ return nextHops.size(); }

Definition at line 65 of file AnsaOSPFRoutingTableEntry.h.

Referenced by operator<<().

{ return type2Cost; }
bool AnsaOSPF::RoutingTableEntry::operator!= ( const RoutingTableEntry entry) const [inline]

Definition at line 48 of file AnsaOSPFRoutingTableEntry.h.

{ return (!((*this) == entry)); }
bool AnsaOSPF::RoutingTableEntry::operator== ( const RoutingTableEntry entry) const [inline]

Definition at line 152 of file AnsaOSPFRoutingTableEntry.h.

{
    unsigned int hopCount = nextHops.size();
    unsigned int i        = 0;

    if (hopCount != entry.nextHops.size()) {
        return false;
    }
    for (i = 0; i < hopCount; i++) {
        if ((nextHops[i] != entry.nextHops[i]))
        {
            return false;
        }
    }

    return ((destinationType      == entry.destinationType)      &&
            (host                 == entry.host)                 &&
            (netmask              == entry.netmask)              &&
            (optionalCapabilities == entry.optionalCapabilities) &&
            (area                 == entry.area)                 &&
            (pathType             == entry.pathType)             &&
            (cost                 == entry.cost)                 &&
            (type2Cost            == entry.type2Cost)            &&
            (linkStateOrigin      == entry.linkStateOrigin));
}

Definition at line 54 of file AnsaOSPFRoutingTableEntry.h.

{ netmask = destMask; }
void AnsaOSPF::RoutingTableEntry::SetArea ( AreaID  source) [inline]

Definition at line 58 of file AnsaOSPFRoutingTableEntry.h.

{ area = source; }
void AnsaOSPF::RoutingTableEntry::SetCost ( Metric  pathCost) [inline]

Definition at line 119 of file AnsaOSPFRoutingTableEntry.h.

Referenced by AnsaOSPFRouting::LoadExternalRoute().

{
    cost = pathCost;
    // FIXME: this is a hack. But the correct way to do it is to implement a separate IRoutingTable module for OSPF...
    if (pathType == AnsaOSPF::RoutingTableEntry::Type2External) {
        metric = cost + type2Cost * 1000;
    } else {
        metric = cost;
    }
}

Definition at line 66 of file AnsaOSPFRoutingTableEntry.h.

{ linkStateOrigin = lsa; }

Definition at line 56 of file AnsaOSPFRoutingTableEntry.h.

{ optionalCapabilities = options; }

Definition at line 108 of file AnsaOSPFRoutingTableEntry.h.

Referenced by AnsaOSPFRouting::LoadExternalRoute().

{
    pathType = type;
    // FIXME: this is a hack. But the correct way to do it is to implement a separate IRoutingTable module for OSPF...
    if (pathType == AnsaOSPF::RoutingTableEntry::Type2External) {
        metric = cost + type2Cost * 1000;
    } else {
        metric = cost;
    }
}

Definition at line 130 of file AnsaOSPFRoutingTableEntry.h.

Referenced by AnsaOSPFRouting::LoadExternalRoute().

{
    type2Cost = pathCost;
    // FIXME: this is a hack. But the correct way to do it is to implement a separate IRoutingTable module for OSPF...
    if (pathType == AnsaOSPF::RoutingTableEntry::Type2External) {
        metric = cost + type2Cost * 1000;
    } else {
        metric = cost;
    }
}

Member Data Documentation

Definition at line 33 of file AnsaOSPFRoutingTableEntry.h.

Referenced by GetArea(), operator==(), and SetArea().

Definition at line 35 of file AnsaOSPFRoutingTableEntry.h.

Referenced by GetCost(), and operator==().


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