INET Framework for OMNeT++/OMNEST
AnsaIPv6Route Class Reference

#include <ansaRoutingTable6.h>

Inheritance diagram for AnsaIPv6Route:
IPv6Route

List of all members.

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

Detailed Description

Definition at line 24 of file ansaRoutingTable6.h.


Constructor & Destructor Documentation

AnsaIPv6Route::AnsaIPv6Route ( IPv6Address  destPrefix,
int  length,
RouteSrc  src 
) [inline]

Definition at line 30 of file ansaRoutingTable6.h.

: IPv6Route(destPrefix, length, src){};

Member Function Documentation

const char* AnsaIPv6Route::getInterfaceName ( ) const [inline]

Definition at line 37 of file ansaRoutingTable6.h.

Referenced by printRoute().

{ return _interfaceName.c_str();    }
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]
void AnsaIPv6Route::setInterfaceName ( const char *  interfaceName) [inline]

Definition at line 36 of file ansaRoutingTable6.h.

Referenced by AnsaRoutingTable6::addRoute().

{ _interfaceName = interfaceName;   }

Member Data Documentation

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().


The documentation for this class was generated from the following files: