|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
31 #include "ns3/wifi-mac-header.h"
40 : m_ntimer (
Timer::CANCEL_ON_DESTROY)
51 for (std::vector<Neighbor>::const_iterator i =
m_nb.begin ();
52 i !=
m_nb.end (); ++i)
54 if (i->m_neighborAddress == addr)
66 for (std::vector<Neighbor>::const_iterator i =
m_nb.begin (); i
69 if (i->m_neighborAddress == addr)
80 for (std::vector<Neighbor>::iterator i =
m_nb.begin (); i !=
m_nb.end (); ++i)
82 if (i->m_neighborAddress == addr)
96 m_nb.push_back (neighbor);
128 for (std::vector<Neighbor>::iterator j =
m_nb.begin (); j !=
m_nb.end (); ++j)
132 NS_LOG_LOGIC (
"Close link to " << j->m_neighborAddress);
137 m_nb.erase (std::remove_if (
m_nb.begin (),
m_nb.end (), pred),
m_nb.end ());
166 i !=
m_arp.end (); ++i)
183 for (std::vector<Neighbor>::iterator i =
m_nb.begin (); i !=
m_nb.end (); ++i)
185 if (i->m_hardwareAddress == addr)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void Update(Ipv4Address addr, Time expire)
Update expire time for entry with address addr, if it exists, else add new entry.
Neighbors(Time delay)
constructor
void ScheduleTimer()
Schedule m_ntimer.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A record that that holds information about an ArpCache entry.
Mac48Address LookupMacAddress(Ipv4Address addr)
Find MAC address by IP using list of ARP caches.
Ipv4 addresses are stored in host order in this class.
void AddArpCache(Ptr< ArpCache > a)
Add ARP cache to be used to allow layer 2 notifications processing.
void DelArpCache(Ptr< ArpCache > a)
Don't use given ARP cache any more (interface is down)
std::vector< Neighbor > m_nb
vector of entries
void Cancel(void)
Cancel the currently-running event if there is one.
void Purge()
Remove all expired entries.
bool close
Neighbor close indicator.
A simple virtual Timer class.
bool operator()(const Neighbors::Neighbor &nb) const
Check if the entry is expired.
static Mac48Address ConvertFrom(const Address &address)
void Schedule(void)
Schedule a new event using the currently-configured delay, function, and arguments.
Callback< void, WifiMacHeader const & > m_txErrorCallback
TX error callback.
bool IsNeighbor(Ipv4Address addr)
Check that node with address addr is neighbor.
void ProcessTxError(WifiMacHeader const &hdr)
Process layer 2 TX error notification.
Simulation virtual time values and global simulation resolution.
Time m_expireTime
Neighbor expire time.
Address GetMacAddress(void) const
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
void SetDelay(const Time &delay)
Time Seconds(double value)
Construct a Time in the indicated unit.
std::vector< Ptr< ArpCache > > m_arp
list of ARP cached to be used for layer 2 notifications processing
Timer m_ntimer
Timer for neighbor's list. Schedule Purge().
bool IsExpired(void) const
Time GetExpireTime(Ipv4Address addr)
Return expire time for neighbor node with address addr, if exists, else return 0.
Callback< void, Ipv4Address > m_handleLinkFailure
link failure callback