A Discrete-Event Network Simulator
API
ns3::dsdv::RoutingTableEntry Class Reference

Routing table entry. More...

#include "dsdv-rtable.h"

+ Collaboration diagram for ns3::dsdv::RoutingTableEntry:

Public Member Functions

 RoutingTableEntry (Ptr< NetDevice > dev=0, Ipv4Address dst=Ipv4Address(), uint32_t seqNo=0, Ipv4InterfaceAddress iface=Ipv4InterfaceAddress(), uint32_t hops=0, Ipv4Address nextHop=Ipv4Address(), Time lifetime=Simulator::Now(), Time SettlingTime=Simulator::Now(), bool changedEntries=false)
 c-tor More...
 
 ~RoutingTableEntry ()
 
Ipv4Address GetDestination () const
 Get destination IP address. More...
 
bool GetEntriesChanged () const
 Get entries changed. More...
 
RouteFlags GetFlag () const
 Get route flags. More...
 
uint32_t GetHop () const
 Get hop. More...
 
Ipv4InterfaceAddress GetInterface () const
 Get interface address. More...
 
Time GetLifeTime () const
 Get lifetime. More...
 
Ipv4Address GetNextHop () const
 Get next hop. More...
 
Ptr< NetDeviceGetOutputDevice () const
 Get output device. More...
 
Ptr< Ipv4RouteGetRoute () const
 Get route. More...
 
uint32_t GetSeqNo () const
 Get sequence number. More...
 
Time GetSettlingTime () const
 Get settling time. More...
 
bool operator== (Ipv4Address const destination) const
 Compare destination address. More...
 
