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

#include <ansaOspfRoutingTableEntry6.h>

Inheritance diagram for AnsaOspf6::RoutingTableEntry:
IPv6Route

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 SetDestinationPrefix (IPv6Address destID)
IPv6Address GetDestinationPrefix (void) const
void SetPrefixLength (short prefixLen)
short GetPrefixLength (void) const
void SetOptionalCapabilities (OspfOptions6 options)
OspfOptions6 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 OspfLsa6 *lsa)
const OspfLsa6GetLinkStateOrigin (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
OspfOptions6 optionalCapabilities
AreaID area
RoutingPathType pathType
Metric cost
Metric type2Cost
const OspfLsa6linkStateOrigin
std::vector< NextHopnextHops

Detailed Description

Definition at line 25 of file ansaOspfRoutingTableEntry6.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
IntraArea 
InterArea 
Type1External 
Type2External 

Definition at line 27 of file ansaOspfRoutingTableEntry6.h.


Constructor & Destructor Documentation

Definition at line 96 of file ansaOspfRoutingTableEntry6.h.

                                                                                   :
      IPv6Route(entry._destPrefix, entry._length, entry._src),
      destinationType(entry.destinationType),
      optionalCapabilities(entry.optionalCapabilities),
      area(entry.area),
      pathType(entry.pathType),
      cost(entry.cost),
      type2Cost(entry.type2Cost),
      linkStateOrigin(entry.linkStateOrigin),
      nextHops(entry.nextHops) {

   _nextHop = entry._nextHop;
   _interfaceID = entry._interfaceID;
   _metric = entry._metric;
}
virtual AnsaOspf6::RoutingTableEntry::~RoutingTableEntry ( void  ) [inline, virtual]

Definition at line 54 of file ansaOspfRoutingTableEntry6.h.

{}

Member Function Documentation

Definition at line 142 of file ansaOspfRoutingTableEntry6.h.

                                                                       {
   if (nextHops.size() == 0){
      InterfaceEntry* routingInterface = AnsaInterfaceTableAccess().get()->getInterfaceById(hop.ifIndex);
      _interfaceID = routingInterface->getInterfaceId();
      _nextHop = hop.hopAddress;
   }
   nextHops.push_back(hop);
}

Definition at line 78 of file ansaOspfRoutingTableEntry6.h.

{ nextHops.clear(); }
AreaID AnsaOspf6::RoutingTableEntry::GetArea ( void  ) const [inline]

Definition at line 68 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

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

Definition at line 72 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

{ return cost; }

Definition at line 62 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

{ return _destPrefix; }

Definition at line 60 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

{ return destinationType; }

Definition at line 76 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

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

Definition at line 80 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

{ return nextHops[index]; }
unsigned int AnsaOspf6::RoutingTableEntry::GetNextHopCount ( void  ) const [inline]

Definition at line 79 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

{ return nextHops.size(); }

Definition at line 70 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

{ return pathType; }
short AnsaOspf6::RoutingTableEntry::GetPrefixLength ( void  ) const [inline]

Definition at line 64 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

{ return _length; }

Definition at line 74 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

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

Definition at line 57 of file ansaOspfRoutingTableEntry6.h.

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

Definition at line 151 of file ansaOspfRoutingTableEntry6.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)
         && (_destPrefix == entry._destPrefix)
         && (_length == entry._length)
         && (optionalCapabilities == entry.optionalCapabilities)
         && (area == entry.area)
         && (pathType == entry.pathType)
         && (cost == entry.cost)
         && (type2Cost == entry.type2Cost)
         && (linkStateOrigin == entry.linkStateOrigin));
}
void AnsaOspf6::RoutingTableEntry::SetArea ( AreaID  source) [inline]

Definition at line 67 of file ansaOspfRoutingTableEntry6.h.

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

Definition at line 122 of file ansaOspfRoutingTableEntry6.h.

                                                               {
   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 == AnsaOspf6::RoutingTableEntry::Type2External){
      _metric = cost + type2Cost * 1000;
   }else{
      _metric = cost;
   }
}

Definition at line 61 of file ansaOspfRoutingTableEntry6.h.

{ _destPrefix = destID; }

Definition at line 75 of file ansaOspfRoutingTableEntry6.h.

{ linkStateOrigin = lsa; }

Definition at line 112 of file ansaOspfRoutingTableEntry6.h.

                                                                        {
   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 == AnsaOspf6::RoutingTableEntry::Type2External){
      _metric = cost + type2Cost * 1000;
   }else{
      _metric = cost;
   }
}
void AnsaOspf6::RoutingTableEntry::SetPrefixLength ( short  prefixLen) [inline]

Definition at line 63 of file ansaOspfRoutingTableEntry6.h.

{ _length = prefixLen; }

Definition at line 132 of file ansaOspfRoutingTableEntry6.h.

                                                                    {
   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 == AnsaOspf6::RoutingTableEntry::Type2External){
      _metric = cost + type2Cost * 1000;
   }else{
      _metric = cost;
   }
}

Member Data Documentation

Definition at line 44 of file ansaOspfRoutingTableEntry6.h.

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

Definition at line 38 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

Definition at line 39 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().

Definition at line 46 of file ansaOspfRoutingTableEntry6.h.

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

const unsigned char AnsaOspf6::RoutingTableEntry::NetworkDestination = 0 [static]

Definition at line 37 of file ansaOspfRoutingTableEntry6.h.

Referenced by operator<<().


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