INET Framework for OMNeT++/OMNEST
inet::RIPRoute Struct Reference

#include <RIPRouting.h>

Inheritance diagram for inet::RIPRoute:

Public Types

enum  RouteType {
  RIP_ROUTE_RTE, RIP_ROUTE_STATIC, RIP_ROUTE_DEFAULT, RIP_ROUTE_REDISTRIBUTE,
  RIP_ROUTE_INTERFACE
}
 

Public Member Functions

 RIPRoute (IRoute *route, RouteType type, int metric, uint16 tag)
 
virtual std::string info () const override
 
RouteType getType () const
 
IRoutegetRoute () const
 
L3Address getDestination () const
 
int getPrefixLength () const
 
L3Address getNextHop () const
 
InterfaceEntrygetInterface () const
 
L3Address getFrom () const
 
int getMetric () const
 
uint16 getRouteTag () const
 
bool isChanged () const
 
simtime_t getLastUpdateTime () const
 
void setType (RouteType type)
 
void setRoute (IRoute *route)
 
void setDestination (const L3Address &dest)
 
void setPrefixLength (int prefixLength)
 
void setNextHop (const L3Address &nextHop)
 
void setInterface (InterfaceEntry *ie)
 
void setMetric (int metric)
 
void setRouteTag (uint16 routeTag)
 
void setFrom (const L3Address &from)
 
void setChanged (bool changed)
 
void setLastUpdateTime (simtime_t time)
 

Private Attributes

RouteType type = (RouteType)-1
 
IRouteroute = nullptr
 
L3Address dest
 
int prefixLength = 0
 
L3Address nextHop
 
InterfaceEntryie = nullptr
 
L3Address from
 
int metric = 0
 
uint16 tag = 0
 
bool changed = false
 
simtime_t lastUpdateTime
 

Member Enumeration Documentation

Enumerator
RIP_ROUTE_RTE 
RIP_ROUTE_STATIC 
RIP_ROUTE_DEFAULT 
RIP_ROUTE_REDISTRIBUTE 
RIP_ROUTE_INTERFACE 
35  {
36  RIP_ROUTE_RTE, // route learned from a RIPEntry
37  RIP_ROUTE_STATIC, // static route
38  RIP_ROUTE_DEFAULT, // default route
39  RIP_ROUTE_REDISTRIBUTE, // route imported from another routing protocol
40  RIP_ROUTE_INTERFACE // route belongs to a local interface
41  };
Definition: RIPRouting.h:39
Definition: RIPRouting.h:37
Definition: RIPRouting.h:40
Definition: RIPRouting.h:38
Definition: RIPRouting.h:36

Constructor & Destructor Documentation

inet::RIPRoute::RIPRoute ( IRoute route,
RouteType  type,
int  metric,
uint16  tag 
)
46 {
50  ie = route->getInterface();
51  tag = routeTag;
52 }
virtual L3Address getDestinationAsGeneric() const =0
Destination address prefix to match.
L3Address dest
Definition: RIPRouting.h:46
int prefixLength
Definition: RIPRouting.h:47
int metric
Definition: RIPRouting.h:51
IRoute * route
Definition: RIPRouting.h:45
RouteType type
Definition: RIPRouting.h:44
uint16 tag
Definition: RIPRouting.h:52
bool changed
Definition: RIPRouting.h:53
virtual L3Address getNextHopAsGeneric() const =0
Next hop address.
virtual int getPrefixLength() const =0
Represents length of prefix to match.
simtime_t lastUpdateTime
Definition: RIPRouting.h:54
L3Address nextHop
Definition: RIPRouting.h:48
virtual InterfaceEntry * getInterface() const =0
Next hop interface.
InterfaceEntry * ie
Definition: RIPRouting.h:49

Member Function Documentation

L3Address inet::RIPRoute::getDestination ( ) const
inline

Referenced by inet::RIPRouting::receiveSignal(), inet::RIPRouting::sendRoutes(), and inet::RIPRouting::updateRoute().

