INET Framework for OMNeT++/OMNEST
inet::IRoute Class Referenceabstract

C++ interface for accessing unicast routing table entries of various protocols (IPv4, IPv6, etc) in a uniform way. More...

#include <IRoute.h>

Inheritance diagram for inet::IRoute:
inet::GenericRoute inet::IPv4Route inet::IPv6Route inet::bgp::RoutingTableEntry inet::ospf::RoutingTableEntry

Public Types

enum  SourceType {
  MANUAL, IFACENETMASK, ROUTER_ADVERTISEMENT, OWN_ADV_PREFIX,
  ICMP_REDIRECT, RIP, OSPF, BGP,
  ZEBRA, MANET, MANET2, DYMO,
  AODV
}
 Specifies where the route comes from. More...
 
enum  ChangeCodes {
  F_DESTINATION, F_PREFIX_LENGTH, F_NEXTHOP, F_IFACE,
  F_SOURCE, F_TYPE, F_ADMINDIST, F_METRIC,
  F_EXPIRYTIME, F_LAST
}
 Field codes for NB_ROUTE_CHANGED notifications. More...
 

Public Member Functions

virtual ~IRoute ()
 
virtual IRoutingTablegetRoutingTableAsGeneric () const =0
 The routing table in which this route is inserted, or nullptr. More...
 
virtual void setDestination (const L3Address &dest)=0
 
virtual void setPrefixLength (int l)=0
 
virtual void setNextHop (const L3Address &nextHop)=0
 
virtual void setInterface (InterfaceEntry *ie)=0
 
virtual void setSource (cObject *source)=0
 
virtual void setSourceType (SourceType type)=0
 
virtual void setMetric (int metric)=0
 
virtual L3Address getDestinationAsGeneric () const =0
 Destination address prefix to match. More...
 
virtual int getPrefixLength () const =0
 Represents length of prefix to match. More...
 
virtual L3Address getNextHopAsGeneric () const =0
 Next hop address. More...
 
virtual InterfaceEntrygetInterface () const =0
 Next hop interface. More...
 
virtual cObject * getSource () const =0
 Source of route. More...
 
virtual SourceType getSourceType () const =0
 Source type of the route. More...
 
virtual int getMetric () const =0
 Cost to reach the destination. More...
 
virtual cObject * getProtocolData () const =0
 
virtual void setProtocolData (cObject *protocolData)=0
 

Static Public Member Functions

static const char * sourceTypeName (SourceType sourceType)
 

Detailed Description

C++ interface for accessing unicast routing table entries of various protocols (IPv4, IPv6, etc) in a uniform way.

See also
IRoutingTable, IPv4Route, IPv6Route

Member Enumeration Documentation

Field codes for NB_ROUTE_CHANGED notifications.

Enumerator
F_DESTINATION 
F_PREFIX_LENGTH 
F_NEXTHOP 
F_IFACE 
F_SOURCE 
F_TYPE 
F_ADMINDIST 
F_METRIC 
F_EXPIRYTIME 
F_LAST 
56  {
59  F_NEXTHOP,
60  F_IFACE,
61  F_SOURCE,
62  F_TYPE,
64  F_METRIC,
66  F_LAST
67  };
Definition: IRoute.h:64
Definition: IRoute.h:61
Definition: IRoute.h:65
Definition: IRoute.h:57
Definition: IRoute.h:59
Definition: IRoute.h:66
Definition: IRoute.h:60
Definition: IRoute.h:62
Definition: IRoute.h:58
Definition: IRoute.h:63

Specifies where the route comes from.

Enumerator
MANUAL 

manually added static route

IFACENETMASK 

comes from an interface's netmask

ROUTER_ADVERTISEMENT 

on-link prefix, from Router Advertisement

OWN_ADV_PREFIX 

on routers: on-link prefix that the router itself advertises on the link

ICMP_REDIRECT 

ICMP redirect message.

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

MANET 

managed by manet, search exact address

MANET2 

managed by manet, search approximate address

DYMO 

managed by DYMO routing

AODV 

managed by AODV routing

