INET Framework for OMNeT++/OMNEST
inet::IIPv4RoutingTable Class Referenceabstract

A C++ interface to abstract the functionality of IIPv4RoutingTable. More...

#include <IIPv4RoutingTable.h>

Inheritance diagram for inet::IIPv4RoutingTable:
inet::IRoutingTable inet::IPv4RoutingTable

Public Member Functions

virtual ~IIPv4RoutingTable ()
 
virtual void printMulticastRoutingTable () const =0
 For debugging. More...
 
virtual cModule * getHostModule ()=0
 Returns the host or router this routing table lives in. More...
 
virtual IPv4Address getRouterId () const =0
 Returns routerId. More...
 
virtual void setRouterId (IPv4Address a)=0
 Sets routerId. More...
 
Interfaces
virtual void configureInterfaceForIPv4 (InterfaceEntry *ie)=0
 
virtual InterfaceEntrygetInterfaceByAddress (const IPv4Address &address) const =0
 Returns an interface given by its address. More...
 
Routing functions (query the route table)
virtual bool isLocalAddress (const IPv4Address &dest) const =0
 Checks if the address is a local one, i.e. More...
 
virtual bool isLocalBroadcastAddress (const IPv4Address &dest) const =0
 Checks if the address is a local network broadcast address, i.e. More...
 
virtual InterfaceEntryfindInterfaceByLocalBroadcastAddress (const IPv4Address &dest) const =0
 Returns the interface entry having the specified address as its local broadcast address. More...
 
virtual IPv4RoutefindBestMatchingRoute (const IPv4Address &dest) const =0
 The routing function. More...
 
virtual InterfaceEntrygetInterfaceForDestAddr (const IPv4Address &dest) const =0
 Convenience function based on findBestMatchingRoute(). More...
 
virtual IPv4Address getGatewayForDestAddr (const IPv4Address &dest) const =0
 Convenience function based on findBestMatchingRoute(). More...
 
Multicast routing functions
virtual bool isLocalMulticastAddress (const IPv4Address &dest) const =0
 Checks if the address is in one of the local multicast group address list. More...
 
virtual const IPv4MulticastRoutefindBestMatchingMulticastRoute (const IPv4Address &origin, const IPv4Address &group) const =0
 Returns route for a multicast origin and group. More...
 
Route table manipulation
virtual IPv4RoutegetRoute (int k) const override=0
 Returns the kth route. More...
 
virtual IPv4RoutegetDefaultRoute () const override=0
 Finds and returns the default route, or nullptr if it doesn't exist. More...
 
virtual void addRoute (IPv4Route *entry)=0
 Adds a route to the routing table. More...
 
virtual IPv4RouteremoveRoute (IPv4Route *entry)=0
 Removes the given route from the routing table, and returns it. More...
 
virtual bool deleteRoute (IPv4Route *entry)=0
 Deletes the given route from the routing table. More...
 
virtual IPv4MulticastRoutegetMulticastRoute (int k) const override=0
 Returns the kth multicast route. More...
 
virtual void addMulticastRoute (IPv4MulticastRoute *entry)=0
 Adds a multicast route to the routing table. More...
 
virtual IPv4MulticastRouteremoveMulticastRoute (IPv4MulticastRoute *entry)=0
 Removes the given route from the routing table, and returns it. More...
 
virtual bool deleteMulticastRoute (IPv4MulticastRoute *entry)=0
 Deletes the given multicast route from the routing table. More...
 
virtual void purge ()=0
 Deletes invalid routes from the routing table. More...
 
virtual std::vector< IPv4AddressgatherAddresses () const =0
 Utility function: Returns a vector of all addresses of the node. More...
 
virtual void routeChanged (IPv4Route *entry, int fieldCode)=0
 To be called from route objects whenever a field changes. More...
 
virtual void multicastRouteChanged (IPv4MulticastRoute *entry, int fieldCode)=0
 To be called from multicast route objects whenever a field changes. More...
 
- Public Member Functions inherited from inet::IRoutingTable
virtual ~IRoutingTable ()
 
virtual IRoutecreateRoute ()=0
 
virtual bool isForwardingEnabled () const =0
 Forwarding on/off. More...
 
virtual bool isMulticastForwardingEnabled () const =0
 Multicast forwarding on/off. More...
 
virtual L3Address getRouterIdAsGeneric () const =0
 Returns routerId. More...
 
virtual bool isLocalAddress (const L3Address &dest) const =0
 Checks if the address is a local one, i.e. More...
 
virtual InterfaceEntrygetInterfaceByAddress (const L3Address &address) const =0
 Returns an interface given by its address. More...
 
virtual void printRoutingTable () const =0
 Prints the routing table. More...
 
virtual IRoutefindBestMatchingRoute (const L3Address &dest) const =0
 The routing function. More...
 
virtual InterfaceEntrygetOutputInterfaceForDestination (const L3Address &dest) const =0
 Convenience function based on findBestMatchingRoute(). More...
 
