|
INET Framework for OMNeT++/OMNEST
|
#include <IPRoute.h>
Public Types | |
| enum | RouteType { DIRECT, REMOTE } |
| enum | RouteSource { MANUAL, IFACENETMASK, RIP, OSPF, BGP, ZEBRA } |
Public Member Functions | |
| IPRoute () | |
| virtual | ~IPRoute () |
| virtual std::string | info () const |
| virtual std::string | detailedInfo () const |
| void | setHost (IPAddress host) |
| void | setNetmask (IPAddress netmask) |
| void | setGateway (IPAddress gateway) |
| void | setInterface (InterfaceEntry *interfacePtr) |
| void | setType (RouteType type) |
| void | setSource (RouteSource source) |
| void | setMetric (int metric) |
| IPAddress | getHost () const |
| IPAddress | getNetmask () const |
| IPAddress | getGateway () const |
| InterfaceEntry * | getInterface () const |
| const char * | getInterfaceName () const |
| RouteType | getType () const |
| RouteSource | getSource () const |
| int | getMetric () const |
Protected Attributes | |
| IPAddress | host |
| Destination. | |
| IPAddress | netmask |
| Route mask. | |
| IPAddress | gateway |
| Next hop. | |
| InterfaceEntry * | interfacePtr |
| interface | |
| RouteType | type |
| direct or remote | |
| RouteSource | source |
| manual, routing prot, etc. | |
| int | metric |
| Metric ("cost" to reach the destination) | |
Private Member Functions | |
| IPRoute (const IPRoute &obj) | |
| IPRoute & | operator= (const IPRoute &obj) |
IPv4 route in IRoutingTable.
| enum IPRoute::RouteSource |
Specifies where the route comes from
| enum IPRoute::RouteType |
| IPRoute::IPRoute | ( | const IPRoute & | obj | ) | [private] |
| IPRoute::IPRoute | ( | ) |
Definition at line 25 of file IPRoute.cc.
| virtual IPRoute::~IPRoute | ( | ) | [inline, virtual] |
| std::string IPRoute::detailedInfo | ( | void | ) | const [virtual] |
Definition at line 56 of file IPRoute.cc.
Referenced by RoutingTable::printRoutingTable(), and AnsaRoutingTable::printRoutingTable().
{
return std::string();
}
| IPAddress IPRoute::getGateway | ( | ) | const [inline] |
Next hop address
Definition at line 89 of file IPRoute.h.
Referenced by NetworkInfo::dumpRoutingInfo(), RoutingTable::getMulticastRoutesFor(), AnsaRoutingTable::getMulticastRoutesFor(), TED::initialize(), AnsaRoutingTable::otherIPRouteFormat(), RIPRouting::processResponse(), RoutingTableXmlParser::readStaticRouteFromXml(), LDP::rebuildFecList(), TED::rebuildRoutingTable(), RIPRouting::receiveChangeNotification(), RoutingTable::routeMatches(), AnsaRoutingTable::routeMatches(), and IP::routePacket().
{return gateway;}
| IPAddress IPRoute::getHost | ( | ) | const [inline] |
Destination address prefix to match
Definition at line 83 of file IPRoute.h.
Referenced by RoutingTable::addRoute(), AnsaRoutingTable::addRoute(), AnsaRoutingTable::checkRoute(), AnsaRoutingTable::directIPRouteFormat(), AnsaRoutingTable::dsdvTestAndDelete(), NetworkInfo::dumpRoutingInfo(), RIPRouting::fillNetworks(), RoutingTable::findBestMatchingRoute(), AnsaRoutingTable::findBestMatchingRoute(), LDP::findPeerAddrFromInterface(), RoutingTable::getMulticastRoutesFor(), AnsaRoutingTable::getMulticastRoutesFor(), RIPRouting::getOSPFRoutes(), TED::initialize(), AnsaRoutingTable::matchHostMask(), operator<<(), AnsaRoutingTable::otherIPRouteFormat(), RIPRouting::processResponse(), LDP::rebuildFecList(), TED::rebuildRoutingTable(), RIPRouting::receiveChangeNotification(), RoutingTable::routeMatches(), AnsaRoutingTable::routeMatches(), AnsaRoutingTable::testValidity(), AnsaOSPF::Router::UpdateExternalRoute(), and OSPF::Router::UpdateExternalRoute().
{return host;}
| InterfaceEntry* IPRoute::getInterface | ( | ) | const [inline] |
Next hop interface
Definition at line 92 of file IPRoute.h.
Referenced by RoutingTable::addRoute(), AnsaRoutingTable::addRoute(), RoutingTable::deleteInterfaceRoutes(), AnsaRoutingTable::deleteInterfaceRoutes(), NetworkInfo::dumpRoutingInfo(), RIPRouting::fillNetworks(), LDP::findPeerAddrFromInterface(), RoutingTable::getMulticastRoutesFor(), AnsaRoutingTable::getMulticastRoutesFor(), TED::initialize(), RIPRouting::receiveChangeNotification(), IP::routePacket(), and RIPRouting::sendPacket().
{return interfacePtr;}
| const char * IPRoute::getInterfaceName | ( | ) | const |
Convenience method
Definition at line 61 of file IPRoute.cc.
Referenced by AnsaRoutingTable::directIPRouteFormat(), NetworkInfo::dumpRoutingInfo(), TED::rebuildRoutingTable(), RoutingTable::routeMatches(), and AnsaRoutingTable::routeMatches().
{
return interfacePtr ? interfacePtr->getName() : "";
}
| int IPRoute::getMetric | ( | ) | const [inline] |
"Cost" to reach the destination
Definition at line 104 of file IPRoute.h.
Referenced by NetworkInfo::dumpRoutingInfo(), RIPRouting::fillNetworks(), AnsaRoutingTable::generateShowIPRoute(), AnsaRoutingTable::otherIPRouteFormat(), RIPRouting::processResponse(), RoutingTable::routeMatches(), and AnsaRoutingTable::routeMatches().
{return metric;}
| IPAddress IPRoute::getNetmask | ( | ) | const [inline] |
Represents length of prefix to match
Definition at line 86 of file IPRoute.h.
Referenced by RoutingTable::addRoute(), AnsaRoutingTable::addRoute(), AnsaRoutingTable::checkRoute(), AnsaRoutingTable::directIPRouteFormat(), NetworkInfo::dumpRoutingInfo(), RoutingTable::findBestMatchingRoute(), AnsaRoutingTable::findBestMatchingRoute(), RoutingTable::getMulticastRoutesFor(), AnsaRoutingTable::getMulticastRoutesFor(), AnsaRoutingTable::matchHostMask(), AnsaRoutingTable::otherIPRouteFormat(), LDP::rebuildFecList(), RIPRouting::receiveChangeNotification(), RoutingTable::routeMatches(), AnsaRoutingTable::routeMatches(), AnsaOSPF::Router::UpdateExternalRoute(), and OSPF::Router::UpdateExternalRoute().
{return netmask;}
| RouteSource IPRoute::getSource | ( | ) | const [inline] |
Source of route. MANUAL (read from file), from routing protocol, etc
Definition at line 101 of file IPRoute.h.
Referenced by AnsaRoutingTable::checkRoute(), AnsaRoutingTable::directIPRouteFormat(), NetworkInfo::dumpRoutingInfo(), RIPRouting::fillNetworks(), AnsaRoutingTable::generateShowIPRoute(), RIPRouting::getOSPFRoutes(), and AnsaRoutingTable::otherIPRouteFormat().
{return source;}
| RouteType IPRoute::getType | ( | ) | const [inline] |
Route type: Direct or Remote
Definition at line 98 of file IPRoute.h.
Referenced by TED::initialize(), RIPRouting::processPacket(), LDP::rebuildFecList(), and RIPRouting::receiveChangeNotification().
{return type;}
| std::string IPRoute::info | ( | ) | const [virtual] |
Definition at line 34 of file IPRoute.cc.
Referenced by operator<<(), RIPRouting::processResponse(), and RIPRouting::receiveChangeNotification().
{
std::stringstream out;
out << "dest:"; if (host.isUnspecified()) out << "* "; else out << host << " ";
out << "gw:"; if (gateway.isUnspecified()) out << "* "; else out << gateway << " ";
out << "mask:"; if (netmask.isUnspecified()) out << "* "; else out << netmask << " ";
out << "metric:" << metric << " ";
out << "if:"; if (!interfacePtr) out << "* "; else out << interfacePtr->getName() << " ";
out << (type==DIRECT ? "DIRECT" : "REMOTE");
switch (source)
{
case MANUAL: out << " MANUAL"; break;
case IFACENETMASK: out << " IFACENETMASK"; break;
case RIP: out << " RIP"; break;
case OSPF: out << " OSPF"; break;
case BGP: out << " BGP"; break;
case ZEBRA: out << " ZEBRA"; break;
default: out << " ???"; break;
}
return out.str();
}
| void IPRoute::setGateway | ( | IPAddress | gateway | ) | [inline] |
Definition at line 76 of file IPRoute.h.
Referenced by NetworkConfigurator::addPointToPointPeerRoutes(), RoutingTableParser::parseRouting(), RIPRouting::processResponse(), RoutingTableXmlParser::readStaticRouteFromXml(), TED::rebuildRoutingTable(), RIPRouting::receiveChangeNotification(), RoutingTable::updateNetmaskRoutes(), and AnsaRoutingTable::updateNetmaskRoutes().
{this->gateway = gateway;}
| void IPRoute::setHost | ( | IPAddress | host | ) | [inline] |
Definition at line 74 of file IPRoute.h.
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), NetworkConfigurator::addPointToPointPeerRoutes(), FlatNetworkConfigurator::fillRoutingTables(), RoutingTableParser::parseRouting(), RIPRouting::processResponse(), RoutingTableXmlParser::readStaticRouteFromXml(), TED::rebuildRoutingTable(), RIPRouting::receiveChangeNotification(), AnsaOSPF::Router::UpdateExternalRoute(), OSPF::Router::UpdateExternalRoute(), RoutingTable::updateNetmaskRoutes(), and AnsaRoutingTable::updateNetmaskRoutes().
{this->host = host;}
| void IPRoute::setInterface | ( | InterfaceEntry * | interfacePtr | ) | [inline] |
Definition at line 77 of file IPRoute.h.
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), NetworkConfigurator::addPointToPointPeerRoutes(), FlatNetworkConfigurator::fillRoutingTables(), RoutingTableParser::parseRouting(), RIPRouting::processResponse(), RoutingTableXmlParser::readStaticRouteFromXml(), TED::rebuildRoutingTable(), RIPRouting::receiveChangeNotification(), AnsaOSPF::Router::UpdateExternalRoute(), OSPF::Router::UpdateExternalRoute(), RoutingTable::updateNetmaskRoutes(), and AnsaRoutingTable::updateNetmaskRoutes().
{this->interfacePtr = interfacePtr;}
| void IPRoute::setMetric | ( | int | metric | ) | [inline] |
Definition at line 80 of file IPRoute.h.
Referenced by RoutingTableParser::parseRouting(), RIPRouting::processResponse(), RoutingTableXmlParser::readStaticRouteFromXml(), TED::rebuildRoutingTable(), RIPRouting::receiveChangeNotification(), AnsaOSPF::Router::UpdateExternalRoute(), OSPF::Router::UpdateExternalRoute(), RoutingTable::updateNetmaskRoutes(), and AnsaRoutingTable::updateNetmaskRoutes().
| void IPRoute::setNetmask | ( | IPAddress | netmask | ) | [inline] |
Definition at line 75 of file IPRoute.h.
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), NetworkConfigurator::addPointToPointPeerRoutes(), FlatNetworkConfigurator::fillRoutingTables(), RoutingTableParser::parseRouting(), RIPRouting::processResponse(), RoutingTableXmlParser::readStaticRouteFromXml(), TED::rebuildRoutingTable(), RIPRouting::receiveChangeNotification(), AnsaOSPF::Router::UpdateExternalRoute(), OSPF::Router::UpdateExternalRoute(), RoutingTable::updateNetmaskRoutes(), and AnsaRoutingTable::updateNetmaskRoutes().
{this->netmask = netmask;}
| void IPRoute::setSource | ( | RouteSource | source | ) | [inline] |
Definition at line 79 of file IPRoute.h.
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), NetworkConfigurator::addPointToPointPeerRoutes(), FlatNetworkConfigurator::fillRoutingTables(), RIPRouting::processResponse(), TED::rebuildRoutingTable(), RIPRouting::receiveChangeNotification(), AnsaOSPF::Router::UpdateExternalRoute(), OSPF::Router::UpdateExternalRoute(), RoutingTable::updateNetmaskRoutes(), and AnsaRoutingTable::updateNetmaskRoutes().
| void IPRoute::setType | ( | RouteType | type | ) | [inline] |
Definition at line 78 of file IPRoute.h.
Referenced by NetworkConfigurator::addDefaultRoutes(), FlatNetworkConfigurator::addDefaultRoutes(), NetworkConfigurator::addPointToPointPeerRoutes(), FlatNetworkConfigurator::fillRoutingTables(), RoutingTableParser::parseRouting(), RIPRouting::processResponse(), TED::rebuildRoutingTable(), RIPRouting::receiveChangeNotification(), AnsaOSPF::Router::UpdateExternalRoute(), OSPF::Router::UpdateExternalRoute(), RoutingTable::updateNetmaskRoutes(), and AnsaRoutingTable::updateNetmaskRoutes().
IPAddress IPRoute::gateway [protected] |
Next hop.
Definition at line 57 of file IPRoute.h.
Referenced by info(), AnsaOSPF::RoutingTableEntry::RoutingTableEntry(), and OSPF::RoutingTableEntry::RoutingTableEntry().
IPAddress IPRoute::host [protected] |
Destination.
Definition at line 55 of file IPRoute.h.
Referenced by AnsaOSPF::RoutingTableEntry::GetDestinationID(), OSPF::RoutingTableEntry::GetDestinationID(), info(), AnsaOSPF::RoutingTableEntry::operator==(), OSPF::RoutingTableEntry::operator==(), AnsaOSPF::RoutingTableEntry::RoutingTableEntry(), OSPF::RoutingTableEntry::RoutingTableEntry(), AnsaOSPF::RoutingTableEntry::SetDestinationID(), and OSPF::RoutingTableEntry::SetDestinationID().
InterfaceEntry* IPRoute::interfacePtr [protected] |
interface
Definition at line 58 of file IPRoute.h.
Referenced by getInterfaceName(), info(), IPRoute(), AnsaOSPF::RoutingTableEntry::RoutingTableEntry(), and OSPF::RoutingTableEntry::RoutingTableEntry().
int IPRoute::metric [protected] |
Metric ("cost" to reach the destination)
Definition at line 61 of file IPRoute.h.
Referenced by info(), IPRoute(), AnsaOSPF::RoutingTableEntry::RoutingTableEntry(), and OSPF::RoutingTableEntry::RoutingTableEntry().
IPAddress IPRoute::netmask [protected] |
Route mask.
Definition at line 56 of file IPRoute.h.
Referenced by AnsaOSPF::RoutingTableEntry::GetAddressMask(), OSPF::RoutingTableEntry::GetAddressMask(), info(), AnsaOSPF::RoutingTableEntry::operator==(), OSPF::RoutingTableEntry::operator==(), AnsaOSPF::RoutingTableEntry::RoutingTableEntry(), OSPF::RoutingTableEntry::RoutingTableEntry(), AnsaOSPF::RoutingTableEntry::SetAddressMask(), and OSPF::RoutingTableEntry::SetAddressMask().
RouteSource IPRoute::source [protected] |
manual, routing prot, etc.
Definition at line 60 of file IPRoute.h.
Referenced by info(), IPRoute(), AnsaOSPF::RoutingTableEntry::RoutingTableEntry(), OSPF::RoutingTableEntry::RoutingTableEntry(), AnsaOSPF::RoutingTableEntry::SetArea(), and OSPF::RoutingTableEntry::SetArea().
RouteType IPRoute::type [protected] |
direct or remote
Definition at line 59 of file IPRoute.h.
Referenced by info(), IPRoute(), AnsaOSPF::RoutingTableEntry::RoutingTableEntry(), OSPF::RoutingTableEntry::RoutingTableEntry(), AnsaOSPF::RoutingTableEntry::SetDestinationType(), and OSPF::RoutingTableEntry::SetDestinationType().