#include <IRoutingTable.h>
Public Member Functions | |
virtual | ~IRoutingTable () |
virtual void | printRoutingTable () const =0 |
virtual bool | isIPForwardingEnabled ()=0 |
virtual IPAddress | getRouterId ()=0 |
virtual void | setRouterId (IPAddress a)=0 |
Interfaces | |
virtual void | configureInterfaceForIPv4 (InterfaceEntry *ie)=0 |
virtual InterfaceEntry * | getInterfaceByAddress (const IPAddress &address) const =0 |
Routing functions (query the route table) | |
virtual bool | isLocalAddress (const IPAddress &dest) const =0 |
virtual const IPRoute * | findBestMatchingRoute (const IPAddress &dest) const =0 |
virtual InterfaceEntry * | getInterfaceForDestAddr (const IPAddress &dest) const =0 |
virtual IPAddress | getGatewayForDestAddr (const IPAddress &dest) const =0 |
Multicast routing functions | |
virtual bool | isLocalMulticastAddress (const IPAddress &dest) const =0 |
virtual MulticastRoutes | getMulticastRoutesFor (const IPAddress &dest) const =0 |
Route table manipulation | |
virtual int | getNumRoutes () const =0 |
virtual const IPRoute * | getRoute (int k) const =0 |
virtual const IPRoute * | findRoute (const IPAddress &target, const IPAddress &netmask, const IPAddress &gw, int metric=0, const char *dev=NULL) const =0 |
virtual const IPRoute * | getDefaultRoute () const =0 |
virtual void | addRoute (const IPRoute *entry)=0 |
virtual bool | deleteRoute (const IPRoute *entry)=0 |
virtual std::vector< IPAddress > | gatherAddresses () const =0 |
virtual void IRoutingTable::printRoutingTable | ( | ) | const [pure virtual] |
For debugging
Implemented in RoutingTable.
virtual void IRoutingTable::configureInterfaceForIPv4 | ( | InterfaceEntry * | ie | ) | [pure virtual] |
Implemented in RoutingTable.
virtual InterfaceEntry* IRoutingTable::getInterfaceByAddress | ( | const IPAddress & | address | ) | const [pure virtual] |
Returns an interface given by its address. Returns NULL if not found.
Implemented in RoutingTable.
Referenced by RSVP::commitResv(), IP::encapsulate(), TED::initialize(), and TED::rebuildRoutingTable().
virtual bool IRoutingTable::isIPForwardingEnabled | ( | ) | [pure virtual] |
IP forwarding on/off
Implemented in RoutingTable.
Referenced by RoutingTableParser::parseMulticastGroups(), IP::routeMulticastPacket(), and IP::routePacket().
virtual IPAddress IRoutingTable::getRouterId | ( | ) | [pure virtual] |
Returns routerId.
Implemented in RoutingTable.
Referenced by NetworkConfigurator::assignAddresses(), TED::initialize(), SimpleClassifier::initialize(), RSVP::initialize(), OSPFRouting::initialize(), LinkStateRouting::initialize(), LIBTable::initialize(), LDP::openTCPConnectionToPeer(), LDP::processHelloTimeout(), LDP::processLDPHello(), IP::routeMulticastPacket(), IPAddressResolver::routerIdOf(), LDP::sendHelloTo(), LDP::sendMapping(), LDP::sendMappingRequest(), and LDP::sendNotify().
virtual void IRoutingTable::setRouterId | ( | IPAddress | a | ) | [pure virtual] |
virtual bool IRoutingTable::isLocalAddress | ( | const IPAddress & | dest | ) | const [pure virtual] |
Checks if the address is a local one, i.e. one of the host's.
Implemented in RoutingTable.
Referenced by ARP::addressRecognized(), LDP::findInterfaceFromPeerAddr(), and IP::routePacket().
virtual InterfaceEntry* IRoutingTable::getInterfaceForDestAddr | ( | const IPAddress & | dest | ) | const [pure 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.
Implemented in RoutingTable.
Referenced by ARP::addressRecognized(), RSVP::commitResv(), RSVP::evalNextHopInterface(), LDP::findInterfaceFromPeerAddr(), LDP::locateNextHop(), SCTPAssociation::pmStartPathManagement(), IP::routeMulticastPacket(), and SCTPPathVariables::SCTPPathVariables().
virtual IPAddress IRoutingTable::getGatewayForDestAddr | ( | const IPAddress & | dest | ) | const [pure virtual] |
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).
Implemented in RoutingTable.
virtual bool IRoutingTable::isLocalMulticastAddress | ( | const IPAddress & | dest | ) | const [pure virtual] |
Checks if the address is in one of the local multicast group address list.
Implemented in RoutingTable.
Referenced by IP::routeMulticastPacket().
virtual MulticastRoutes IRoutingTable::getMulticastRoutesFor | ( | const IPAddress & | dest | ) | const [pure virtual] |
Returns routes for a multicast address.
Implemented in RoutingTable.
Referenced by IP::routeMulticastPacket().
virtual int IRoutingTable::getNumRoutes | ( | ) | const [pure virtual] |
Returns the total number of routes (unicast, multicast, plus the default route).
Implemented in RoutingTable.
Referenced by NetworkInfo::dumpRoutingInfo(), LDP::findPeerAddrFromInterface(), TED::initialize(), LDP::rebuildFecList(), TED::rebuildRoutingTable(), OSPF::Router::RebuildRoutingTable(), and OSPF::Router::UpdateExternalRoute().
virtual const IPRoute* IRoutingTable::getRoute | ( | int | k | ) | const [pure 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.
Implemented in RoutingTable.
Referenced by NetworkInfo::dumpRoutingInfo(), LDP::findPeerAddrFromInterface(), TED::initialize(), LDP::rebuildFecList(), TED::rebuildRoutingTable(), OSPF::Router::RebuildRoutingTable(), and OSPF::Router::UpdateExternalRoute().
virtual const IPRoute* IRoutingTable::findRoute | ( | const IPAddress & | target, | |
const IPAddress & | netmask, | |||
const IPAddress & | gw, | |||
int | metric = 0 , |
|||
const char * | dev = NULL | |||
) | const [pure virtual] |
Finds and returns the default route, or NULL if it doesn't exist
Implemented in RoutingTable.
virtual const IPRoute* IRoutingTable::getDefaultRoute | ( | ) | const [pure virtual] |
Finds and returns the default route, or NULL if it doesn't exist
Implemented in RoutingTable.
virtual void IRoutingTable::addRoute | ( | const IPRoute * | entry | ) | [pure virtual] |
Adds a route to the routing table. Note that once added, routes cannot be modified; you must delete and re-add them instead.
Implemented in RoutingTable.
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), NetworkConfigurator::addPointToPointPeerRoutes(), FlatNetworkConfigurator::fillRoutingTables(), RoutingTableParser::parseRouting(), TED::rebuildRoutingTable(), OSPF::Router::RebuildRoutingTable(), and OSPF::Router::UpdateExternalRoute().
virtual bool IRoutingTable::deleteRoute | ( | const IPRoute * | entry | ) | [pure 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.
Implemented in RoutingTable.
Referenced by TED::rebuildRoutingTable(), and OSPF::Router::RebuildRoutingTable().
virtual std::vector<IPAddress> IRoutingTable::gatherAddresses | ( | ) | const [pure virtual] |
Utility function: Returns a vector of all addresses of the node.
Implemented in RoutingTable.