#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 |
A C++ interface to abstract the functionality of IRoutingTable. Referring to IRoutingTable via this interface makes it possible to transparently replace IRoutingTable with a different implementation, without any change to the base INET.
Definition at line 45 of file IRoutingTable.h.
virtual IRoutingTable::~IRoutingTable | ( | ) | [inline, virtual] |
Definition at line 48 of file IRoutingTable.h.
{};
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.
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), NetworkConfigurator::addPointToPointPeerRoutes(), FlatNetworkConfigurator::fillRoutingTables(), RoutingTableParser::parseRouting(), TED::rebuildRoutingTable(), OSPF::Router::RebuildRoutingTable(), and OSPF::Router::UpdateExternalRoute().
virtual void IRoutingTable::configureInterfaceForIPv4 | ( | InterfaceEntry * | ie | ) | [pure virtual] |
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.
Referenced by TED::rebuildRoutingTable(), and OSPF::Router::RebuildRoutingTable().
virtual const IPRoute* IRoutingTable::findBestMatchingRoute | ( | const IPAddress & | dest | ) | const [pure virtual] |
The routing function.
Referenced by IP::routePacket().
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
virtual std::vector<IPAddress> IRoutingTable::gatherAddresses | ( | ) | const [pure virtual] |
Utility function: Returns a vector of all addresses of the node.
virtual const IPRoute* IRoutingTable::getDefaultRoute | ( | ) | const [pure virtual] |
Finds and returns the default route, or NULL if it doesn't exist
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).
virtual InterfaceEntry* IRoutingTable::getInterfaceByAddress | ( | const IPAddress & | address | ) | const [pure virtual] |
Returns an interface given by its address. Returns NULL if not found.
Referenced by RSVP::commitResv(), IP::encapsulate(), TED::initialize(), and TED::rebuildRoutingTable().
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.
Referenced by ARP::addressRecognized(), RSVP::commitResv(), RSVP::evalNextHopInterface(), LDP::findInterfaceFromPeerAddr(), LDP::locateNextHop(), SCTPAssociation::pmStartPathManagement(), IP::routeMulticastPacket(), and SCTPPathVariables::SCTPPathVariables().
virtual MulticastRoutes IRoutingTable::getMulticastRoutesFor | ( | const IPAddress & | dest | ) | const [pure virtual] |
Returns routes for a multicast address.
Referenced by IP::routeMulticastPacket().
virtual int IRoutingTable::getNumRoutes | ( | ) | const [pure virtual] |
Returns the total number of routes (unicast, multicast, plus the default route).
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.
Referenced by NetworkInfo::dumpRoutingInfo(), LDP::findPeerAddrFromInterface(), TED::initialize(), LDP::rebuildFecList(), TED::rebuildRoutingTable(), OSPF::Router::RebuildRoutingTable(), and OSPF::Router::UpdateExternalRoute().
virtual IPAddress IRoutingTable::getRouterId | ( | ) | [pure virtual] |
Returns routerId.
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 bool IRoutingTable::isIPForwardingEnabled | ( | ) | [pure virtual] |
IP forwarding on/off
Referenced by RoutingTableParser::parseMulticastGroups(), IP::routeMulticastPacket(), and IP::routePacket().
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.
Referenced by ARP::addressRecognized(), LDP::findInterfaceFromPeerAddr(), and IP::routePacket().
virtual bool IRoutingTable::isLocalMulticastAddress | ( | const IPAddress & | dest | ) | const [pure virtual] |
Checks if the address is in one of the local multicast group address list.
Referenced by IP::routeMulticastPacket().
virtual void IRoutingTable::printRoutingTable | ( | ) | const [pure virtual] |
For debugging
virtual void IRoutingTable::setRouterId | ( | IPAddress | a | ) | [pure virtual] |
Sets routerId.
Referenced by NetworkConfigurator::assignAddresses().