IPRoute Class Reference

#include <IPRoute.h>

Inheritance diagram for IPRoute:

OSPF::RoutingTableEntry

List of all members.


Detailed Description

IPv4 route in IRoutingTable.

See also:
IRoutingTable, IRoutingTable

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
InterfaceEntrygetInterface () 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.
InterfaceEntryinterfacePtr
 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)
IPRouteoperator= (const IPRoute &obj)

Member Enumeration Documentation

Route type

Enumerator:
DIRECT  Directly attached to the router.
REMOTE  Reached through another router.
00038     {
00039         DIRECT,  
00040         REMOTE   
00041     };

Specifies where the route comes from

Enumerator:
MANUAL  manually added static route
IFACENETMASK  comes from an interface's netmask
RIP  managed by the given routing protocol
OSPF  managed by the given routing protocol
BGP  managed by the given routing protocol
ZEBRA  managed by the Quagga/Zebra based model
00045     {
00046         MANUAL,       
00047         IFACENETMASK, 
00048         RIP,          
00049         OSPF,         
00050         BGP,          
00051         ZEBRA,        
00052     };


Constructor & Destructor Documentation

IPRoute::IPRoute ( const IPRoute obj  )  [private]

IPRoute::IPRoute (  ) 

00026 {
00027     interfacePtr = NULL;
00028 
00029     metric = 0;
00030     type = DIRECT;
00031     source = MANUAL;
00032 }

virtual IPRoute::~IPRoute (  )  [inline, virtual]

00070 {}


Member Function Documentation

IPRoute& IPRoute::operator= ( const IPRoute obj  )  [private]

std::string IPRoute::info (  )  const [virtual]

Referenced by operator<<().

00035 {
00036     std::stringstream out;
00037     out << "dest:"; if (host.isUnspecified()) out << "*  "; else out << host << "  ";
00038     out << "gw:"; if (gateway.isUnspecified()) out << "*  "; else out << gateway << "  ";
00039     out << "mask:"; if (netmask.isUnspecified()) out << "*  "; else out << netmask << "  ";
00040     out << "metric:" << metric << " ";
00041     out << "if:"; if (!interfacePtr) out << "*  "; else out << interfacePtr->getName() << "  ";
00042     out << (type==DIRECT ? "DIRECT" : "REMOTE");
00043     switch (source)
00044     {
00045         case MANUAL:       out << " MANUAL"; break;
00046         case IFACENETMASK: out << " IFACENETMASK"; break;
00047         case RIP:          out << " RIP"; break;
00048         case OSPF:         out << " OSPF"; break;
00049         case BGP:          out << " BGP"; break;
00050         case ZEBRA:        out << " ZEBRA"; break;
00051         default:           out << " ???"; break;
00052     }
00053     return out.str();
00054 }

std::string IPRoute::detailedInfo (  )  const [virtual]

Referenced by RoutingTable::printRoutingTable().

00057 {
00058     return std::string();
00059 }

void IPRoute::setHost ( IPAddress  host  )  [inline]

void IPRoute::setNetmask ( IPAddress  netmask  )  [inline]

void IPRoute::setGateway ( IPAddress  gateway  )  [inline]

void IPRoute::setInterface ( InterfaceEntry interfacePtr  )  [inline]

void IPRoute::setType ( RouteType  type  )  [inline]

void IPRoute::setSource ( RouteSource  source  )  [inline]

void IPRoute::setMetric ( int  metric  )  [inline]

IPAddress IPRoute::getHost (  )  const [inline]

IPAddress IPRoute::getNetmask (  )  const [inline]

IPAddress IPRoute::getGateway (  )  const [inline]

InterfaceEntry* IPRoute::getInterface (  )  const [inline]

const char * IPRoute::getInterfaceName (  )  const

Convenience method

Referenced by NetworkInfo::dumpRoutingInfo(), TED::rebuildRoutingTable(), and RoutingTable::routeMatches().

00062 {
00063     return interfacePtr ? interfacePtr->getName() : "";
00064 }

RouteType IPRoute::getType (  )  const [inline]

Route type: Direct or Remote

Referenced by TED::initialize(), and LDP::rebuildFecList().

00098 {return type;}

RouteSource IPRoute::getSource (  )  const [inline]

Source of route. MANUAL (read from file), from routing protocol, etc

Referenced by NetworkInfo::dumpRoutingInfo().

00101 {return source;}

int IPRoute::getMetric (  )  const [inline]

"Cost" to reach the destination

Referenced by NetworkInfo::dumpRoutingInfo(), and RoutingTable::routeMatches().

00104 {return metric;}


Member Data Documentation

IPAddress IPRoute::host [protected]

RouteType IPRoute::type [protected]

direct or remote

Referenced by info(), IPRoute(), and OSPF::RoutingTableEntry::RoutingTableEntry().

manual, routing prot, etc.

Referenced by info(), IPRoute(), and OSPF::RoutingTableEntry::RoutingTableEntry().

int IPRoute::metric [protected]


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

Generated on Fri Mar 20 18:51:19 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5