#include <OSPFRoutingTableEntry.h>
Inheritance diagram for OSPF::RoutingTableEntry:
|
|
|
00014 { 00015 IntraArea = 0, 00016 InterArea = 1, 00017 Type1External = 2, 00018 Type2External = 3 00019 };
|
|
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 }
|
|
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 }
|
|
00045 {}
|
|
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 }
|
|
00069 { nextHops.clear (); }
|
|
00055 { return netmask; }
|
|
00059 { return area; }
|
|
00063 { return cost; }
|
|
00053 { return host; }
|
|
00051 { return destinationType; }
|
|
00067 { return linkStateOrigin; }
|
|
00071 { return nextHops[index]; }
|
|
00070 { return nextHops.size (); }
|
|
00057 { return optionalCapabilities; }
|
|
00061 { return pathType; }
|
|
00065 { return type2Cost; }
|
|
00048 { return (!((*this) == entry)); }
|
|
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 }
|
|
00054 { netmask = destMask; }
|
|
00058 { area = source; }
|
|
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 }
|
|
00052 { host = destID; }
|
|
00050 { destinationType = type; }
|
|
00066 { linkStateOrigin = lsa; }
|
|
00056 { optionalCapabilities = options; }
|
|
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 }
|
|
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 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|