#include <RoutingTable.h>
See the NED documentation for general overview.
This is a simple module without gates, it requires function calls to it (message handling does nothing). Methods are provided for reading and updating the interface table and the route table, as well as for unicast and multicast routing.
Interfaces are dynamically registered: at the start of the simulation, every L2 module adds its own interface entry to the table.
The route table is read from a file (RoutingTableParser); the file can also fill in or overwrite interface settings. The route table can also be read and modified during simulation, typically by routing protocol implementations (e.g. OSPF).
Entries in the route table are represented by IPRoute objects. IPRoute objects can be polymorphic: if a routing protocol needs to store additional data, it can simply subclass from IPRoute, and add the derived object to the table.
Uses RoutingTableParser to read routing files (.irt, .mrt).
Public Member Functions | |
RoutingTable () | |
virtual | ~RoutingTable () |
virtual void | printRoutingTable () const |
virtual bool | isIPForwardingEnabled () |
virtual IPAddress | getRouterId () |
virtual void | setRouterId (IPAddress a) |
Interfaces | |
virtual void | configureInterfaceForIPv4 (InterfaceEntry *ie) |
virtual InterfaceEntry * | getInterfaceByAddress (const IPAddress &address) const |
Routing functions (query the route table) | |
virtual bool | isLocalAddress (const IPAddress &dest) const |
virtual const IPRoute * | findBestMatchingRoute (const IPAddress &dest) const |
virtual InterfaceEntry * | getInterfaceForDestAddr (const IPAddress &dest) const |
virtual IPAddress | getGatewayForDestAddr (const IPAddress &dest) const |
Multicast routing functions | |
virtual bool | isLocalMulticastAddress (const IPAddress &dest) const |
virtual MulticastRoutes | getMulticastRoutesFor (const IPAddress &dest) const |
Route table manipulation | |
virtual int | getNumRoutes () const |
virtual const IPRoute * | getRoute (int k) const |
virtual const IPRoute * | findRoute (const IPAddress &target, const IPAddress &netmask, const IPAddress &gw, int metric=0, const char *dev=NULL) const |
virtual const IPRoute * | getDefaultRoute () const |
virtual void | addRoute (const IPRoute *entry) |
virtual bool | deleteRoute (const IPRoute *entry) |
virtual std::vector< IPAddress > | gatherAddresses () const |
Protected Types | |
typedef std::vector< IPRoute * > | RouteVector |
typedef std::map< IPAddress, const IPRoute * > | RoutingCache |
typedef std::set< IPAddress > | AddressSet |
Protected Member Functions | |
virtual void | configureLoopbackForIPv4 () |
virtual bool | routeMatches (const IPRoute *entry, const IPAddress &target, const IPAddress &nmask, const IPAddress &gw, int metric, const char *dev) const |
virtual void | configureRouterId () |
virtual void | updateNetmaskRoutes () |
virtual void | updateDisplayString () |
virtual void | deleteInterfaceRoutes (InterfaceEntry *entry) |
virtual void | invalidateCache () |
virtual int | numInitStages () const |
virtual void | initialize (int stage) |
virtual void | handleMessage (cMessage *) |
virtual void | receiveChangeNotification (int category, const cPolymorphic *details) |
Protected Attributes | |
IInterfaceTable * | ift |
NotificationBoard * | nb |
IPAddress | routerId |
bool | IPForward |
RouteVector | routes |
RouteVector | multicastRoutes |
RoutingCache | routingCache |
AddressSet | localAddresses |
typedef std::vector<IPRoute *> RoutingTable::RouteVector [protected] |
typedef std::map<IPAddress, const IPRoute *> RoutingTable::RoutingCache [protected] |
typedef std::set<IPAddress> RoutingTable::AddressSet [protected] |
RoutingTable::~RoutingTable | ( | ) | [virtual] |
00052 { 00053 for (unsigned int i=0; i<routes.size(); i++) 00054 delete routes[i]; 00055 for (unsigned int i=0; i<multicastRoutes.size(); i++) 00056 delete multicastRoutes[i]; 00057 }
void RoutingTable::configureLoopbackForIPv4 | ( | ) | [protected, virtual] |
Referenced by initialize().
00272 { 00273 InterfaceEntry *ie = ift->getFirstLoopbackInterface(); 00274 00275 // add IPv4 info. Set 127.0.0.1/8 as address by default -- 00276 // we may reconfigure later it to be the routerId 00277 IPv4InterfaceData *d = new IPv4InterfaceData(); 00278 d->setIPAddress(IPAddress::LOOPBACK_ADDRESS); 00279 d->setNetmask(IPAddress::LOOPBACK_NETMASK); 00280 d->setMetric(1); 00281 ie->setIPv4Data(d); 00282 }
bool RoutingTable::routeMatches | ( | const IPRoute * | entry, | |
const IPAddress & | target, | |||
const IPAddress & | nmask, | |||
const IPAddress & | gw, | |||
int | metric, | |||
const char * | dev | |||
) | const [protected, virtual] |
Referenced by findRoute().
00481 { 00482 if (!target.isUnspecified() && !target.equals(entry->getHost())) 00483 return false; 00484 if (!nmask.isUnspecified() && !nmask.equals(entry->getNetmask())) 00485 return false; 00486 if (!gw.isUnspecified() && !gw.equals(entry->getGateway())) 00487 return false; 00488 if (metric && metric!=entry->getMetric()) 00489 return false; 00490 if (dev && strcmp(dev, entry->getInterfaceName())) 00491 return false; 00492 00493 return true; 00494 }
void RoutingTable::configureRouterId | ( | ) | [protected, virtual] |
Referenced by initialize().
00119 { 00120 if (routerId.isUnspecified()) // not yet configured 00121 { 00122 const char *routerIdStr = par("routerId").stringValue(); 00123 if (!strcmp(routerIdStr, "auto")) // non-"auto" cases already handled in stage 1 00124 { 00125 // choose highest interface address as routerId 00126 for (int i=0; i<ift->getNumInterfaces(); ++i) 00127 { 00128 InterfaceEntry *ie = ift->getInterface(i); 00129 if (!ie->isLoopback() && ie->ipv4Data()->getIPAddress().getInt() > routerId.getInt()) 00130 routerId = ie->ipv4Data()->getIPAddress(); 00131 } 00132 } 00133 } 00134 else // already configured 00135 { 00136 // if there is no interface with routerId yet, assign it to the loopback address; 00137 // TODO find out if this is a good practice, in which situations it is useful etc. 00138 if (getInterfaceByAddress(routerId)==NULL) 00139 { 00140 InterfaceEntry *lo0 = ift->getFirstLoopbackInterface(); 00141 lo0->ipv4Data()->setIPAddress(routerId); 00142 lo0->ipv4Data()->setNetmask(IPAddress::ALLONES_ADDRESS); 00143 } 00144 } 00145 }
void RoutingTable::updateNetmaskRoutes | ( | ) | [protected, virtual] |
Referenced by initialize(), and receiveChangeNotification().
00497 { 00498 // first, delete all routes with src=IFACENETMASK 00499 for (unsigned int k=0; k<routes.size(); k++) 00500 if (routes[k]->getSource()==IPRoute::IFACENETMASK) 00501 routes.erase(routes.begin()+(k--)); // '--' is necessary because indices shift down 00502 00503 // then re-add them, according to actual interface configuration 00504 for (int i=0; i<ift->getNumInterfaces(); i++) 00505 { 00506 InterfaceEntry *ie = ift->getInterface(i); 00507 if (ie->ipv4Data()->getNetmask()!=IPAddress::ALLONES_ADDRESS) 00508 { 00509 IPRoute *route = new IPRoute(); 00510 route->setType(IPRoute::DIRECT); 00511 route->setSource(IPRoute::IFACENETMASK); 00512 route->setHost(ie->ipv4Data()->getIPAddress()); 00513 route->setNetmask(ie->ipv4Data()->getNetmask()); 00514 route->setGateway(IPAddress()); 00515 route->setMetric(ie->ipv4Data()->getMetric()); 00516 route->setInterface(ie); 00517 routes.push_back(route); 00518 } 00519 } 00520 00521 invalidateCache(); 00522 updateDisplayString(); 00523 }
void RoutingTable::updateDisplayString | ( | ) | [protected, virtual] |
Referenced by addRoute(), deleteRoute(), and updateNetmaskRoutes().
00148 { 00149 if (!ev.isGUI()) 00150 return; 00151 00152 char buf[80]; 00153 if (routerId.isUnspecified()) 00154 sprintf(buf, "%d+%d routes", routes.size(), multicastRoutes.size()); 00155 else 00156 sprintf(buf, "routerId: %s\n%d+%d routes", routerId.str().c_str(), routes.size(), multicastRoutes.size()); 00157 getDisplayString().setTagArg("t",0,buf); 00158 }
void RoutingTable::deleteInterfaceRoutes | ( | InterfaceEntry * | entry | ) | [protected, virtual] |
Referenced by receiveChangeNotification().
00201 { 00202 RouteVector::iterator it = routes.begin(); 00203 while (it != routes.end()) 00204 { 00205 IPRoute *route = *it; 00206 if (route->getInterface() == entry) 00207 { 00208 deleteRoute(route); 00209 it = routes.begin(); // iterator became invalid -- start over 00210 } 00211 else 00212 { 00213 ++it; 00214 } 00215 } 00216 }
void RoutingTable::invalidateCache | ( | ) | [protected, virtual] |
Referenced by addRoute(), deleteRoute(), receiveChangeNotification(), and updateNetmaskRoutes().
00219 { 00220 routingCache.clear(); 00221 localAddresses.clear(); 00222 }
void RoutingTable::initialize | ( | int | stage | ) | [protected, virtual] |
00060 { 00061 if (stage==0) 00062 { 00063 // get a pointer to the NotificationBoard module and IInterfaceTable 00064 nb = NotificationBoardAccess().get(); 00065 ift = InterfaceTableAccess().get(); 00066 00067 IPForward = par("IPForward").boolValue(); 00068 00069 nb->subscribe(this, NF_INTERFACE_CREATED); 00070 nb->subscribe(this, NF_INTERFACE_DELETED); 00071 nb->subscribe(this, NF_INTERFACE_STATE_CHANGED); 00072 nb->subscribe(this, NF_INTERFACE_CONFIG_CHANGED); 00073 nb->subscribe(this, NF_INTERFACE_IPv4CONFIG_CHANGED); 00074 00075 WATCH_PTRVECTOR(routes); 00076 WATCH_PTRVECTOR(multicastRoutes); 00077 WATCH(IPForward); 00078 WATCH(routerId); 00079 } 00080 else if (stage==1) 00081 { 00082 // L2 modules register themselves in stage 0, so we can only configure 00083 // the interfaces in stage 1. 00084 const char *filename = par("routingFile"); 00085 00086 // At this point, all L2 modules have registered themselves (added their 00087 // interface entries). Create the per-interface IPv4 data structures. 00088 IInterfaceTable *interfaceTable = InterfaceTableAccess().get(); 00089 for (int i=0; i<interfaceTable->getNumInterfaces(); ++i) 00090 configureInterfaceForIPv4(interfaceTable->getInterface(i)); 00091 configureLoopbackForIPv4(); 00092 00093 // read routing table file (and interface configuration) 00094 RoutingTableParser parser(ift, this); 00095 if (*filename && parser.readRoutingTableFromFile(filename)==-1) 00096 error("Error reading routing table file %s", filename); 00097 00098 // set routerId if param is not "" (==no routerId) or "auto" (in which case we'll 00099 // do it later in stage 3, after network configurators configured the interfaces) 00100 const char *routerIdStr = par("routerId").stringValue(); 00101 if (strcmp(routerIdStr, "") && strcmp(routerIdStr, "auto")) 00102 routerId = IPAddress(routerIdStr); 00103 } 00104 else if (stage==3) 00105 { 00106 // routerID selection must be after stage==2 when network autoconfiguration 00107 // assigns interface addresses 00108 configureRouterId(); 00109 00110 // we don't use notifications during initialize(), so we do it manually. 00111 // Should be in stage=3 because autoconfigurator runs in stage=2. 00112 updateNetmaskRoutes(); 00113 00114 //printRoutingTable(); 00115 } 00116 }
void RoutingTable::handleMessage | ( | cMessage * | msg | ) | [protected, virtual] |
void RoutingTable::receiveChangeNotification | ( | int | category, | |
const cPolymorphic * | details | |||
) | [protected, virtual] |
Called by the NotificationBoard whenever a change of a category occurs to which this client has subscribed.
Implements INotifiable.
00166 { 00167 if (simulation.getContextType()==CTX_INITIALIZE) 00168 return; // ignore notifications during initialize 00169 00170 Enter_Method_Silent(); 00171 printNotificationBanner(category, details); 00172 00173 if (category==NF_INTERFACE_CREATED) 00174 { 00175 // add netmask route for the new interface 00176 updateNetmaskRoutes(); 00177 } 00178 else if (category==NF_INTERFACE_DELETED) 00179 { 00180 // remove all routes that point to that interface 00181 InterfaceEntry *entry = check_and_cast<InterfaceEntry*>(details); 00182 deleteInterfaceRoutes(entry); 00183 } 00184 else if (category==NF_INTERFACE_STATE_CHANGED) 00185 { 00186 invalidateCache(); 00187 } 00188 else if (category==NF_INTERFACE_CONFIG_CHANGED) 00189 { 00190 invalidateCache(); 00191 } 00192 else if (category==NF_INTERFACE_IPv4CONFIG_CHANGED) 00193 { 00194 // if anything IPv4-related changes in the interfaces, interface netmask 00195 // based routes have to be re-built. 00196 updateNetmaskRoutes(); 00197 } 00198 }
void RoutingTable::printRoutingTable | ( | ) | const [virtual] |
For debugging
Implements IRoutingTable.
00225 { 00226 EV << "-- Routing table --\n"; 00227 ev.printf("%-16s %-16s %-16s %-3s %s\n", 00228 "Destination", "Gateway", "Netmask", "Iface"); 00229 00230 for (int i=0; i<getNumRoutes(); i++) 00231 EV << getRoute(i)->detailedInfo() << "\n"; 00232 EV << "\n"; 00233 }
void RoutingTable::configureInterfaceForIPv4 | ( | InterfaceEntry * | ie | ) | [virtual] |
Implements IRoutingTable.
Referenced by initialize().
00247 { 00248 IPv4InterfaceData *d = new IPv4InterfaceData(); 00249 ie->setIPv4Data(d); 00250 00251 // metric: some hints: OSPF cost (2e9/bps value), MS KB article Q299540, ... 00252 d->setMetric((int)ceil(2e9/ie->getDatarate())); // use OSPF cost as default 00253 }
InterfaceEntry * RoutingTable::getInterfaceByAddress | ( | const IPAddress & | address | ) | const [virtual] |
Returns an interface given by its address. Returns NULL if not found.
Implements IRoutingTable.
Referenced by configureRouterId().
00256 { 00257 Enter_Method("getInterfaceByAddress(%x)", addr.getInt()); // note: str().c_str() too slow here 00258 00259 if (addr.isUnspecified()) 00260 return NULL; 00261 for (int i=0; i<ift->getNumInterfaces(); ++i) 00262 { 00263 InterfaceEntry *ie = ift->getInterface(i); 00264 if (ie->ipv4Data()->getIPAddress()==addr) 00265 return ie; 00266 } 00267 return NULL; 00268 }
virtual bool RoutingTable::isIPForwardingEnabled | ( | ) | [inline, virtual] |
virtual IPAddress RoutingTable::getRouterId | ( | ) | [inline, virtual] |
virtual void RoutingTable::setRouterId | ( | IPAddress | a | ) | [inline, virtual] |
bool RoutingTable::isLocalAddress | ( | const IPAddress & | dest | ) | const [virtual] |
Checks if the address is a local one, i.e. one of the host's.
Implements IRoutingTable.
00287 { 00288 Enter_Method("isLocalAddress(%x)", dest.getInt()); // note: str().c_str() too slow here 00289 00290 if (localAddresses.empty()) 00291 { 00292 // collect interface addresses if not yet done 00293 for (int i=0; i<ift->getNumInterfaces(); i++) 00294 { 00295 IPAddress interfaceAddr = ift->getInterface(i)->ipv4Data()->getIPAddress(); 00296 localAddresses.insert(interfaceAddr); 00297 } 00298 } 00299 00300 AddressSet::iterator it = localAddresses.find(dest); 00301 return it!=localAddresses.end(); 00302 }
The routing function.
Implements IRoutingTable.
Referenced by getGatewayForDestAddr(), and getInterfaceForDestAddr().
00320 { 00321 Enter_Method("findBestMatchingRoute(%x)", dest.getInt()); // note: str().c_str() too slow here 00322 00323 RoutingCache::iterator it = routingCache.find(dest); 00324 if (it != routingCache.end()) 00325 return it->second; 00326 00327 // find best match (one with longest prefix) 00328 // default route has zero prefix length, so (if exists) it'll be selected as last resort 00329 const IPRoute *bestRoute = NULL; 00330 uint32 longestNetmask = 0; 00331 for (RouteVector::const_iterator i=routes.begin(); i!=routes.end(); ++i) 00332 { 00333 const IPRoute *e = *i; 00334 if (IPAddress::maskedAddrAreEqual(dest, e->getHost(), e->getNetmask()) && // match 00335 (!bestRoute || e->getNetmask().getInt() > longestNetmask)) // longest so far 00336 { 00337 bestRoute = e; 00338 longestNetmask = e->getNetmask().getInt(); 00339 } 00340 } 00341 routingCache[dest] = bestRoute; 00342 return bestRoute; 00343 }
InterfaceEntry * RoutingTable::getInterfaceForDestAddr | ( | const IPAddress & | dest | ) | const [virtual] |
Convenience function based on findBestMatchingRoute().
Returns the interface Id to send the packets with dest as destination address, or -1 if destination is not in routing table.
Implements IRoutingTable.
00346 { 00347 Enter_Method("getInterfaceForDestAddr(%x)", dest.getInt()); // note: str().c_str() too slow here 00348 00349 const IPRoute *e = findBestMatchingRoute(dest); 00350 return e ? e->getInterface() : NULL; 00351 }
Convenience function based on findBestMatchingRoute().
Returns the gateway to send the destination. Returns null address if the destination is not in routing table or there is no gateway (local delivery).
Implements IRoutingTable.
00354 { 00355 Enter_Method("getGatewayForDestAddr(%x)", dest.getInt()); // note: str().c_str() too slow here 00356 00357 const IPRoute *e = findBestMatchingRoute(dest); 00358 return e ? e->getGateway() : IPAddress(); 00359 }
bool RoutingTable::isLocalMulticastAddress | ( | const IPAddress & | dest | ) | const [virtual] |
Checks if the address is in one of the local multicast group address list.
Implements IRoutingTable.
00305 { 00306 Enter_Method("isLocalMulticastAddress(%x)", dest.getInt()); // note: str().c_str() too slow here 00307 00308 for (int i=0; i<ift->getNumInterfaces(); i++) 00309 { 00310 InterfaceEntry *ie = ift->getInterface(i); 00311 for (unsigned int j=0; j < ie->ipv4Data()->getMulticastGroups().size(); j++) 00312 if (dest.equals(ie->ipv4Data()->getMulticastGroups()[j])) 00313 return true; 00314 } 00315 return false; 00316 }
MulticastRoutes RoutingTable::getMulticastRoutesFor | ( | const IPAddress & | dest | ) | const [virtual] |
Returns routes for a multicast address.
Implements IRoutingTable.
00363 { 00364 Enter_Method("getMulticastRoutesFor(%x)", dest.getInt()); // note: str().c_str() too slow here here 00365 00366 MulticastRoutes res; 00367 res.reserve(16); 00368 for (RouteVector::const_iterator i=multicastRoutes.begin(); i!=multicastRoutes.end(); ++i) 00369 { 00370 const IPRoute *e = *i; 00371 if (IPAddress::maskedAddrAreEqual(dest, e->getHost(), e->getNetmask())) 00372 { 00373 MulticastRoute r; 00374 r.interf = e->getInterface(); 00375 r.gateway = e->getGateway(); 00376 res.push_back(r); 00377 } 00378 } 00379 return res; 00380 }
int RoutingTable::getNumRoutes | ( | ) | const [virtual] |
Returns the total number of routes (unicast, multicast, plus the default route).
Implements IRoutingTable.
Referenced by findRoute(), and printRoutingTable().
00384 { 00385 return routes.size()+multicastRoutes.size(); 00386 }
const IPRoute * RoutingTable::getRoute | ( | int | k | ) | const [virtual] |
Returns the kth route. The returned route cannot be modified; you must delete and re-add it instead. This rule is emphasized by returning a const pointer.
Implements IRoutingTable.
Referenced by findRoute(), and printRoutingTable().
00389 { 00390 if (k < (int)routes.size()) 00391 return routes[k]; 00392 k -= routes.size(); 00393 if (k < (int)multicastRoutes.size()) 00394 return multicastRoutes[k]; 00395 return NULL; 00396 }
const IPRoute * RoutingTable::findRoute | ( | const IPAddress & | target, | |
const IPAddress & | netmask, | |||
const IPAddress & | gw, | |||
int | metric = 0 , |
|||
const char * | dev = NULL | |||
) | const [virtual] |
Finds the first route with the given parameters.
Implements IRoutingTable.
00409 { 00410 int n = getNumRoutes(); 00411 for (int i=0; i<n; i++) 00412 if (routeMatches(getRoute(i), target, netmask, gw, metric, dev)) 00413 return getRoute(i); 00414 return NULL; 00415 }
const IPRoute * RoutingTable::getDefaultRoute | ( | ) | const [virtual] |
Finds and returns the default route, or NULL if it doesn't exist
Implements IRoutingTable.
Referenced by addRoute().
00399 { 00400 int n = (int)routes.size(); 00401 for (int i=0; i<n; i++) 00402 if (routes[i]->getNetmask().isUnspecified()) 00403 return routes[i]; 00404 return NULL; 00405 }
void RoutingTable::addRoute | ( | const IPRoute * | entry | ) | [virtual] |
Adds a route to the routing table. Note that once added, routes cannot be modified; you must delete and re-add them instead.
Implements IRoutingTable.
00418 { 00419 Enter_Method("addRoute(...)"); 00420 00421 // check for null address and default route 00422 if (entry->getHost().isUnspecified() != entry->getNetmask().isUnspecified()) 00423 error("addRoute(): to add a default route, set both host and netmask to zero"); 00424 00425 if (entry->getHost().doAnd(entry->getNetmask().isUnspecified()).getInt() != 0) 00426 error("addRoute(): suspicious route: host %s has 1-bits outside netmask %s", 00427 entry->getHost().str().c_str(), entry->getNetmask().str().c_str()); 00428 00429 // check that the interface exists 00430 if (!entry->getInterface()) 00431 error("addRoute(): interface cannot be NULL"); 00432 00433 // if this is a default route, remove old default route (we're replacing it) 00434 if (entry->getNetmask().isUnspecified() && getDefaultRoute()!=NULL) 00435 deleteRoute(getDefaultRoute()); 00436 00437 // add to tables 00438 if (!entry->getHost().isMulticast()) 00439 routes.push_back(const_cast<IPRoute*>(entry)); 00440 else 00441 multicastRoutes.push_back(const_cast<IPRoute*>(entry)); 00442 00443 invalidateCache(); 00444 updateDisplayString(); 00445 00446 nb->fireChangeNotification(NF_IPv4_ROUTE_ADDED, entry); 00447 }
bool RoutingTable::deleteRoute | ( | const IPRoute * | entry | ) | [virtual] |
Deletes the given route from the routing table. Returns true if the route was deleted correctly, false if it was not in the routing table.
Implements IRoutingTable.
Referenced by addRoute(), and deleteInterfaceRoutes().
00451 { 00452 Enter_Method("deleteRoute(...)"); 00453 00454 RouteVector::iterator i = std::find(routes.begin(), routes.end(), entry); 00455 if (i!=routes.end()) 00456 { 00457 nb->fireChangeNotification(NF_IPv4_ROUTE_DELETED, entry); // rather: going to be deleted 00458 routes.erase(i); 00459 delete entry; 00460 invalidateCache(); 00461 updateDisplayString(); 00462 return true; 00463 } 00464 i = std::find(multicastRoutes.begin(), multicastRoutes.end(), entry); 00465 if (i!=multicastRoutes.end()) 00466 { 00467 nb->fireChangeNotification(NF_IPv4_ROUTE_DELETED, entry); // rather: going to be deleted 00468 multicastRoutes.erase(i); 00469 delete entry; 00470 invalidateCache(); 00471 updateDisplayString(); 00472 return true; 00473 } 00474 return false; 00475 }
std::vector< IPAddress > RoutingTable::gatherAddresses | ( | ) | const [virtual] |
Utility function: Returns a vector of all addresses of the node.
Implements IRoutingTable.
00236 { 00237 std::vector<IPAddress> addressvector; 00238 00239 for (int i=0; i<ift->getNumInterfaces(); ++i) 00240 addressvector.push_back(ift->getInterface(i)->ipv4Data()->getIPAddress()); 00241 return addressvector; 00242 }
IInterfaceTable* RoutingTable::ift [protected] |
NotificationBoard* RoutingTable::nb [protected] |
Referenced by addRoute(), deleteRoute(), and initialize().
IPAddress RoutingTable::routerId [protected] |
Referenced by configureRouterId(), initialize(), and updateDisplayString().
bool RoutingTable::IPForward [protected] |
Referenced by initialize().
RouteVector RoutingTable::routes [protected] |
RouteVector RoutingTable::multicastRoutes [protected] |
Referenced by addRoute(), deleteRoute(), getMulticastRoutesFor(), getNumRoutes(), getRoute(), initialize(), updateDisplayString(), and ~RoutingTable().
RoutingCache RoutingTable::routingCache [mutable, protected] |
Referenced by findBestMatchingRoute(), and invalidateCache().
AddressSet RoutingTable::localAddresses [mutable, protected] |
Referenced by invalidateCache(), and isLocalAddress().