#include <OSPFRoutingTableEntry.h>
Inheritance diagram for OSPF::RoutingTableEntry:
typedef unsigned char OSPF::RoutingTableEntry::RoutingDestinationType |
00014 { 00015 IntraArea = 0, 00016 InterArea = 1, 00017 Type1External = 2, 00018 Type2External = 3 00019 };
OSPF::RoutingTableEntry::RoutingTableEntry | ( | void | ) | [inline] |
00076 : 00077 RoutingEntry (), 00078 destinationType (OSPF::RoutingTableEntry::NetworkDestination), 00079 area (OSPF::BackboneAreaID), 00080 pathType (OSPF::RoutingTableEntry::IntraArea), 00081 type2Cost (0), 00082 linkStateOrigin (NULL) 00083 { 00084 netmask = 0xFFFFFFFF; 00085 source = RoutingEntry::OSPF; 00086 memset (&optionalCapabilities, 0, sizeof (OSPFOptions)); 00087 }
OSPF::RoutingTableEntry::RoutingTableEntry | ( | const RoutingTableEntry & | entry | ) | [inline] |
00089 : 00090 destinationType (entry.destinationType), 00091 optionalCapabilities (entry.optionalCapabilities), 00092 area (entry.area), 00093 pathType (entry.pathType), 00094 cost (entry.cost), 00095 type2Cost (entry.type2Cost), 00096 linkStateOrigin (entry.linkStateOrigin), 00097 nextHops (entry.nextHops) 00098 { 00099 host = entry.host; 00100 netmask = entry.netmask; 00101 gateway = entry.gateway; 00102 interfaceName = entry.interfaceName; 00103 interfacePtr = entry.interfacePtr; 00104 type = entry.type; 00105 source = entry.source; 00106 metric = entry.metric; 00107 }
void OSPF::RoutingTableEntry::AddNextHop | ( | NextHop | hop | ) | [inline] |
00143 { 00144 if (nextHops.size () == 0) { 00145 InterfaceEntry* routingInterface = InterfaceTableAccess().get ()->interfaceAt (hop.ifIndex); 00146 00147 interfacePtr = routingInterface; 00148 interfaceName = routingInterface->name(); 00149 //gateway = ULongFromIPv4Address (hop.hopAddress); // TODO: verify this isn't necessary 00150 } 00151 nextHops.push_back (hop); 00152 }
void OSPF::RoutingTableEntry::ClearNextHops | ( | void | ) | [inline] |
RoutingDestinationType OSPF::RoutingTableEntry::GetDestinationType | ( | void | ) | const [inline] |
const OSPFLSA* OSPF::RoutingTableEntry::GetLinkStateOrigin | ( | void | ) | const [inline] |
NextHop OSPF::RoutingTableEntry::GetNextHop | ( | unsigned int | index | ) | const [inline] |
unsigned int OSPF::RoutingTableEntry::GetNextHopCount | ( | void | ) | const [inline] |
OSPFOptions OSPF::RoutingTableEntry::GetOptionalCapabilities | ( | void | ) | const [inline] |
RoutingPathType OSPF::RoutingTableEntry::GetPathType | ( | void | ) | const [inline] |
bool OSPF::RoutingTableEntry::operator!= | ( | const RoutingTableEntry & | entry | ) | const [inline] |
bool OSPF::RoutingTableEntry::operator== | ( | const RoutingTableEntry & | entry | ) | const [inline] |
00155 { 00156 unsigned int hopCount = nextHops.size (); 00157 unsigned int i = 0; 00158 00159 if (hopCount != entry.nextHops.size ()) { 00160 return false; 00161 } 00162 for (i = 0; i < hopCount; i++) { 00163 if ((nextHops[i] != entry.nextHops[i])) 00164 { 00165 return false; 00166 } 00167 } 00168 00169 return ((destinationType == entry.destinationType) && 00170 (host == entry.host) && 00171 (netmask == entry.netmask) && 00172 (optionalCapabilities == entry.optionalCapabilities) && 00173 (area == entry.area) && 00174 (pathType == entry.pathType) && 00175 (cost == entry.cost) && 00176 (type2Cost == entry.type2Cost) && 00177 (linkStateOrigin == entry.linkStateOrigin)); 00178 }
void OSPF::RoutingTableEntry::SetAddressMask | ( | IPAddress | destMask | ) | [inline] |
void OSPF::RoutingTableEntry::SetCost | ( | Metric | pathCost | ) | [inline] |
00121 { 00122 cost = pathCost; 00123 // FIXME: this is a hack. But the correct way to do it is to implement a separate RoutingTable module for OSPF... 00124 if (pathType == OSPF::RoutingTableEntry::Type2External) { 00125 metric = cost + type2Cost * 1000; 00126 } else { 00127 metric = cost; 00128 } 00129 }
void OSPF::RoutingTableEntry::SetDestinationID | ( | IPAddress | destID | ) | [inline] |
void OSPF::RoutingTableEntry::SetDestinationType | ( | RoutingDestinationType | type | ) | [inline] |
void OSPF::RoutingTableEntry::SetLinkStateOrigin | ( | const OSPFLSA * | lsa | ) | [inline] |
void OSPF::RoutingTableEntry::SetOptionalCapabilities | ( | OSPFOptions | options | ) | [inline] |
void OSPF::RoutingTableEntry::SetPathType | ( | RoutingPathType | type | ) | [inline] |
00110 { 00111 pathType = type; 00112 // FIXME: this is a hack. But the correct way to do it is to implement a separate RoutingTable module for OSPF... 00113 if (pathType == OSPF::RoutingTableEntry::Type2External) { 00114 metric = cost + type2Cost * 1000; 00115 } else { 00116 metric = cost; 00117 } 00118 }
void OSPF::RoutingTableEntry::SetType2Cost | ( | Metric | pathCost | ) | [inline] |
00132 { 00133 type2Cost = pathCost; 00134 // FIXME: this is a hack. But the correct way to do it is to implement a separate RoutingTable module for OSPF... 00135 if (pathType == OSPF::RoutingTableEntry::Type2External) { 00136 metric = cost + type2Cost * 1000; 00137 } else { 00138 metric = cost; 00139 } 00140 }
AreaID OSPF::RoutingTableEntry::area [private] |
const unsigned char OSPF::RoutingTableEntry::AreaBorderRouterDestination = 1 [static] |
const unsigned char OSPF::RoutingTableEntry::ASBoundaryRouterDestination = 2 [static] |
Metric OSPF::RoutingTableEntry::cost [private] |
const OSPFLSA* OSPF::RoutingTableEntry::linkStateOrigin [private] |
const unsigned char OSPF::RoutingTableEntry::NetworkDestination = 0 [static] |
std::vector<NextHop> OSPF::RoutingTableEntry::nextHops [private] |
Metric OSPF::RoutingTableEntry::type2Cost [private] |