A Discrete-Event Network Simulator
API
ns3::aodv::Neighbors Class Reference

maintain list of active neighbors More...

#include "aodv-neighbor.h"

+ Collaboration diagram for ns3::aodv::Neighbors:

Classes

struct  Neighbor
 Neighbor description. More...
 

Public Member Functions

 Neighbors (Time delay)
 c-tor More...
 
void AddArpCache (Ptr< ArpCache >)
 Add ARP cache to be used to allow layer 2 notifications processing. More...
 
void Clear ()
 Remove all entries. More...
 
void DelArpCache (Ptr< ArpCache >)
 Don't use given ARP cache any more (interface is down) More...
 
Callback< void, Ipv4AddressGetCallback () const
 Handle link failure callback. More...
 
Time GetExpireTime (Ipv4Address addr)
 Return expire time for neighbor node with address addr, if exists, else return 0. More...
 
Callback< void, WifiMacHeader const & > GetTxErrorCallback () const
 Get callback to ProcessTxError. More...
 
bool IsNeighbor (Ipv4Address addr)
 Check that node with address addr is neighbor. More...
 
void Purge ()
 Remove all expired entries. More...
 
void ScheduleTimer ()
 Schedule m_ntimer. More...
 
void SetCallback (Callback< void, Ipv4Address > cb)
 Handle link failure callback. More...
 
void Update (Ipv4Address addr, Time expire)
 Update expire time for entry with address addr, if it exists, else add new entry. More...
 

Private Member Functions

Mac48Address LookupMacAddress (Ipv4Address)
 Find MAC address by IP using list of ARP caches. More...
 
void ProcessTxError (WifiMacHeader const &)
 Process layer 2 TX error notification. More...
 

Private Attributes

std::vector< Ptr< ArpCache > > m_arp
 list of ARP cached to be used for layer 2 notifications processing More...
 
Callback< void, Ipv4Addressm_handleLinkFailure
 link failure callback More...
 
std::vector< Neighborm_nb
 vector of entries More...
 
Timer m_ntimer
 Timer for neighbor's list. Schedule Purge(). More...
 
Callback< void, WifiMacHeader const & > m_txErrorCallback
 TX error callback. More...
 

Detailed Description

maintain list of active neighbors

Definition at line 49 of file aodv-neighbor.h.

Constructor & Destructor Documentation

ns3::aodv::Neighbors::Neighbors ( Time  delay)

c-tor

Definition at line 41 of file aodv-neighbor.cc.

References m_ntimer, m_txErrorCallback, ns3::MakeCallback(), ProcessTxError(), Purge(), ns3::Timer::SetDelay(), and ns3::Timer::SetFunction().

+ Here is the call graph for this function:

Member Function Documentation

void ns3::aodv::Neighbors::AddArpCache ( Ptr< ArpCache a)

Add ARP cache to be used to allow layer 2 notifications processing.

Definition at line 133 of file aodv-neighbor.cc.

References m_arp.

Referenced by ns3::aodv::RoutingProtocol::NotifyInterfaceUp().

+ Here is the caller graph for this function:

void ns3::aodv::Neighbors::Clear ( )
inline

Remove all entries.

Definition at line 79 of file aodv-neighbor.h.

References m_nb.

Referenced by ns3::aodv::RoutingProtocol::NotifyInterfaceDown(), and ns3::aodv::RoutingProtocol::NotifyRemoveAddress().

+ Here is the caller graph for this function:

void ns3::aodv::Neighbors::DelArpCache ( Ptr< ArpCache a)

Don't use given ARP cache any more (interface is down)

Definition at line 139 of file aodv-neighbor.cc.

References m_arp.

Referenced by ns3::aodv::RoutingProtocol::NotifyInterfaceDown().

+ Here is the caller graph for this function:

Callback<void, Ipv4Address> ns3::aodv::Neighbors::GetCallback ( ) const
inline

Handle link failure callback.

Definition at line 91 of file aodv-neighbor.h.

References m_handleLinkFailure.

Time ns3::aodv::Neighbors::GetExpireTime ( Ipv4Address  addr)

Return expire time for neighbor node with address addr, if exists, else return 0.

Definition at line 63 of file aodv-neighbor.cc.

References m_nb, ns3::Simulator::Now(), Purge(), and ns3::Seconds().

Referenced by ns3::aodv::NeighborTest::DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Callback<void, WifiMacHeader const &> ns3::aodv::Neighbors::GetTxErrorCallback ( ) const
inline

Get callback to ProcessTxError.

Definition at line 86 of file aodv-neighbor.h.