void Print (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
 Print routing table entry. More...
 
void SetEntriesChanged (bool entriesChanged)
 Set entries changed indicator. More...
 
void SetFlag (RouteFlags flag)
 Set route flags. More...
 
void SetHop (uint32_t hopCount)
 Set hop. More...
 
void SetInterface (Ipv4InterfaceAddress iface)
 Set interface address. More...
 
void SetLifeTime (Time lifeTime)
 Set lifetime. More...
 
void SetNextHop (Ipv4Address nextHop)
 Set next hop. More...
 
void SetOutputDevice (Ptr< NetDevice > device)
 Set output device. More...
 
void SetRoute (Ptr< Ipv4Route > route)
 Set route. More...
 
void SetSeqNo (uint32_t sequenceNumber)
 Set sequence number. More...
 
void SetSettlingTime (Time settlingTime)
 Set settling time. More...
 

Private Attributes

uint32_t m_entriesChanged
 Flag to show if any of the routing table entries were changed with the routing update. More...
 
RouteFlags m_flag
 Routing flags: valid, invalid or in search. More...
 
uint32_t m_hops
 Hop Count (number of hops needed to reach destination) More...
 
Ipv4InterfaceAddress m_iface
 Output interface address. More...
 
Ptr< Ipv4Routem_ipv4Route
 Ip route, include. More...
 
Time m_lifeTime
 Expiration or deletion time of the route Lifetime field in the routing table plays dual role – for an active route it is the expiration time, and for an invalid route it is the deletion time. More...
 
uint32_t m_seqNo
 Destination Sequence Number. More...
 
Time m_settlingTime
 Time for which the node retains an update with changed metric before broadcasting it. More...
 

Detailed Description

Routing table entry.

Definition at line 56 of file dsdv-rtable.h.

Constructor & Destructor Documentation

◆ RoutingTableEntry()

ns3::dsdv::RoutingTableEntry::RoutingTableEntry ( Ptr< NetDevice dev = 0,
Ipv4Address  dst = Ipv4Address (),
uint32_t  seqNo = 0,
Ipv4InterfaceAddress  iface = Ipv4InterfaceAddress (),
uint32_t  hops = 0,
Ipv4Address  nextHop = Ipv4Address (),
Time  lifetime = Simulator::Now (),
Time  SettlingTime = Simulator::Now (),
bool  changedEntries = false 
)

c-tor

Parameters
devthe net device
dstthe destination IP address
seqNothe sequence number
ifacethe interface
hopsthe number of hops
nextHopthe IP address of the next hop
lifetimethe lifetime
SettlingTimethe settling time
changedEntriesflag for changed entries

Definition at line 41 of file dsdv-rtable.cc.

References ns3::Ipv4InterfaceAddress::GetLocal(), m_iface, and m_ipv4Route.

+ Here is the call graph for this function:

◆ ~RoutingTableEntry()

ns3::dsdv::RoutingTableEntry::~RoutingTableEntry ( )

Definition at line 64 of file dsdv-rtable.cc.

Member Function Documentation

◆ GetDestination()

Ipv4Address ns3::dsdv::RoutingTableEntry::GetDestination ( ) const
inline

◆ GetEntriesChanged()

bool ns3::dsdv::RoutingTableEntry::GetEntriesChanged ( ) const
inline

Get entries changed.

Returns
the entries changed flag

Definition at line 262 of file dsdv-rtable.h.

References m_entriesChanged.

Referenced by ns3::dsdv::RoutingProtocol::MergeTriggerPeriodicUpdates().

+ Here is the caller graph for this function:

◆ GetFlag()

RouteFlags ns3::dsdv::RoutingTableEntry::GetFlag ( ) const
inline

Get route flags.

Returns
the route flags

Definition at line 244 of file dsdv-rtable.h.

References m_flag.

◆ GetHop()

uint32_t ns3::dsdv::RoutingTableEntry::GetHop ( ) const
inline

◆ GetInterface()

Ipv4InterfaceAddress ns3::dsdv::RoutingTableEntry::GetInterface ( ) const
inline

Get interface address.

Returns
the IPv4 interface address

Definition at line 145 of file dsdv-rtable.h.

References m_iface.

Referenced by DsdvTableTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetLifeTime()

Time ns3::dsdv::RoutingTableEntry::GetLifeTime ( ) const
inline

Get lifetime.

Returns
the lifetime value

Definition at line 208 of file dsdv-rtable.h.

References m_lifeTime, and ns3::Simulator::Now().

Referenced by ns3::dsdv::RoutingProtocol::GetSettlingTime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNextHop()

Ipv4Address ns3::dsdv::RoutingTableEntry::GetNextHop ( ) const
inline

Get next hop.

Returns
the IPv4 address of the next hop

Definition at line 118 of file dsdv-rtable.h.

References m_ipv4Route.

Referenced by ns3::dsdv::RoutingProtocol::LookForQueuedPackets(), ns3::dsdv::RoutingProtocol::RecvDsdv(), ns3::dsdv::RoutingProtocol::RouteInput(), and ns3::dsdv::RoutingProtocol::RouteOutput().

+ Here is the caller graph for this function:

◆ GetOutputDevice()

Ptr<NetDevice> ns3::dsdv::RoutingTableEntry::GetOutputDevice ( ) const
inline

Get output device.

Returns
the output device

Definition at line 136 of file dsdv-rtable.h.

References m_ipv4Route.

◆ GetRoute()

Ptr<Ipv4Route> ns3::dsdv::RoutingTableEntry::GetRoute ( ) const
inline

Get route.

Returns
the IPv4 route

Definition at line 91 of file dsdv-rtable.h.

References m_ipv4Route.

Referenced by ns3::dsdv::RoutingProtocol::LookForQueuedPackets(), ns3::dsdv::RoutingProtocol::RouteInput(), and ns3::dsdv::RoutingProtocol::RouteOutput().

+ Here is the caller graph for this function:

◆ GetSeqNo()

uint32_t ns3::dsdv::RoutingTableEntry::GetSeqNo ( ) const
inline

Get sequence number.

Returns
the sequence number

Definition at line 172 of file dsdv-rtable.h.

References m_seqNo.

Referenced by DsdvTableTestCase::DoRun(), ns3::dsdv::RoutingProtocol::MergeTriggerPeriodicUpdates(), ns3::dsdv::RoutingProtocol::RecvDsdv(), and ns3::dsdv::RoutingProtocol::SendTriggeredUpdate().

+ Here is the caller graph for this function:

◆ GetSettlingTime()

Time ns3::dsdv::RoutingTableEntry::GetSettlingTime ( ) const
inline

Get settling time.

Returns
the settling time

Definition at line 226 of file dsdv-rtable.h.

References m_settlingTime.

Referenced by ns3::dsdv::RoutingProtocol::GetSettlingTime().

+ Here is the caller graph for this function:

◆ operator==()

bool ns3::dsdv::RoutingTableEntry::operator== ( Ipv4Address const  destination) const
inline

Compare destination address.

Parameters
destinationdestination node IP address
Returns
true if equal

Definition at line 272 of file dsdv-rtable.h.

References m_ipv4Route.

◆ Print()

void ns3::dsdv::RoutingTableEntry::Print ( Ptr< OutputStreamWrapper stream,
Time::Unit  unit = Time::S 
) const

Print routing table entry.

Parameters
streamthe output stream
unitthe Time unit

Definition at line 198 of file dsdv-rtable.cc.

References ns3::Time::As(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::OutputStreamWrapper::GetStream(), m_hops, m_iface, m_ipv4Route, m_lifeTime, m_seqNo, m_settlingTime, and ns3::Simulator::Now().

+ Here is the call graph for this function:

◆ SetEntriesChanged()

void ns3::dsdv::RoutingTableEntry::SetEntriesChanged ( bool  entriesChanged)
inline

Set entries changed indicator.

Parameters
entriesChanged

Definition at line 253 of file dsdv-rtable.h.

References m_entriesChanged.

Referenced by ns3::dsdv::RoutingProtocol::MergeTriggerPeriodicUpdates(), ns3::dsdv::RoutingProtocol::RecvDsdv(), ns3::dsdv::RoutingProtocol::SendTriggeredUpdate(), and ns3::dsdv::RoutingProtocol::SetIpv4().

+ Here is the caller graph for this function:

◆ SetFlag()

void ns3::dsdv::RoutingTableEntry::SetFlag ( RouteFlags  flag)
inline

Set route flags.

Parameters
flagthe route flags

Definition at line 235 of file dsdv-rtable.h.

References m_flag.

Referenced by ns3::dsdv::RoutingProtocol::MergeTriggerPeriodicUpdates(), ns3::dsdv::RoutingProtocol::RecvDsdv(), ns3::dsdv::RoutingProtocol::SendTriggeredUpdate(), and ns3::dsdv::RoutingProtocol::SetIpv4().

+ Here is the caller graph for this function:

◆ SetHop()

void ns3::dsdv::RoutingTableEntry::SetHop ( uint32_t  hopCount)
inline

Set hop.

Parameters
hopCountthe hop count

Definition at line 181 of file dsdv-rtable.h.

References m_hops.

Referenced by ns3::dsdv::RoutingProtocol::RecvDsdv().

+ Here is the caller graph for this function:

◆ SetInterface()

void ns3::dsdv::RoutingTableEntry::SetInterface ( Ipv4InterfaceAddress  iface)
inline

Set interface address.

Parameters
ifacethe IPv4 interface address

Definition at line 154 of file dsdv-rtable.h.

References m_iface.

◆ SetLifeTime()

void ns3::dsdv::RoutingTableEntry::SetLifeTime ( Time  lifeTime)
inline

Set lifetime.

Parameters
lifeTimethe lifetime value

Definition at line 199 of file dsdv-rtable.h.

References m_lifeTime.

Referenced by ns3::dsdv::RoutingProtocol::RecvDsdv().

+ Here is the caller graph for this function:

◆ SetNextHop()

void ns3::dsdv::RoutingTableEntry::SetNextHop ( Ipv4Address  nextHop)
inline

Set next hop.

Parameters
nextHopthe IPv4 address of the next hop

Definition at line 109 of file dsdv-rtable.h.

References m_ipv4Route.

Referenced by ns3::dsdv::RoutingProtocol::RecvDsdv().

+ Here is the caller graph for this function:

◆ SetOutputDevice()

void ns3::dsdv::RoutingTableEntry::SetOutputDevice ( Ptr< NetDevice device)
inline

Set output device.

Parameters
devicethe output device

Definition at line 127 of file dsdv-rtable.h.

References m_ipv4Route.

◆ SetRoute()

void ns3::dsdv::RoutingTableEntry::SetRoute ( Ptr< Ipv4Route route)
inline

Set route.

Parameters
routethe IPv4 route

Definition at line 100 of file dsdv-rtable.h.

References m_ipv4Route.

◆ SetSeqNo()

void ns3::dsdv::RoutingTableEntry::SetSeqNo ( uint32_t  sequenceNumber)
inline

Set sequence number.

Parameters
sequenceNumberthe sequence number

Definition at line 163 of file dsdv-rtable.h.

References m_seqNo.

Referenced by ns3::dsdv::RoutingProtocol::RecvDsdv(), and ns3::dsdv::RoutingProtocol::SendPeriodicUpdate().

+ Here is the caller graph for this function:

◆ SetSettlingTime()

void ns3::dsdv::RoutingTableEntry::SetSettlingTime ( Time  settlingTime)
inline

Set settling time.

Parameters
settlingTimethe settling time

Definition at line 217 of file dsdv-rtable.h.

References m_settlingTime.

Referenced by ns3::dsdv::RoutingProtocol::RecvDsdv().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_entriesChanged

uint32_t ns3::dsdv::RoutingTableEntry::m_entriesChanged
private

Flag to show if any of the routing table entries were changed with the routing update.

Definition at line 312 of file dsdv-rtable.h.

Referenced by GetEntriesChanged(), and SetEntriesChanged().

◆ m_flag

RouteFlags ns3::dsdv::RoutingTableEntry::m_flag
private

Routing flags: valid, invalid or in search.

Definition at line 307 of file dsdv-rtable.h.

Referenced by GetFlag(), and SetFlag().

◆ m_hops

uint32_t ns3::dsdv::RoutingTableEntry::m_hops
private

Hop Count (number of hops needed to reach destination)

Definition at line 289 of file dsdv-rtable.h.

Referenced by GetHop(), Print(), and SetHop().

◆ m_iface

Ipv4InterfaceAddress ns3::dsdv::RoutingTableEntry::m_iface
private

Output interface address.

Definition at line 305 of file dsdv-rtable.h.

Referenced by RoutingTableEntry(), GetInterface(), Print(), and SetInterface().

◆ m_ipv4Route

Ptr<Ipv4Route> ns3::dsdv::RoutingTableEntry::m_ipv4Route
private

Ip route, include.

  • destination address
  • source address
  • next hop address (gateway)
  • output device

Definition at line 303 of file dsdv-rtable.h.

Referenced by RoutingTableEntry(), GetDestination(), GetNextHop(), GetOutputDevice(), GetRoute(), operator==(), Print(), SetNextHop(), SetOutputDevice(), and SetRoute().

◆ m_lifeTime

Time ns3::dsdv::RoutingTableEntry::m_lifeTime
private

Expiration or deletion time of the route Lifetime field in the routing table plays dual role – for an active route it is the expiration time, and for an invalid route it is the deletion time.

Definition at line 296 of file dsdv-rtable.h.

Referenced by GetLifeTime(), Print(), and SetLifeTime().

◆ m_seqNo

uint32_t ns3::dsdv::RoutingTableEntry::m_seqNo
private

Destination Sequence Number.

Definition at line 287 of file dsdv-rtable.h.

Referenced by GetSeqNo(), Print(), and SetSeqNo().

◆ m_settlingTime

Time ns3::dsdv::RoutingTableEntry::m_settlingTime
private

Time for which the node retains an update with changed metric before broadcasting it.

A node does that in hope of receiving a better update.

Definition at line 310 of file dsdv-rtable.h.

Referenced by GetSettlingTime(), Print(), and SetSettlingTime().


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