A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
void AddArpCache (Ptr< ArpCache >)
 Add ARP cache to be used to allow layer 2 notifications processing.
void Clear ()
 Remove all entries.
void DelArpCache (Ptr< ArpCache >)
 Don't use given ARP cache any more (interface is down)
Time GetExpireTime (Ipv4Address addr)
 Return expire time for neighbor node with address addr, if exists, else return 0.
Callback< void, WifiMacHeader
const & > 
GetTxErrorCallback () const
 Get callback to ProcessTxError.
bool IsNeighbor (Ipv4Address addr)
 Check that node with address addr is neighbor.
void Purge ()
 Remove all expired entries.
void ScheduleTimer ()
 Schedule m_ntimer.
void Update (Ipv4Address addr, Time expire)
 Update expire time for entry with address addr, if it exists, else add new entry.
Handle link failure callback
void SetCallback (Callback< void, Ipv4Address > cb)
Callback< void, Ipv4AddressGetCallback () const

Private Member Functions

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

Private Attributes

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

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 39 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 131 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 137 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

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 61 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 48 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 143 of file aodv-neighbor.cc.

References ns3::Mac48Address::ConvertFrom(), ns3::ArpCache::Entry::GetMacAddress(), ns3::ArpCache::Entry::IsAlive(), ns3::ArpCache::Entry::IsExpired(), 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 160 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 101 of file aodv-neighbor.cc.

References ns3::Timer::Cancel(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), 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 124 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

Definition at line 90 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 74 of file aodv-neighbor.cc.

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

Referenced by ns3::aodv::NeighborTest::DoRun(), ns3::aodv::RoutingProtocol::Forwarding(), ns3::aodv::RoutingProtocol::ProcessHello(), 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: