The Routing table used by AODV protocol. More...
#include <aodv-rtable.h>
Public Member Functions | |
RoutingTable (Time t) | |
c-tor | |
bool | AddRoute (RoutingTableEntry &r) |
void | Clear () |
Delete all entries from routing table. | |
void | DeleteAllRoutesFromInterface (Ipv4InterfaceAddress iface) |
Delete all route from interface with address iface. | |
bool | DeleteRoute (Ipv4Address dst) |
void | GetListOfDestinationWithNextHop (Ipv4Address nextHop, std::map< Ipv4Address, uint32_t > &unreachable) |
Lookup routing entries with next hop Address dst and not empty list of precursors. | |
void | InvalidateRoutesWithDst (std::map< Ipv4Address, uint32_t > const &unreachable) |
bool | LookupRoute (Ipv4Address dst, RoutingTableEntry &rt) |
bool | LookupValidRoute (Ipv4Address dst, RoutingTableEntry &rt) |
Lookup route in VALID state. | |
bool | MarkLinkAsUnidirectional (Ipv4Address neighbor, Time blacklistTimeout) |
void | Print (Ptr< OutputStreamWrapper > stream) const |
Print routing table. | |
void | Purge () |
Delete all outdated entries and invalidate valid entry if Lifetime is expired. | |
bool | SetEntryState (Ipv4Address dst, RouteFlags state) |
Set routing table entry flags. | |
bool | Update (RoutingTableEntry &rt) |
Update routing table. | |
Handle life time of invalid route | |
Time | GetBadLinkLifetime () const |
void | SetBadLinkLifetime (Time t) |
Private Member Functions | |
void | Purge (std::map< Ipv4Address, RoutingTableEntry > &table) const |
const version of Purge, for use by Print() method | |
Private Attributes | |
Time | m_badLinkLifetime |
Deletion time for invalid routes. | |
std::map< Ipv4Address, RoutingTableEntry > | m_ipv4AddressEntry |
The Routing table used by AODV protocol.
Definition at line 193 of file aodv-rtable.h.
bool ns3::aodv::RoutingTable::AddRoute | ( | RoutingTableEntry & | r | ) |
Add routing table entry if it doesn't yet exist in routing table
r | routing table entry |
Definition at line 250 of file aodv-rtable.cc.
References ns3::aodv::IN_SEARCH, NS_LOG_FUNCTION, and Purge().
Referenced by ns3::aodv::AodvRtableTest::DoRun(), ns3::aodv::RoutingProtocol::NotifyAddAddress(), ns3::aodv::RoutingProtocol::NotifyInterfaceUp(), ns3::aodv::RoutingProtocol::NotifyRemoveAddress(), ns3::aodv::RoutingProtocol::ProcessHello(), ns3::aodv::RoutingProtocol::RecvReply(), ns3::aodv::RoutingProtocol::RecvRequest(), ns3::aodv::RoutingProtocol::SendRequest(), ns3::aodv::RoutingProtocol::SetIpv4(), and ns3::aodv::RoutingProtocol::UpdateRouteToNeighbor().
bool ns3::aodv::RoutingTable::DeleteRoute | ( | Ipv4Address | dst | ) |
Delete routing table entry with destination address dst, if it exists.
dst | destination address |
Definition at line 236 of file aodv-rtable.cc.
References NS_LOG_FUNCTION, NS_LOG_LOGIC, and Purge().
Referenced by ns3::aodv::AodvRtableTest::DoRun(), and ns3::aodv::RoutingProtocol::RouteRequestTimerExpire().
void ns3::aodv::RoutingTable::InvalidateRoutesWithDst | ( | std::map< Ipv4Address, uint32_t > const & | unreachable | ) |
Update routing entries with this destinations as follows:
Definition at line 316 of file aodv-rtable.cc.
References m_badLinkLifetime, NS_LOG_FUNCTION, NS_LOG_LOGIC, Purge(), and ns3::aodv::VALID.
Referenced by ns3::aodv::AodvRtableTest::DoRun(), ns3::aodv::RoutingProtocol::RecvError(), and ns3::aodv::RoutingProtocol::SendRerrWhenBreaksLinkToNextHop().
bool ns3::aodv::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 201 of file aodv-rtable.cc.
References NS_LOG_FUNCTION, NS_LOG_LOGIC, and Purge().
Referenced by ns3::aodv::RoutingProtocol::DeferredRouteOutput(), ns3::aodv::AodvRtableTest::DoRun(), ns3::aodv::RoutingProtocol::Forwarding(), LookupValidRoute(), ns3::aodv::RoutingProtocol::ProcessHello(), ns3::aodv::RoutingProtocol::RecvError(), ns3::aodv::RoutingProtocol::RecvReply(), ns3::aodv::RoutingProtocol::RecvReplyAck(), ns3::aodv::RoutingProtocol::RecvRequest(), ns3::aodv::RoutingProtocol::RouteInput(), ns3::aodv::RoutingProtocol::ScheduleRreqRetry(), ns3::aodv::RoutingProtocol::SendReplyAck(), ns3::aodv::RoutingProtocol::SendReplyByIntermediateNode(), ns3::aodv::RoutingProtocol::SendRequest(), ns3::aodv::RoutingProtocol::SendRerrWhenBreaksLinkToNextHop(), ns3::aodv::RoutingProtocol::UpdateRouteLifeTime(), and ns3::aodv::RoutingProtocol::UpdateRouteToNeighbor().
bool ns3::aodv::RoutingTable::MarkLinkAsUnidirectional | ( | Ipv4Address | neighbor, |
Time | blacklistTimeout | ||
) |
Mark entry as unidirectional (e.g. add this neighbor to "blacklist" for blacklistTimeout period)
neighbor | - neighbor address link to which assumed to be unidirectional |
blacklistTimeout | - time for which the neighboring node is put into the blacklist |
Definition at line 422 of file aodv-rtable.cc.
References ns3::Time::GetSeconds(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by ns3::aodv::RoutingProtocol::AckTimerExpire(), and ns3::aodv::AodvRtableTest::DoRun().