A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::dsdv::RoutingTable Class Reference

The Routing table used by DSDV protocol. More...

#include <dsdv-rtable.h>

Public Member Functions

 RoutingTable ()
 c-tor
 
bool AddIpv4Event (Ipv4Address address, EventId id)
 
bool AddRoute (RoutingTableEntry &r)
 
bool AnyRunningEvent (Ipv4Address address)
 
void Clear ()
 Delete all entries from routing table.
 
void DeleteAllRoutesFromInterface (Ipv4InterfaceAddress iface)
 Delete all route from interface with address iface.
 
bool DeleteIpv4Event (Ipv4Address address)
 
bool DeleteRoute (Ipv4Address dst)
 
bool ForceDeleteIpv4Event (Ipv4Address address)
 
EventId GetEventId (Ipv4Address address)
 
void GetListOfAllRoutes (std::map< Ipv4Address, RoutingTableEntry > &allRoutes)
 
void GetListOfDestinationWithNextHop (Ipv4Address nxtHp, std::map< Ipv4Address, RoutingTableEntry > &dstList)
 
bool LookupRoute (Ipv4Address dst, RoutingTableEntry &rt)
 
bool LookupRoute (Ipv4Address id, RoutingTableEntry &rt, bool forRouteInput)
 
void Print (Ptr< OutputStreamWrapper > stream) const
 Print routing table.
 
void Purge (std::map< Ipv4Address, RoutingTableEntry > &removedAddresses)
 Delete all outdated entries if Lifetime is expired.
 
uint32_t RoutingTableSize ()
 Provides the number of routes present in that nodes routing table.
 
bool Update (RoutingTableEntry &rt)
 
Handle life time of invalid route
Time Getholddowntime () const
 
void Setholddowntime (Time t)
 

Private Attributes

Fields
std::map< Ipv4Address,
RoutingTableEntry
m_ipv4AddressEntry
 an entry in the routing table.
 
std::map< Ipv4Address, EventIdm_ipv4Events
 an entry in the event table.
 
Time m_holddownTime
 

Detailed Description

The Routing table used by DSDV protocol.

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

Member Function Documentation

bool ns3::dsdv::RoutingTable::AddIpv4Event ( Ipv4Address  address,
EventId  id 
)

Add an event for a destination address so that the update to for that destination is sent after the event is completed.

Parameters
addressdestination address for which this event is running.
idunique eventid that was generated.

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

References m_ipv4Events.

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

bool ns3::dsdv::RoutingTable::AddRoute ( RoutingTableEntry r)

Add routing table entry if it doesn't yet exist in routing table

Parameters
rrouting table entry
Returns
true in success

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

References m_ipv4AddressEntry.

Referenced by ns3::DsdvTableTestCase::DoRun(), ns3::dsdv::RoutingProtocol::NotifyAddAddress(), ns3::dsdv::RoutingProtocol::NotifyInterfaceUp(), ns3::dsdv::RoutingProtocol::RecvDsdv(), ns3::dsdv::RoutingProtocol::RouteOutput(), and ns3::dsdv::RoutingProtocol::SetIpv4().

bool ns3::dsdv::RoutingTable::AnyRunningEvent ( Ipv4Address  address)

Force delete an update waiting for settling time to complete as a better update to same destination was received.

Parameters
addressdestination address for which this event is running.
Returns
true on success

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

References ns3::EventId::IsRunning(), and m_ipv4Events.

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

bool ns3::dsdv::RoutingTable::DeleteIpv4Event ( Ipv4Address  address)

Clear up the entry from the map after the event is completed

Parameters
addressdestination address for which this event is running.
Returns
true on success

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

References ns3::EventId::IsExpired(), ns3::EventId::IsRunning(), and m_ipv4Events.

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

bool ns3::dsdv::RoutingTable::DeleteRoute ( Ipv4Address  dst)

Delete routing table entry with destination address dst, if it exists.

Parameters
dstdestination address
Returns
true on success

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

References m_ipv4AddressEntry.

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

bool ns3::dsdv::RoutingTable::ForceDeleteIpv4Event ( Ipv4Address  address)

Force delete an update waiting for settling time to complete as a better update to same destination was received.

Parameters
addressdestination address for which this event is running.
Returns
true on finding out that an event is already running for that destination address.

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

References ns3::Simulator::Cancel(), and m_ipv4Events.

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

EventId ns3::dsdv::RoutingTable::GetEventId ( Ipv4Address  address)

Get the EcentId associated with that address.

Parameters
addressdestination address for which this event is running.
Returns
EventId on finding out an event is associated else return NULL.

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

References m_ipv4Events.

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

void ns3::dsdv::RoutingTable::GetListOfAllRoutes ( std::map< Ipv4Address, RoutingTableEntry > &  allRoutes)

Lookup list of all addresses in the routing table

Parameters
allRoutesis the list that will hold all these addresses present in the nodes routing table

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

References m_ipv4AddressEntry, and ns3::aodv::VALID.

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

void ns3::dsdv::RoutingTable::GetListOfDestinationWithNextHop ( Ipv4Address  nxtHp,
std::map< Ipv4Address, RoutingTableEntry > &  dstList 
)

Lookup list of addresses for which nxtHp is the next Hop address

Parameters
nxtHpnexthop's address for which we want the list of destinations
dstListis the list that will hold all these destination addresses

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

References m_ipv4AddressEntry.

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

bool ns3::dsdv::RoutingTable::LookupRoute ( Ipv4Address  dst,
RoutingTableEntry rt 
)

Lookup routing table entry with destination address dst

Parameters
dstdestination address
rtentry with destination address dst, if exists
Returns
true on success

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

References m_ipv4AddressEntry.

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

bool ns3::dsdv::RoutingTable::Update ( RoutingTableEntry rt)

Updating the routing Table with routing table entry rt

Parameters
rtrouting table entry
Returns
true on success

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

References m_ipv4AddressEntry.

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


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