INET Framework for OMNeT++/OMNEST
IPRoute Class Reference

#include <IPRoute.h>

Inheritance diagram for IPRoute:
AnsaOSPF::RoutingTableEntry OSPF::RoutingTableEntry

List of all members.

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)

Detailed Description

IPv4 route in IRoutingTable.

See also:
IRoutingTable, IRoutingTable

Definition at line 33 of file IPRoute.h.


Member Enumeration Documentation

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

Definition at line 44 of file IPRoute.h.

Route type

Enumerator:
DIRECT 

Directly attached to the router.

REMOTE 

Reached through another router.

Definition at line 37 of file IPRoute.h.

    {
        DIRECT,  
        REMOTE   
    };

Constructor & Destructor Documentation

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

Definition at line 25 of file IPRoute.cc.

{
    interfacePtr = NULL;

    metric = 0;
    type = DIRECT;
    source = MANUAL;
}
virtual IPRoute::~IPRoute ( ) [inline, virtual]

Definition at line 70 of file IPRoute.h.

{}

Member Function Documentation

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

Definition at line 56 of file IPRoute.cc.

Referenced by RoutingTable::printRoutingTable(), and AnsaRoutingTable::printRoutingTable().

{
    return std::string();
}
RouteType IPRoute::getType ( ) const [inline]

Route type: Direct or Remote

Definition at line 98 of file IPRoute.h.

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

{return type;}
std::string IPRoute::info ( ) const [virtual]

Definition at line 34 of file IPRoute.cc.

Referenced by operator<<(), RIPRouting::processResponse(), and RIPRouting::receiveChangeNotification().

{
    std::stringstream out;
    out << "dest:"; if (host.isUnspecified()) out << "*  "; else out << host << "  ";
    out << "gw:"; if (gateway.isUnspecified()) out << "*  "; else out << gateway << "  ";
    out << "mask:"; if (netmask.isUnspecified()) out << "*  "; else out << netmask << "  ";
    out << "metric:" << metric << " ";
    out << "if:"; if (!interfacePtr) out << "*  "; else out << interfacePtr->getName() << "  ";
    out << (type==DIRECT ? "DIRECT" : "REMOTE");
    switch (source)
    {
        case MANUAL:       out << " MANUAL"; break;
        case IFACENETMASK: out << " IFACENETMASK"; break;
        case RIP:          out << " RIP"; break;
        case OSPF:         out << " OSPF"; break;
        case BGP:          out << " BGP"; break;
        case ZEBRA:        out << " ZEBRA"; break;
        default:           out << " ???"; break;
    }
    return out.str();
}
IPRoute& IPRoute::operator= ( const IPRoute obj) [private]

Member Data Documentation

int IPRoute::metric [protected]

Metric ("cost" to reach the destination)

Definition at line 61 of file IPRoute.h.

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


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