|
INET Framework for OMNeT++/OMNEST
|
#include <ansaRoutingTable6.h>
Public Member Functions | |
| AnsaIPv6Route (IPv6Address destPrefix, int length, RouteSrc src) | |
| std::string | printRoute () const |
| bool | isActive () const |
| void | setActive (bool a) |
| void | setInterfaceName (const char *interfaceName) |
| const char * | getInterfaceName () const |
Protected Attributes | |
| bool | active |
| std::string | _interfaceName |
Definition at line 24 of file ansaRoutingTable6.h.
| AnsaIPv6Route::AnsaIPv6Route | ( | IPv6Address | destPrefix, |
| int | length, | ||
| RouteSrc | src | ||
| ) | [inline] |
Definition at line 30 of file ansaRoutingTable6.h.
: IPv6Route(destPrefix, length, src){};
| const char* AnsaIPv6Route::getInterfaceName | ( | ) | const [inline] |
Definition at line 37 of file ansaRoutingTable6.h.
Referenced by printRoute().
{ return _interfaceName.c_str(); }
| bool AnsaIPv6Route::isActive | ( | ) | const [inline] |
Definition at line 33 of file ansaRoutingTable6.h.
Referenced by printRoute(), AnsaRoutingTable6::receiveChangeNotification(), and AnsaRoutingTable6::routeLessThan().
{ return active; }
| std::string AnsaIPv6Route::printRoute | ( | ) | const |
Definition at line 34 of file ansaRoutingTable6.cc.
Referenced by operator<<().
{
std::stringstream out;
if (!isActive()){
out << "(down) ";
}
// first letter describes type of the route
// C - directly connected
// A - own advertise prefix
// S - static
// N - from NDP router advertisements
// P - routing protocol (RoutingTable6 does not have entries for specific protocols)
switch (getSrc()){
case STATIC:
if (getMetric() == 0){
out << "C";
}else{
out << "S";
}
break;
case OWN_ADV_PREFIX:
out << "A";
break;
case FROM_RA:
out << "N";
break;
case ROUTING_PROT:
out << "P";
break;
}
out << " ";
if (getDestPrefix() == IPv6Address::UNSPECIFIED_ADDRESS){
out << "::";
}else{
out << getDestPrefix();
}
out << "/" << getPrefixLength() << " ";
out << "[" << getMetric() << "] ";
out << "via ";
if (getNextHop() == IPv6Address::UNSPECIFIED_ADDRESS){
out << "::";
}else{
out << getNextHop();
}
if (getInterfaceId() != -1){
out << ", " << getInterfaceName();
}
return out.str();
}
| void AnsaIPv6Route::setActive | ( | bool | a | ) | [inline] |
Definition at line 34 of file ansaRoutingTable6.h.
Referenced by AnsaRoutingTable6::addRoute(), and AnsaRoutingTable6::receiveChangeNotification().
{ active = a; }
| void AnsaIPv6Route::setInterfaceName | ( | const char * | interfaceName | ) | [inline] |
Definition at line 36 of file ansaRoutingTable6.h.
Referenced by AnsaRoutingTable6::addRoute().
{ _interfaceName = interfaceName; }
std::string AnsaIPv6Route::_interfaceName [protected] |
Definition at line 27 of file ansaRoutingTable6.h.
Referenced by getInterfaceName(), and setInterfaceName().
bool AnsaIPv6Route::active [protected] |
Definition at line 26 of file ansaRoutingTable6.h.
Referenced by isActive(), and setActive().