62 { return dest; }
L3Address dest
Definition: RIPRouting.h:46
L3Address inet::RIPRoute::getFrom ( ) const
inline

Referenced by inet::RIPRouting::processResponse().

66 { return from; }
L3Address from
Definition: RIPRouting.h:50
InterfaceEntry* inet::RIPRoute::getInterface ( ) const
inline

Referenced by inet::RIPRouting::receiveSignal(), and inet::RIPRouting::sendRoutes().

65 { return ie; }
InterfaceEntry * ie
Definition: RIPRouting.h:49
simtime_t inet::RIPRoute::getLastUpdateTime ( ) const
inline

Referenced by inet::RIPRouting::checkRouteIsExpired().

70 { return lastUpdateTime; }
simtime_t lastUpdateTime
Definition: RIPRouting.h:54
int inet::RIPRoute::getMetric ( ) const
inline
L3Address inet::RIPRoute::getNextHop ( ) const
inline

Referenced by inet::RIPRouting::receiveSignal().

64 { return nextHop; }
L3Address nextHop
Definition: RIPRouting.h:48
int inet::RIPRoute::getPrefixLength ( ) const
inline
IRoute* inet::RIPRoute::getRoute ( ) const
inline

Referenced by inet::RIPRouting::invalidateRoute(), inet::RIPRouting::purgeRoute(), and inet::RIPRouting::updateRoute().

61 { return route; }
IRoute * route
Definition: RIPRouting.h:45
uint16 inet::RIPRoute::getRouteTag ( ) const
inline

Referenced by inet::RIPRouting::sendRoutes().

68 { return tag; }
uint16 tag
Definition: RIPRouting.h:52
RouteType inet::RIPRoute::getType ( ) const
inline
std::string inet::RIPRoute::info ( ) const
overridevirtual

Referenced by inet::operator<<().

55 {
56  std::stringstream out;
57 
58  out << "dest:";
59  if (dest.isUnspecified())
60  out << "* ";
61  else
62  out << dest << " ";
63  out << "prefix:" << prefixLength << " ";
64  out << "gw:";
65  if (nextHop.isUnspecified())
66  out << "* ";
67  else
68  out << nextHop << " ";
69  out << "metric:" << metric << " ";
70  out << "if:";
71  if (!ie)
72  out << "* ";
73  else
74  out << ie->getName() << " ";
75  out << "tag:" << tag << " ";
76  out << "upd:" << lastUpdateTime << "s ";
77  switch (type) {
79  out << "INTERFACE";
80  break;
81 
82  case RIP_ROUTE_STATIC:
83  out << "STATIC";
84  break;
85 
86  case RIP_ROUTE_DEFAULT:
87  out << "DEFAULT";
88  break;
89 
90  case RIP_ROUTE_RTE:
91  out << "RTE";
92  break;
93 
95  out << "REDISTRIBUTE";
96  break;
97  }
98 
99  return out.str();
100 }
Definition: RIPRouting.h:39
L3Address dest
Definition: RIPRouting.h:46
int prefixLength
Definition: RIPRouting.h:47
int metric
Definition: RIPRouting.h:51
Definition: RIPRouting.h:37
RouteType type
Definition: RIPRouting.h:44
uint16 tag
Definition: RIPRouting.h:52
bool isUnspecified() const
Definition: L3Address.cc:133
Definition: RIPRouting.h:40
simtime_t lastUpdateTime
Definition: RIPRouting.h:54
Definition: RIPRouting.h:38
L3Address nextHop
Definition: RIPRouting.h:48
Definition: RIPRouting.h:36
InterfaceEntry * ie
Definition: RIPRouting.h:49
bool inet::RIPRoute::isChanged ( ) const
inline

Referenced by inet::RIPRouting::sendRoutes().

69 { return changed; }
bool changed
Definition: RIPRouting.h:53
void inet::RIPRoute::setChanged ( bool  changed)
inline
void inet::RIPRoute::setDestination ( const L3Address dest)
inline

Referenced by inet::RIPRouting::receiveSignal().

