Public Member Functions

IRoutingTable Class Reference

#include <IRoutingTable.h>

Inheritance diagram for IRoutingTable:
RoutingTable

List of all members.

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 InterfaceEntrygetInterfaceByAddress (const IPAddress &address) const =0
Routing functions (query the route table)

virtual bool isLocalAddress (const IPAddress &dest) const =0
virtual const IPRoutefindBestMatchingRoute (const IPAddress &dest) const =0
virtual InterfaceEntrygetInterfaceForDestAddr (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 IPRoutegetRoute (int k) const =0
virtual const IPRoutefindRoute (const IPAddress &target, const IPAddress &netmask, const IPAddress &gw, int metric=0, const char *dev=NULL) const =0
virtual const IPRoutegetDefaultRoute () const =0
virtual void addRoute (const IPRoute *entry)=0
virtual bool deleteRoute (const IPRoute *entry)=0
virtual std::vector< IPAddressgatherAddresses () const =0

Detailed Description

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.

See also:
IRoutingTable, IPRoute

Definition at line 45 of file IRoutingTable.h.


Constructor & Destructor Documentation

virtual IRoutingTable::~IRoutingTable (  )  [inline, virtual]

Definition at line 48 of file IRoutingTable.h.

{};


Member Function Documentation

virtual void IRoutingTable::addRoute ( const IPRoute entry  )  [pure virtual]
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]
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 bool IRoutingTable::isIPForwardingEnabled (  )  [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.

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().


The documentation for this class was generated from the following file: