#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 |
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) |
00038 { 00039 FROM_RA, 00040 OWN_ADV_PREFIX, 00041 STATIC, 00042 ROUTING_PROT, 00043 };
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.
00059 { 00060 _destPrefix = destPrefix; 00061 _length = length; 00062 _src = src; 00063 _interfaceID = -1; 00064 _expiryTime = 0; 00065 _metric = 0; 00066 }
std::string IPv6Route::info | ( | ) | const [virtual] |
Referenced by operator<<().
00032 { 00033 std::stringstream out; 00034 out << getDestPrefix() << "/" << getPrefixLength() << " --> "; 00035 out << "if=" << getInterfaceId() << " next hop:" << getNextHop(); // FIXME try printing interface name 00036 out << " " << routeSrcName(getSrc()); 00037 if (getExpiryTime()>0) 00038 out << " exp:" << getExpiryTime(); 00039 return out.str(); 00040 }
const char * IPv6Route::routeSrcName | ( | RouteSrc | src | ) | [static] |
Referenced by info().
00048 { 00049 switch (src) 00050 { 00051 case FROM_RA: return "FROM_RA"; 00052 case OWN_ADV_PREFIX: return "OWN_ADV_PREFIX"; 00053 case STATIC: return "STATIC"; 00054 case ROUTING_PROT: return "ROUTING_PROT"; 00055 default: return "???"; 00056 } 00057 }
void IPv6Route::setInterfaceId | ( | int | interfaceId | ) | [inline] |
Referenced by RoutingTable6::addDefaultRoute(), RoutingTable6::addOrUpdateOnLinkPrefix(), RoutingTable6::addOrUpdateOwnAdvPrefix(), and RoutingTable6::addStaticRoute().
00072 {_interfaceID = interfaceId;}
void IPv6Route::setNextHop | ( | const IPv6Address & | nextHop | ) | [inline] |
Referenced by RoutingTable6::addDefaultRoute(), and RoutingTable6::addStaticRoute().
00073 {_nextHop = nextHop;}
void IPv6Route::setExpiryTime | ( | simtime_t | expiryTime | ) | [inline] |
Referenced by RoutingTable6::addOrUpdateOnLinkPrefix(), and RoutingTable6::addOrUpdateOwnAdvPrefix().
00074 {_expiryTime = expiryTime;}
void IPv6Route::setMetric | ( | int | metric | ) | [inline] |
const IPv6Address& IPv6Route::getDestPrefix | ( | ) | const [inline] |
int IPv6Route::getPrefixLength | ( | ) | const [inline] |
RouteSrc IPv6Route::getSrc | ( | ) | const [inline] |
int IPv6Route::getInterfaceId | ( | ) | const [inline] |
Referenced by IPv6NeighbourDiscovery::determineNextHop(), info(), and IPv6::routePacket().
00080 {return _interfaceID;}
const IPv6Address& IPv6Route::getNextHop | ( | ) | const [inline] |
Referenced by IPv6NeighbourDiscovery::determineNextHop(), info(), and IPv6::routePacket().
00081 {return _nextHop;}
simtime_t IPv6Route::getExpiryTime | ( | ) | const [inline] |
int IPv6Route::getMetric | ( | ) | const [inline] |
IPv6Address IPv6Route::_destPrefix [protected] |
short IPv6Route::_length [protected] |
RouteSrc IPv6Route::_src [protected] |
int IPv6Route::_interfaceID [protected] |
IPv6Address IPv6Route::_nextHop [protected] |
simtime_t IPv6Route::_expiryTime [protected] |
int IPv6Route::_metric [protected] |