virtual L3Address getNextHopForDestination (const L3Address &dest) const =0
 Convenience function based on findBestMatchingRoute(). More...
 
virtual bool isLocalMulticastAddress (const L3Address &dest) const =0
 Checks if the address is in one of the local multicast group address list. More...
 
virtual IMulticastRoutefindBestMatchingMulticastRoute (const L3Address &origin, const L3Address &group) const =0
 Returns route for a multicast origin and group. More...
 
virtual int getNumRoutes () const =0
 Returns the total number of unicast routes. More...
 
virtual void addRoute (IRoute *entry)=0
 Adds a route to the routing table. More...
 
virtual IRouteremoveRoute (IRoute *entry)=0
 Removes the given route from the routing table, and returns it. More...
 
virtual bool deleteRoute (IRoute *entry)=0
 Deletes the given route from the routing table. More...
 
virtual int getNumMulticastRoutes () const =0
 Returns the total number of multicast routes. More...
 
virtual void addMulticastRoute (IMulticastRoute *entry)=0
 Adds a multicast route to the routing table. More...
 
virtual IMulticastRouteremoveMulticastRoute (IMulticastRoute *entry)=0
 Removes the given route from the routing table, and returns it. More...
 
virtual bool deleteMulticastRoute (IMulticastRoute *entry)=0
 Deletes the given multicast route from the routing table. More...
 

Detailed Description

A C++ interface to abstract the functionality of IIPv4RoutingTable.

Referring to IIPv4RoutingTable via this interface makes it possible to transparently replace IIPv4RoutingTable with a different implementation, without any change to the base INET.

See also
IIPv4RoutingTable, IPv4Route

Constructor & Destructor Documentation

virtual inet::IIPv4RoutingTable::~IIPv4RoutingTable ( )
inlinevirtual
42 {};

Member Function Documentation

virtual void inet::IIPv4RoutingTable::addMulticastRoute ( IPv4MulticastRoute entry)
pure virtual

Adds a multicast route to the routing table.

Routes are allowed to be modified while in the routing table. (There is a notification mechanism that allows routing table internals to be updated on a routing entry change.)

Implemented in inet::IPv4RoutingTable.

Referenced by inet::PIMSM::addNewRouteG(), and inet::PIMSM::addNewRouteSG().

virtual void inet::IIPv4RoutingTable::addRoute ( IPv4Route entry)
pure virtual

Adds a route to the routing table.

Routes are allowed to be modified while in the routing table. (There is a notification mechanism that allows routing table internals to be updated on a routing entry change.)

Implemented in inet::IPv4RoutingTable.

Referenced by inet::FlatNetworkConfigurator::addDefaultRoutes(), inet::ospf::Router::addExternalRouteInIPTable(), inet::DHCPClient::bindLease(), inet::bgp::BGPRouting::decisionProcess(), inet::FlatNetworkConfigurator::fillRoutingTables(), inet::RoutingTableParser::parseRouting(), inet::TED::rebuildRoutingTable(), inet::ospf::Router::rebuildRoutingTable(), and inet::ospf::Router::updateExternalRoute().

virtual void inet::IIPv4RoutingTable::configureInterfaceForIPv4 ( InterfaceEntry ie)
pure virtual

Implemented in inet::IPv4RoutingTable.

virtual bool inet::IIPv4RoutingTable::deleteMulticastRoute ( IPv4MulticastRoute entry)
pure virtual

Deletes the given multicast route from the routing table.

Returns true if the route was deleted, and false if it was not in the routing table.

Implemented in inet::IPv4RoutingTable.

Referenced by inet::PIMSM::clearRoutes(), and inet::PIMSM::deleteMulticastRoute().

virtual bool inet::IIPv4RoutingTable::deleteRoute ( IPv4Route entry)
pure virtual

Deletes the given route from the routing table.

Returns true if the route was deleted, and false if it was not in the routing table.

Implemented in inet::IPv4RoutingTable.

Referenced by inet::bgp::BGPRouting::decisionProcess(), inet::bgp::BGPRouting::deleteBGPRoutingEntry(), inet::TED::rebuildRoutingTable(), inet::ospf::Router::rebuildRoutingTable(), and inet::DHCPClient::unbindLease().

virtual const IPv4MulticastRoute* inet::IIPv4RoutingTable::findBestMatchingMulticastRoute ( const IPv4Address origin,
const IPv4Address group 
) const
pure virtual

Returns route for a multicast origin and group.

Implemented in inet::IPv4RoutingTable.

Referenced by inet::IPv4::forwardMulticastPacket().

virtual IPv4Route* inet::IIPv4RoutingTable::findBestMatchingRoute ( const IPv4Address dest) const
pure virtual

The routing function.

Performs longest prefix match for the given destination address, and returns the resulting route. Returns nullptr if there is no matching route.

Implemented in inet::IPv4RoutingTable.

