The Routing table used by DSDV protocol. More...
#include "dsdv-rtable.h"
Public Member Functions | |
RoutingTable () | |
c-tor | |
bool | 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. | |
bool | AddRoute (RoutingTableEntry &r) |
Add routing table entry if it doesn't yet exist in routing table. | |
bool | AnyRunningEvent (Ipv4Address address) |
Force delete an update waiting for settling time to complete as a better update to same destination was received. | |
void | Clear () |
Delete all entries from routing table. | |
void | DeleteAllRoutesFromInterface (Ipv4InterfaceAddress iface) |
Delete all route from interface with address iface. | |
bool | DeleteIpv4Event (Ipv4Address address) |
Clear up the entry from the map after the event is completed. | |
bool | DeleteRoute (Ipv4Address dst) |
Delete routing table entry with destination address dst, if it exists. | |
bool | ForceDeleteIpv4Event (Ipv4Address address) |
Force delete an update waiting for settling time to complete as a better update to same destination was received. | |
EventId | GetEventId (Ipv4Address address) |
Get the EventId associated with that address. | |
Time | Getholddowntime () const |
Get hold down time (time until an invalid route may be deleted) | |
void | GetListOfAllRoutes (std::map< Ipv4Address, RoutingTableEntry > &allRoutes) |
Lookup list of all addresses in the routing table. | |
void | GetListOfDestinationWithNextHop (Ipv4Address nxtHp, std::map< Ipv4Address, RoutingTableEntry > &dstList) |
Lookup list of addresses for which nxtHp is the next Hop address. | |
bool | LookupRoute (Ipv4Address dst, RoutingTableEntry &rt) |
Lookup routing table entry with destination address dst. | |
bool | LookupRoute (Ipv4Address id, RoutingTableEntry &rt, bool forRouteInput) |
Lookup routing table entry with destination address dst. | |
void | Print (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) 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. | |
void | Setholddowntime (Time t) |
Set hold down time (time until an invalid route may be deleted) | |
bool | Update (RoutingTableEntry &rt) |
Updating the routing Table with routing table entry rt. | |
Private Attributes | |
Time | m_holddownTime |
hold down time of an expired route | |
std::map< Ipv4Address, RoutingTableEntry > | m_ipv4AddressEntry |
an entry in the routing table. | |
std::map< Ipv4Address, EventId > | m_ipv4Events |
an entry in the event table. | |
The Routing table used by DSDV protocol.
Definition at line 316 of file dsdv-rtable.h.
ns3::dsdv::RoutingTable::RoutingTable | ( | ) |
c-tor
Definition at line 61 of file dsdv-rtable.cc.
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.
address | destination address for which this event is running. |
id | unique eventid that was generated. |
Definition at line 284 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.
r | routing table entry |
Definition at line 114 of file dsdv-rtable.cc.
References ns3::dsdv::RoutingTableEntry::GetDestination(), and m_ipv4AddressEntry.
Referenced by 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.
address | destination address for which this event is running. |
Definition at line 291 of file dsdv-rtable.cc.
References ns3::EventId::IsPending(), and m_ipv4Events.
Referenced by ns3::dsdv::RoutingProtocol::MergeTriggerPeriodicUpdates(), ns3::dsdv::RoutingProtocol::RecvDsdv(), and ns3::dsdv::RoutingProtocol::SendTriggeredUpdate().
|
inline |
Delete all entries from routing table.
Definition at line 374 of file dsdv-rtable.h.
References m_ipv4AddressEntry.
Referenced by ns3::dsdv::RoutingProtocol::NotifyInterfaceDown().
void ns3::dsdv::RoutingTable::DeleteAllRoutesFromInterface | ( | Ipv4InterfaceAddress | iface | ) |
Delete all route from interface with address iface.
iface | the interface |
Definition at line 133 of file dsdv-rtable.cc.
References m_ipv4AddressEntry.
Referenced by ns3::dsdv::RoutingProtocol::NotifyInterfaceDown().
bool ns3::dsdv::RoutingTable::DeleteIpv4Event | ( | Ipv4Address | address | ) |
Clear up the entry from the map after the event is completed.
address | destination address for which this event is running. |
Definition at line 323 of file dsdv-rtable.cc.
References ns3::EventId::Cancel(), ns3::EventId::IsExpired(), ns3::EventId::IsPending(), 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.
dst | destination address |
Definition at line 102 of file dsdv-rtable.cc.
References m_ipv4AddressEntry.
Referenced by ns3::dsdv::RoutingProtocol::MergeTriggerPeriodicUpdates(), 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.
address | destination address for which this event is running. |
Definition at line 308 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 EventId associated with that address.
address | destination address for which this event is running. |
Definition at line 350 of file dsdv-rtable.cc.
References m_ipv4Events.
Referenced by ns3::dsdv::RoutingProtocol::SendTriggeredUpdate().
|
inline |
Get hold down time (time until an invalid route may be deleted)
Definition at line 434 of file dsdv-rtable.h.
References m_holddownTime.
void ns3::dsdv::RoutingTable::GetListOfAllRoutes | ( | std::map< Ipv4Address, RoutingTableEntry > & | allRoutes | ) |
Lookup list of all addresses in the routing table.
allRoutes | is the list that will hold all these addresses present in the nodes routing table |
Definition at line 155 of file dsdv-rtable.cc.
References m_ipv4AddressEntry, and ns3::dsdv::VALID.
Referenced by ns3::dsdv::RoutingProtocol::LookForQueuedPackets(), ns3::dsdv::RoutingProtocol::MergeTriggerPeriodicUpdates(), 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.
nxtHp | nexthop's address for which we want the list of destinations |
dstList | is the list that will hold all these destination addresses |
Definition at line 167 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.
dst | destination address |
rt | entry with destination address dst, if exists |
Definition at line 66 of file dsdv-rtable.cc.
References m_ipv4AddressEntry.
Referenced by DsdvTableTestCase::DoRun(), ns3::dsdv::RoutingProtocol::GetSettlingTime(), ns3::dsdv::RoutingProtocol::LookForQueuedPackets(), ns3::dsdv::RoutingProtocol::RecvDsdv(), ns3::dsdv::RoutingProtocol::RouteInput(), ns3::dsdv::RoutingProtocol::RouteOutput(), ns3::dsdv::RoutingProtocol::SendPeriodicUpdate(), and ns3::dsdv::RoutingProtocol::SendTriggeredUpdate().
bool ns3::dsdv::RoutingTable::LookupRoute | ( | Ipv4Address | id, |
RoutingTableEntry & | rt, | ||
bool | forRouteInput ) |
Lookup routing table entry with destination address dst.
id | destination address |
rt | entry with destination address dst, if exists |
forRouteInput | for routing input |
Definition at line 82 of file dsdv-rtable.cc.
References m_ipv4AddressEntry.
void ns3::dsdv::RoutingTable::Print | ( | Ptr< OutputStreamWrapper > | stream, |
Time::Unit | unit = Time::S ) const |
Print routing table.
stream | the output stream |
unit | the Time unit |
Definition at line 257 of file dsdv-rtable.cc.
References m_ipv4AddressEntry.
Referenced by ns3::dsdv::RoutingProtocol::PrintRoutingTable().
void ns3::dsdv::RoutingTable::Purge | ( | std::map< Ipv4Address, RoutingTableEntry > & | removedAddresses | ) |
Delete all outdated entries if Lifetime is expired.
removedAddresses | is the list of addresses to purge |
Definition at line 213 of file dsdv-rtable.cc.
References m_holddownTime, and m_ipv4AddressEntry.
Referenced by ns3::dsdv::RoutingProtocol::RouteOutput(), and ns3::dsdv::RoutingProtocol::SendPeriodicUpdate().
uint32_t ns3::dsdv::RoutingTable::RoutingTableSize | ( | ) |
Provides the number of routes present in that nodes routing table.
Definition at line 108 of file dsdv-rtable.cc.
References m_ipv4AddressEntry.
Referenced by DsdvTableTestCase::DoRun().
|
inline |
Set hold down time (time until an invalid route may be deleted)
t | the hold down time |
Definition at line 443 of file dsdv-rtable.h.
References m_holddownTime.
Referenced by ns3::dsdv::RoutingProtocol::Start().
bool ns3::dsdv::RoutingTable::Update | ( | RoutingTableEntry & | rt | ) |
Updating the routing Table with routing table entry rt.
rt | routing table entry |
Definition at line 121 of file dsdv-rtable.cc.
References ns3::dsdv::RoutingTableEntry::GetDestination(), and m_ipv4AddressEntry.
Referenced by ns3::dsdv::RoutingProtocol::MergeTriggerPeriodicUpdates(), ns3::dsdv::RoutingProtocol::RecvDsdv(), ns3::dsdv::RoutingProtocol::SendPeriodicUpdate(), and ns3::dsdv::RoutingProtocol::SendTriggeredUpdate().
|
private |
hold down time of an expired route
Definition at line 455 of file dsdv-rtable.h.
Referenced by Getholddowntime(), Purge(), and Setholddowntime().
|
private |
an entry in the routing table.
Definition at line 451 of file dsdv-rtable.h.
Referenced by AddRoute(), Clear(), DeleteAllRoutesFromInterface(), DeleteRoute(), GetListOfAllRoutes(), GetListOfDestinationWithNextHop(), LookupRoute(), LookupRoute(), Print(), Purge(), RoutingTableSize(), and Update().
|
private |
an entry in the event table.
Definition at line 453 of file dsdv-rtable.h.
Referenced by AddIpv4Event(), AnyRunningEvent(), DeleteIpv4Event(), ForceDeleteIpv4Event(), and GetEventId().