73 { this->dest = dest; }
L3Address dest
Definition: RIPRouting.h:46
void inet::RIPRoute::setFrom ( const L3Address from)
inline

Referenced by inet::RIPRouting::addRoute(), and inet::RIPRouting::updateRoute().

79 { this->from = from; }
L3Address from
Definition: RIPRouting.h:50
void inet::RIPRoute::setInterface ( InterfaceEntry ie)
inline

Referenced by inet::RIPRouting::importRoute(), inet::RIPRouting::receiveSignal(), and inet::RIPRouting::updateRoute().

76 { this->ie = ie; if (route && type == RIP_ROUTE_RTE) route->setInterface(ie); }
IRoute * route
Definition: RIPRouting.h:45
RouteType type
Definition: RIPRouting.h:44
virtual void setInterface(InterfaceEntry *ie)=0
Definition: RIPRouting.h:36
InterfaceEntry * ie
Definition: RIPRouting.h:49
void inet::RIPRoute::setLastUpdateTime ( simtime_t  time)
inline

Referenced by inet::RIPRouting::addRoute(), inet::RIPRouting::processResponse(), and inet::RIPRouting::updateRoute().

81 { lastUpdateTime = time; }
simtime_t lastUpdateTime
Definition: RIPRouting.h:54
void inet::RIPRoute::setMetric ( int  metric)
inline

Referenced by inet::RIPRouting::invalidateRoute(), and inet::RIPRouting::updateRoute().

77 { this->metric = metric; if (route && type == RIP_ROUTE_RTE) route->setMetric(metric); }
int metric
Definition: RIPRouting.h:51
IRoute * route
Definition: RIPRouting.h:45
RouteType type
Definition: RIPRouting.h:44
virtual void setMetric(int metric)=0
Definition: RIPRouting.h:36
void inet::RIPRoute::setNextHop ( const L3Address nextHop)
inline

Referenced by inet::RIPRouting::receiveSignal(), and inet::RIPRouting::updateRoute().

75 { this->nextHop = nextHop; if (route && type == RIP_ROUTE_RTE) route->setNextHop(nextHop); }
IRoute * route
Definition: RIPRouting.h:45
RouteType type
Definition: RIPRouting.h:44
virtual void setNextHop(const L3Address &nextHop)=0
L3Address nextHop
Definition: RIPRouting.h:48
Definition: RIPRouting.h:36
void inet::RIPRoute::setPrefixLength ( int  prefixLength)
inline

Referenced by inet::RIPRouting::receiveSignal().

74 { this->prefixLength = prefixLength; }
int prefixLength
Definition: RIPRouting.h:47
void inet::RIPRoute::setRoute ( IRoute route)
inline

Referenced by inet::RIPRouting::invalidateRoute(), inet::RIPRouting::purgeRoute(), and inet::RIPRouting::updateRoute().

72 { this->route = route; }
IRoute * route
Definition: RIPRouting.h:45
void inet::RIPRoute::setRouteTag ( uint16  routeTag)
inline

Referenced by inet::RIPRouting::updateRoute().

78 { this->tag = routeTag; }
uint16 tag
Definition: RIPRouting.h:52
void inet::RIPRoute::setType ( RouteType  type)
inline

Referenced by inet::RIPRouting::updateRoute().

71 { this->type = type; }
RouteType type
Definition: RIPRouting.h:44

Member Data Documentation

bool inet::RIPRoute::changed = false
private

Referenced by isChanged(), and setChanged().

L3Address inet::RIPRoute::from
private
InterfaceEntry* inet::RIPRoute::ie = nullptr
private
simtime_t inet::RIPRoute::lastUpdateTime
private

Referenced by getLastUpdateTime(), and info().

int inet::RIPRoute::metric = 0
private
L3Address inet::RIPRoute::nextHop
private
int inet::RIPRoute::prefixLength = 0
private
IRoute* inet::RIPRoute::route = nullptr
private
uint16 inet::RIPRoute::tag = 0
private

Referenced by getRouteTag(), info(), and RIPRoute().

RouteType inet::RIPRoute::type = (RouteType)-1
private

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