References m_txErrorCallback.

Referenced by ns3::aodv::RoutingProtocol::NotifyInterfaceDown(), and ns3::aodv::RoutingProtocol::NotifyInterfaceUp().

+ Here is the caller graph for this function:

bool ns3::aodv::Neighbors::IsNeighbor ( Ipv4Address  addr)

Check that node with address addr is neighbor.

Definition at line 50 of file aodv-neighbor.cc.

References m_nb, and Purge().

Referenced by ns3::aodv::NeighborTest::CheckTimeout1(), ns3::aodv::NeighborTest::CheckTimeout2(), ns3::aodv::NeighborTest::CheckTimeout3(), and ns3::aodv::NeighborTest::DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Mac48Address ns3::aodv::Neighbors::LookupMacAddress ( Ipv4Address  addr)
private

Find MAC address by IP using list of ARP caches.

Definition at line 145 of file aodv-neighbor.cc.

References ns3::Mac48Address::ConvertFrom(), ns3::ArpCache::Entry::GetMacAddress(), ns3::ArpCache::Entry::IsAlive(), ns3::ArpCache::Entry::IsExpired(), ns3::ArpCache::Entry::IsPermanent(), and m_arp.

Referenced by Update().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::aodv::Neighbors::ProcessTxError ( WifiMacHeader const &  hdr)
private

Process layer 2 TX error notification.

Definition at line 162 of file aodv-neighbor.cc.

References ns3::WifiMacHeader::GetAddr1(), m_nb, and Purge().

Referenced by Neighbors().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::aodv::Neighbors::Purge ( )

Remove all expired entries.

Definition at line 103 of file aodv-neighbor.cc.

References ns3::Timer::Cancel(), m_handleLinkFailure, m_nb, m_ntimer, NS_LOG_LOGIC, and ns3::Timer::Schedule().

Referenced by GetExpireTime(), IsNeighbor(), Neighbors(), ProcessTxError(), and Update().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::aodv::Neighbors::ScheduleTimer ( )

Schedule m_ntimer.

Definition at line 126 of file aodv-neighbor.cc.

References ns3::Timer::Cancel(), m_ntimer, and ns3::Timer::Schedule().

Referenced by ns3::aodv::RoutingProtocol::Start().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::aodv::Neighbors::SetCallback ( Callback< void, Ipv4Address cb)
inline

Handle link failure callback.

Definition at line 89 of file aodv-neighbor.h.

References m_handleLinkFailure.

Referenced by ns3::aodv::NeighborTest::DoRun(), and ns3::aodv::RoutingProtocol::RoutingProtocol().

+ Here is the caller graph for this function:

void ns3::aodv::Neighbors::Update ( Ipv4Address  addr,
Time  expire 
)

Update expire time for entry with address addr, if it exists, else add new entry.

Definition at line 76 of file aodv-neighbor.cc.

References LookupMacAddress(), m_nb, max, ns3::Simulator::Now(), NS_LOG_LOGIC, and Purge().

Referenced by ns3::aodv::NeighborTest::DoRun(), ns3::aodv::RoutingProtocol::Forwarding(), ns3::aodv::RoutingProtocol::ProcessHello(), ns3::aodv::RoutingProtocol::RecvRequest(), and ns3::aodv::RoutingProtocol::RouteInput().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<Ptr<ArpCache> > ns3::aodv::Neighbors::m_arp
private

list of ARP cached to be used for layer 2 notifications processing

Definition at line 103 of file aodv-neighbor.h.

Referenced by AddArpCache(), DelArpCache(), and LookupMacAddress().

Callback<void, Ipv4Address> ns3::aodv::Neighbors::m_handleLinkFailure
private

link failure callback

Definition at line 95 of file aodv-neighbor.h.

Referenced by GetCallback(), Purge(), and SetCallback().

std::vector<Neighbor> ns3::aodv::Neighbors::m_nb
private

vector of entries

Definition at line 101 of file aodv-neighbor.h.

Referenced by Clear(), GetExpireTime(), IsNeighbor(), ProcessTxError(), Purge(), and Update().

Timer ns3::aodv::Neighbors::m_ntimer
private

Timer for neighbor's list. Schedule Purge().

Definition at line 99 of file aodv-neighbor.h.

Referenced by Neighbors(), Purge(), and ScheduleTimer().

Callback<void, WifiMacHeader const &> ns3::aodv::Neighbors::m_txErrorCallback
private

TX error callback.

Definition at line 97 of file aodv-neighbor.h.

Referenced by GetTxErrorCallback(), and Neighbors().


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