#include <RoutingTable6.h>
Public Types | |
| enum | RouteSrc { FROM_RA, OWN_ADV_PREFIX, STATIC, ROUTING_PROT } |
Public Member Functions | |
| IPv6Route (IPv6Address destPrefix, int length, RouteSrc src) | |
| virtual std::string | info () const |
| virtual std::string | detailedInfo () const |
| void | setInterfaceId (int interfaceId) |
| void | setNextHop (const IPv6Address &nextHop) |
| void | setExpiryTime (simtime_t expiryTime) |
| void | setMetric (int metric) |
| const IPv6Address & | getDestPrefix () const |
| int | getPrefixLength () const |
| RouteSrc | getSrc () const |
| int | getInterfaceId () const |
| const IPv6Address & | getNextHop () const |
| simtime_t | getExpiryTime () const |
| int | getMetric () const |
Static Public Member Functions | |
| static const char * | routeSrcName (RouteSrc src) |
Protected Attributes | |
| IPv6Address | _destPrefix |
| short | _length |
| RouteSrc | _src |
| int | _interfaceID |
| IPv6Address | _nextHop |
| simtime_t | _expiryTime |
| int | _metric |
Represents a route in the route table. Routes with src=FROM_RA represent on-link prefixes advertised by routers.
Definition at line 33 of file RoutingTable6.h.
| enum IPv6Route::RouteSrc |
Specifies where the route comes from
| FROM_RA |
on-link prefix, from Router Advertisement |
| OWN_ADV_PREFIX |
on routers: on-link prefix that the router **itself** advertises on the link |
| STATIC |
static route |
| ROUTING_PROT |
route is managed by a routing protocol (OSPF,BGP,etc) |
Definition at line 37 of file RoutingTable6.h.
{
FROM_RA,
OWN_ADV_PREFIX,
STATIC,
ROUTING_PROT,
};
| IPv6Route::IPv6Route | ( | IPv6Address | destPrefix, | |
| int | length, | |||
| RouteSrc | src | |||
| ) | [inline] |
Constructor. The destination prefix and the route source is passed to the constructor and cannot be changed afterwards.
Definition at line 59 of file RoutingTable6.h.
{
_destPrefix = destPrefix;
_length = length;
_src = src;
_interfaceID = -1;
_expiryTime = 0;
_metric = 0;
}
| std::string IPv6Route::detailedInfo | ( | ) | const [virtual] |
Definition at line 42 of file RoutingTable6.cc.
{
return std::string();
}
| const IPv6Address& IPv6Route::getDestPrefix | ( | ) | const [inline] |
| simtime_t IPv6Route::getExpiryTime | ( | ) | const [inline] |
| int IPv6Route::getInterfaceId | ( | ) | const [inline] |
Definition at line 80 of file RoutingTable6.h.
Referenced by IPv6NeighbourDiscovery::determineNextHop(), info(), and IPv6::routePacket().
{return _interfaceID;}
| int IPv6Route::getMetric | ( | ) | const [inline] |
Definition at line 83 of file RoutingTable6.h.
Referenced by RoutingTable6::routeLessThan().
{return _metric;}
| const IPv6Address& IPv6Route::getNextHop | ( | ) | const [inline] |
Definition at line 81 of file RoutingTable6.h.
Referenced by IPv6NeighbourDiscovery::determineNextHop(), info(), and IPv6::routePacket().
{return _nextHop;}
| int IPv6Route::getPrefixLength | ( | ) | const [inline] |
Definition at line 78 of file RoutingTable6.h.
Referenced by info(), and RoutingTable6::routeLessThan().
{return _length;}
| RouteSrc IPv6Route::getSrc | ( | ) | const [inline] |
Definition at line 79 of file RoutingTable6.h.
Referenced by RoutingTable6::addRoutingProtocolRoute(), and info().
{return _src;}
| std::string IPv6Route::info | ( | ) | const [virtual] |
Definition at line 31 of file RoutingTable6.cc.
Referenced by operator<<().
{
std::stringstream out;
out << getDestPrefix() << "/" << getPrefixLength() << " --> ";
out << "if=" << getInterfaceId() << " next hop:" << getNextHop(); // FIXME try printing interface name
out << " " << routeSrcName(getSrc());
if (getExpiryTime()>0)
out << " exp:" << getExpiryTime();
return out.str();
}
| const char * IPv6Route::routeSrcName | ( | RouteSrc | src | ) | [static] |
Definition at line 47 of file RoutingTable6.cc.
Referenced by info().
{
switch (src)
{
case FROM_RA: return "FROM_RA";
case OWN_ADV_PREFIX: return "OWN_ADV_PREFIX";
case STATIC: return "STATIC";
case ROUTING_PROT: return "ROUTING_PROT";
default: return "???";
}
}
| void IPv6Route::setExpiryTime | ( | simtime_t | expiryTime | ) | [inline] |
Definition at line 74 of file RoutingTable6.h.
Referenced by RoutingTable6::addOrUpdateOnLinkPrefix(), and RoutingTable6::addOrUpdateOwnAdvPrefix().
{_expiryTime = expiryTime;}
| void IPv6Route::setInterfaceId | ( | int | interfaceId | ) | [inline] |
Definition at line 72 of file RoutingTable6.h.
Referenced by RoutingTable6::addDefaultRoute(), RoutingTable6::addOrUpdateOnLinkPrefix(), RoutingTable6::addOrUpdateOwnAdvPrefix(), and RoutingTable6::addStaticRoute().
{_interfaceID = interfaceId;}
| void IPv6Route::setMetric | ( | int | metric | ) | [inline] |
Definition at line 75 of file RoutingTable6.h.
Referenced by RoutingTable6::addDefaultRoute(), RoutingTable6::addOrUpdateOnLinkPrefix(), RoutingTable6::addOrUpdateOwnAdvPrefix(), and RoutingTable6::addStaticRoute().
| void IPv6Route::setNextHop | ( | const IPv6Address & | nextHop | ) | [inline] |
Definition at line 73 of file RoutingTable6.h.
Referenced by RoutingTable6::addDefaultRoute(), and RoutingTable6::addStaticRoute().
{_nextHop = nextHop;}
IPv6Address IPv6Route::_destPrefix [protected] |
Definition at line 46 of file RoutingTable6.h.
simtime_t IPv6Route::_expiryTime [protected] |
Definition at line 51 of file RoutingTable6.h.
int IPv6Route::_interfaceID [protected] |
Definition at line 49 of file RoutingTable6.h.
short IPv6Route::_length [protected] |
Definition at line 47 of file RoutingTable6.h.
int IPv6Route::_metric [protected] |
Definition at line 52 of file RoutingTable6.h.
IPv6Address IPv6Route::_nextHop [protected] |
Definition at line 50 of file RoutingTable6.h.
RouteSrc IPv6Route::_src [protected] |
Definition at line 48 of file RoutingTable6.h.
1.7.1