39  {
40  MANUAL,
41  IFACENETMASK,
45  RIP,
46  OSPF,
47  BGP,
48  ZEBRA,
49  MANET,
50  MANET2,
51  DYMO,
52  AODV,
53  };
on routers: on-link prefix that the router itself advertises on the link
Definition: IRoute.h:43
managed by the given routing protocol
Definition: IRoute.h:46
managed by the given routing protocol
Definition: IRoute.h:47
ICMP redirect message.
Definition: IRoute.h:44
managed by manet, search approximate address
Definition: IRoute.h:50
comes from an interface&#39;s netmask
Definition: IRoute.h:41
on-link prefix, from Router Advertisement
Definition: IRoute.h:42
managed by the Quagga/Zebra based model
Definition: IRoute.h:48
managed by AODV routing
Definition: IRoute.h:52
manually added static route
Definition: IRoute.h:40
managed by the given routing protocol
Definition: IRoute.h:45
managed by manet, search exact address
Definition: IRoute.h:49
managed by DYMO routing
Definition: IRoute.h:51

Constructor & Destructor Documentation

virtual inet::IRoute::~IRoute ( )
inlinevirtual
77 {}

Member Function Documentation

virtual int inet::IRoute::getPrefixLength ( ) const
pure virtual
virtual IRoutingTable* inet::IRoute::getRoutingTableAsGeneric ( ) const
pure virtual

The routing table in which this route is inserted, or nullptr.

Implemented in inet::IPv4Route, inet::IPv6Route, and inet::GenericRoute.

Referenced by inet::RoutingTableRecorder::recordRouteChange().

virtual SourceType inet::IRoute::getSourceType ( ) const
pure virtual

Source type of the route.

Implemented in inet::IPv4Route, inet::IPv6Route, and inet::GenericRoute.

virtual void inet::IRoute::setDestination ( const L3Address dest)
pure virtual
virtual void inet::IRoute::setPrefixLength ( int  l)
pure virtual
virtual void inet::IRoute::setProtocolData ( cObject *  protocolData)
pure virtual
virtual void inet::IRoute::setSource ( cObject *  source)
pure virtual
virtual void inet::IRoute::setSourceType ( SourceType  type)
pure virtual
const char * inet::IRoute::sourceTypeName ( SourceType  sourceType)
static

Referenced by inet::GenericRoute::info(), inet::IPv4Route::info(), and inet::IPv6Route::info().

23 {
24  switch (sourceType) {
25  case MANUAL:
26  return "MANUAL";
27 
28  case IFACENETMASK:
29  return "IFACENETMASK";
30 
32  return "FROM_RA";
33 
34  case OWN_ADV_PREFIX:
35  return "OWN_ADV_PREFIX";
36 
37  case ICMP_REDIRECT:
38  return "REDIRECT";
39 
40  case RIP:
41  return "RIP";
42 
43  case OSPF:
44  return "OSPF";
45 
46  case BGP:
47  return "BGP";
48 
49  case ZEBRA:
50  return "ZEBRA";
51 
52  case MANET:
53  return "MANET";
54 
55  case MANET2:
56  return "MANET2";
57 
58  case DYMO:
59  return "DYMO";
60 
61  case AODV:
62  return "AODV";
63 
64  default:
65  return "???";
66  }
67 }
on routers: on-link prefix that the router itself advertises on the link
Definition: IRoute.h:43
managed by the given routing protocol
Definition: IRoute.h:46
managed by the given routing protocol
Definition: IRoute.h:47
ICMP redirect message.
Definition: IRoute.h:44
managed by manet, search approximate address
Definition: IRoute.h:50
comes from an interface&#39;s netmask
Definition: IRoute.h:41
on-link prefix, from Router Advertisement
Definition: IRoute.h:42
managed by the Quagga/Zebra based model
Definition: IRoute.h:48
managed by AODV routing
Definition: IRoute.h:52
manually added static route
Definition: IRoute.h:40
managed by the given routing protocol
Definition: IRoute.h:45
managed by manet, search exact address
Definition: IRoute.h:49
managed by DYMO routing
Definition: IRoute.h:51

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