A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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=nullptr, 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
 
 ~RoutingTableEntry ()
 
Ipv4Address GetDestination () const
 Get destination IP address.
 
bool GetEntriesChanged () const
 Get entries changed.
 
RouteFlags GetFlag () const
 Get route flags.
 
uint32_t GetHop () const
 Get hop.
 
Ipv4InterfaceAddress GetInterface () const
 Get interface address.
 
Time GetLifeTime () const
 Get lifetime.
 
Ipv4Address GetNextHop () const
 Get next hop.
 
Ptr< NetDeviceGetOutputDevice () const
 Get output device.
 
Ptr< Ipv4RouteGetRoute () const
 Get route.
 
uint32_t GetSeqNo () const
 Get sequence number.
 
Time GetSettlingTime () const
 Get settling time.
 
bool operator== (const Ipv4Address destination) const
 Compare destination address.
 
void Print (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
 Print routing table entry.
 
void SetEntriesChanged (bool entriesChanged)
 Set entries changed indicator.
 
void SetFlag (RouteFlags flag)
 Set route flags.
 
void SetHop (uint32_t hopCount)
 Set hop.
 
void SetInterface (Ipv4InterfaceAddress iface)
 Set interface address.
 
void SetLifeTime (Time lifeTime)
 Set lifetime.
 
void SetNextHop (Ipv4Address nextHop)
 Set next hop.
 
void SetOutputDevice (Ptr< NetDevice > device)
 Set output device.
 
void SetRoute (Ptr< Ipv4Route > route)
 Set route.
 
void SetSeqNo (uint32_t sequenceNumber)
 Set sequence number.
 
void SetSettlingTime (Time settlingTime)
 Set settling time.
 

Private Attributes

bool m_entriesChanged
 Flag to show if any of the routing table entries were changed with the routing update.
 
RouteFlags m_flag
 Routing flags: valid, invalid or in search.
 
uint32_t m_hops
 Hop Count (number of hops needed to reach destination)
 
Ipv4InterfaceAddress m_iface
 Output interface address.
 
Ptr< Ipv4Routem_ipv4Route
 Ip route, include.
 
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.
 
uint32_t m_seqNo
 Destination Sequence Number.
 
Time m_settlingTime
 Time for which the node retains an update with changed metric before broadcasting it.
 

Detailed Description

Routing table entry.

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

Constructor & Destructor Documentation

◆ RoutingTableEntry()

ns3::dsdv::RoutingTableEntry::RoutingTableEntry ( Ptr< NetDevice > dev = nullptr,
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 33 of file dsdv-rtable.cc.

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

+ Here is the call graph for this function:

◆ ~RoutingTableEntry()

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

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

Member Function Documentation

◆ GetDestination()

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

Get destination IP address.

Returns
the destination IPv4 address

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

References m_ipv4Route.

Referenced by ns3::dsdv::RoutingTable::AddRoute(), DsdvTableTestCase::DoRun(), ns3::dsdv::RoutingProtocol::LookForQueuedPackets(), ns3::dsdv::RoutingProtocol::MergeTriggerPeriodicUpdates(), ns3::dsdv::RoutingProtocol::SendTriggeredUpdate(), and ns3::dsdv::RoutingTable::Update().

+ Here is the caller graph for this function:

◆ GetEntriesChanged()

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

Get entries changed.

Returns
the entries changed flag

Definition at line 259 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 241 of file dsdv-rtable.h.

References m_flag.

◆ GetHop()

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

Get hop.

Returns
the hop count

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

References m_hops.

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

+ Here is the caller graph for this function:

◆ GetInterface()

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

Get interface address.

Returns
the IPv4 interface address

Definition at line 142 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 205 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 115 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 133 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 88 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 169 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 223 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== ( const Ipv4Address destination) const
inline

Compare destination address.

Parameters
destinationdestination node IP address
Returns
true if equal

Definition at line 269 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 181 of file dsdv-rtable.cc.

References ns3::Time::As(), ns3::Ipv4InterfaceAddress::GetLocal(), 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 250 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 232 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 178 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 151 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 196 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 106 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 124 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 97 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 160 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 214 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

bool 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 309 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 304 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 286 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 302 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 300 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 293 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 284 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 307 of file dsdv-rtable.h.

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


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