INET Framework for OMNeT++/OMNEST
|
A C++ interface to abstract the functionality of IIPv4RoutingTable. More...
#include <IIPv4RoutingTable.h>
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 InterfaceEntry * | getInterfaceByAddress (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 InterfaceEntry * | findInterfaceByLocalBroadcastAddress (const IPv4Address &dest) const =0 |
Returns the interface entry having the specified address as its local broadcast address. More... | |
virtual IPv4Route * | findBestMatchingRoute (const IPv4Address &dest) const =0 |
The routing function. More... | |
virtual InterfaceEntry * | getInterfaceForDestAddr (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 IPv4MulticastRoute * | findBestMatchingMulticastRoute (const IPv4Address &origin, const IPv4Address &group) const =0 |
Returns route for a multicast origin and group. More... | |
Route table manipulation | |
virtual IPv4Route * | getRoute (int k) const override=0 |
Returns the kth route. More... | |
virtual IPv4Route * | getDefaultRoute () 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 IPv4Route * | removeRoute (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 IPv4MulticastRoute * | getMulticastRoute (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 IPv4MulticastRoute * | removeMulticastRoute (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< IPv4Address > | gatherAddresses () 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 IRoute * | createRoute ()=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 InterfaceEntry * | getInterfaceByAddress (const L3Address &address) const =0 |
Returns an interface given by its address. More... | |
virtual void | printRoutingTable () const =0 |
Prints the routing table. More... | |
virtual IRoute * | findBestMatchingRoute (const L3Address &dest) const =0 |
The routing function. More... | |
virtual InterfaceEntry * | getOutputInterfaceForDestination (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 IMulticastRoute * | findBestMatchingMulticastRoute (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 IRoute * | removeRoute (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 IMulticastRoute * | removeMulticastRoute (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... | |
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.
|
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().
|
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().
|
pure virtual |
Implemented in inet::IPv4RoutingTable.
|
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().
|
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().
|
pure virtual |
Returns route for a multicast origin and group.
Implemented in inet::IPv4RoutingTable.
Referenced by inet::IPv4::forwardMulticastPacket().
|
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().
|
pure virtual |
Returns the interface entry having the specified address as its local broadcast address.
Implemented in inet::IPv4RoutingTable.
Referenced by inet::IPv4::preroutingFinish().
|
pure virtual |
Utility function: Returns a vector of all addresses of the node.
Implemented in inet::IPv4RoutingTable.
|
overridepure virtual |
Finds and returns the default route, or nullptr if it doesn't exist.
Implements inet::IRoutingTable.
Implemented in inet::IPv4RoutingTable.
|
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.
|
pure virtual |
Returns the host or router this routing table lives in.
Implemented in inet::IPv4RoutingTable.
|
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().
|
pure virtual |
Convenience function based on findBestMatchingRoute().
Returns the output interface for the packets with dest as destination address, or nullptr if the destination is not in routing table.
Implemented in inet::IPv4RoutingTable.
Referenced by inet::ARP::addressRecognized(), inet::bgp::BGPRouting::createSession(), inet::LDP::findInterfaceFromPeerAddr(), inet::bgp::BGPRouting::findNextSession(), inet::IPv4::getShortestPathInterfaceToSource(), inet::LDP::locateNextHop(), inet::PIMSM::multicastPacketForwarded(), inet::rtp::RTP::resolveMTU(), inet::PIMSM::sendPIMJoin(), inet::PIMSM::sendPIMPrune(), inet::PIMSM::sendPIMRegisterNull(), inet::PIMSM::sendPIMRegisterStop(), and inet::PIMSM::unroutableMulticastPacketArrived().
|
overridepure virtual |
Returns the kth multicast route.
Implements inet::IRoutingTable.
Implemented in inet::IPv4RoutingTable.
Referenced by inet::PIMSM::clearRoutes(), inet::IPv4NetworkConfigurator::dumpConfig(), and inet::PIMSM::findIPv4Route().
|
overridepure virtual |
Returns the kth route.
Implements inet::IRoutingTable.
Implemented in inet::IPv4RoutingTable.
Referenced by inet::ospf::Router::addExternalRouteInIPTable(), inet::DHCPClient::bindLease(), inet::bgp::BGPRouting::decisionProcess(), inet::IPv4NetworkConfigurator::dumpConfig(), inet::NetworkInfo::dumpRoutingInfo(), inet::LDP::findPeerAddrFromInterface(), inet::bgp::BGPRouting::isInRoutingTable(), inet::bgp::BGPRouting::ospfExist(), inet::LDP::rebuildFecList(), inet::TED::rebuildRoutingTable(), inet::ospf::Router::rebuildRoutingTable(), and inet::ospf::Router::updateExternalRoute().
|
pure virtual |
Returns routerId.
Implemented in inet::IPv4RoutingTable.
Referenced by inet::ospf::OSPFRouting::createOspfRouter(), inet::bgp::BGPRouting::createSession(), inet::SimpleClassifier::initialize(), inet::TED::initialize(), inet::TED::initializeTED(), inet::bgp::BGPRouting::loadConfigFromXML(), inet::LDP::openTCPConnectionToPeer(), inet::LDP::processHelloTimeout(), inet::LDP::processLDPHello(), inet::L3AddressResolver::routerIdOf(), inet::LDP::sendHelloTo(), inet::LDP::sendMapping(), inet::LDP::sendMappingRequest(), and inet::LDP::sendNotify().
|
pure virtual |
Checks if the address is a local one, i.e.
one of the host's.
Implemented in inet::IPv4RoutingTable.
Referenced by inet::ARP::addressRecognized(), inet::visualizer::RoutingTableVisualizerBase::addRouteVisualizations(), inet::IPv4::datagramLocalOut(), inet::LDP::findInterfaceFromPeerAddr(), and inet::IPv4::preroutingFinish().
|
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().
|
pure virtual |
Checks if the address is in one of the local multicast group address list.
Implemented in inet::IPv4RoutingTable.
|
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().
|
pure virtual |
For debugging.
Implemented in inet::IPv4RoutingTable.
|
pure virtual |
Deletes invalid routes from the routing table.
Invalid routes are those where the isValid() method returns false.
Implemented in inet::IPv4RoutingTable.
|
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.
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.
|
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().
|
pure virtual |
Sets routerId.
Implemented in inet::IPv4RoutingTable.