Referenced by inet::PIMSM::addNewRouteG(), inet::PIMSM::addNewRouteSG(), inet::visualizer::RoutingTableVisualizerBase::addRouteVisualizations(), inet::IPv4::determineOutgoingInterfaceForMulticastDatagram(), inet::IPv4::routeUnicastPacket(), and inet::PIMSM::unroutableMulticastPacketArrived().

virtual InterfaceEntry* inet::IIPv4RoutingTable::findInterfaceByLocalBroadcastAddress ( const IPv4Address dest) const
pure virtual

Returns the interface entry having the specified address as its local broadcast address.

Implemented in inet::IPv4RoutingTable.

Referenced by inet::IPv4::preroutingFinish().

virtual std::vector<IPv4Address> inet::IIPv4RoutingTable::gatherAddresses ( ) const
pure virtual

Utility function: Returns a vector of all addresses of the node.

Implemented in inet::IPv4RoutingTable.

virtual IPv4Route* inet::IIPv4RoutingTable::getDefaultRoute ( ) const
overridepure virtual

Finds and returns the default route, or nullptr if it doesn't exist.

Implements inet::IRoutingTable.

Implemented in inet::IPv4RoutingTable.

virtual IPv4Address inet::IIPv4RoutingTable::getGatewayForDestAddr ( const IPv4Address dest) const
pure virtual

Convenience function based on findBestMatchingRoute().

Returns the gateway for the destination address. Returns the unspecified address if the destination is not in routing table or the gateway field is not filled in in the route.

Implemented in inet::IPv4RoutingTable.

virtual cModule* inet::IIPv4RoutingTable::getHostModule ( )
pure virtual

Returns the host or router this routing table lives in.

Implemented in inet::IPv4RoutingTable.

virtual InterfaceEntry* inet::IIPv4RoutingTable::getInterfaceByAddress ( const IPv4Address address) const
pure virtual

Returns an interface given by its address.

Returns nullptr if not found.

Implemented in inet::IPv4RoutingTable.

Referenced by inet::IPv4::determineOutgoingInterfaceForMulticastDatagram(), inet::IPv4::encapsulate(), inet::TED::initializeTED(), and inet::TED::rebuildRoutingTable().

virtual IPv4MulticastRoute* inet::IIPv4RoutingTable::getMulticastRoute ( int  k) const
overridepure virtual
virtual bool inet::IIPv4RoutingTable::isLocalAddress ( const IPv4Address dest) const
pure virtual
virtual bool inet::IIPv4RoutingTable::isLocalBroadcastAddress ( const IPv4Address dest) const
pure virtual

Checks if the address is a local network broadcast address, i.e.

one of the broadcast addresses derived from the interface addresses and netmasks.

Implemented in inet::IPv4RoutingTable.

Referenced by inet::IPv4::datagramLocalOut(), and inet::ICMP::possiblyLocalBroadcast().

virtual bool inet::IIPv4RoutingTable::isLocalMulticastAddress ( const IPv4Address dest) const
pure virtual

Checks if the address is in one of the local multicast group address list.

Implemented in inet::IPv4RoutingTable.

virtual void inet::IIPv4RoutingTable::multicastRouteChanged ( IPv4MulticastRoute entry,
int  fieldCode 
)
pure virtual

To be called from multicast route objects whenever a field changes.

Used for maintaining internal data structures and firing "routing table changed" notifications.

Implemented in inet::IPv4RoutingTable.

Referenced by inet::IPv4MulticastRoute::changed().

virtual void inet::IIPv4RoutingTable::printMulticastRoutingTable ( ) const
pure virtual

For debugging.

Implemented in inet::IPv4RoutingTable.

virtual void inet::IIPv4RoutingTable::purge ( )
pure virtual

Deletes invalid routes from the routing table.

Invalid routes are those where the isValid() method returns false.

Implemented in inet::IPv4RoutingTable.

virtual IPv4MulticastRoute* inet::IIPv4RoutingTable::removeMulticastRoute ( IPv4MulticastRoute entry)
pure virtual

Removes the given route from the routing table, and returns it.

nullptr is returned of the route was not in the routing table.

Implemented in inet::IPv4RoutingTable.

virtual IPv4Route* inet::IIPv4RoutingTable::removeRoute ( IPv4Route entry)
pure virtual

Removes the given route from the routing table, and returns it.

nullptr is returned of the route was not in the routing table.

Implemented in inet::IPv4RoutingTable.

virtual void inet::IIPv4RoutingTable::routeChanged ( IPv4Route entry,
int  fieldCode 
)
pure virtual

To be called from route objects whenever a field changes.

Used for maintaining internal data structures and firing "routing table changed" notifications.

Implemented in inet::IPv4RoutingTable.

Referenced by inet::IPv4Route::changed().

virtual void inet::IIPv4RoutingTable::setRouterId ( IPv4Address  a)
pure virtual

Sets routerId.

Implemented in inet::IPv4RoutingTable.


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