20#include "ns3/arp-cache.h"
21#include "ns3/callback.h"
22#include "ns3/ipv4-address.h"
23#include "ns3/simulator.h"
Ipv4 addresses are stored in host order in this class.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
A simple virtual Timer class.
maintain list of active neighbors
Time GetExpireTime(Ipv4Address addr)
Return expire time for neighbor node with address addr, if exists, else return 0.
void ScheduleTimer()
Schedule m_ntimer.
Neighbors(Time delay)
constructor
void Clear()
Remove all entries.
Callback< void, const WifiMacHeader & > m_txErrorCallback
TX error callback.
void Purge()
Remove all expired entries.
std::vector< Ptr< ArpCache > > m_arp
list of ARP cached to be used for layer 2 notifications processing
Mac48Address LookupMacAddress(Ipv4Address addr)
Find MAC address by IP using list of ARP caches.
Callback< void, Ipv4Address > GetCallback() const
Get link failure callback.
void Update(Ipv4Address addr, Time expire)
Update expire time for entry with address addr, if it exists, else add new entry.
std::vector< Neighbor > m_nb
vector of entries
Timer m_ntimer
Timer for neighbor's list. Schedule Purge().
Callback< void, const WifiMacHeader & > GetTxErrorCallback() const
Get callback to ProcessTxError.
Callback< void, Ipv4Address > m_handleLinkFailure
link failure callback
void SetCallback(Callback< void, Ipv4Address > cb)
Set link failure callback.
void ProcessTxError(const WifiMacHeader &hdr)
Process layer 2 TX error notification.
void DelArpCache(Ptr< ArpCache > a)
Don't use given ARP cache any more (interface is down)
bool IsNeighbor(Ipv4Address addr)
Check that node with address addr is neighbor.
void AddArpCache(Ptr< ArpCache > a)
Add ARP cache to be used to allow layer 2 notifications processing.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool close
Neighbor close indicator.
Neighbor(Ipv4Address ip, Mac48Address mac, Time t)
Neighbor structure constructor.
Mac48Address m_hardwareAddress
Neighbor MAC address.
Ipv4Address m_neighborAddress
Neighbor IPv4 address.
Time m_expireTime
Neighbor expire time.