A Discrete-Event Network Simulator
API
ndisc-cache.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007-2009 Strasbourg University
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/uinteger.h"
23 #include "ns3/node.h"
24 #include "ns3/names.h"
25 
26 #include "ipv6-l3-protocol.h"
27 #include "icmpv6-l4-protocol.h"
28 #include "ndisc-cache.h"
29 #include "ipv6-interface.h"
30 
31 namespace ns3
32 {
33 
34 NS_LOG_COMPONENT_DEFINE ("NdiscCache");
35 
36 NS_OBJECT_ENSURE_REGISTERED (NdiscCache);
37 
39 {
40  static TypeId tid = TypeId ("ns3::NdiscCache")
41  .SetParent<Object> ()
42  .SetGroupName ("Internet")
43  .AddAttribute ("UnresolvedQueueSize",
44  "Size of the queue for packets pending an NA reply.",
47  MakeUintegerChecker<uint32_t> ())
48  ;
49  return tid;
50 }
51 
53 {
54  NS_LOG_FUNCTION (this);
55 }
56 
58 {
59  NS_LOG_FUNCTION (this);
60  Flush ();
61 }
62 
64 {
65  NS_LOG_FUNCTION (this);
66  Flush ();
67  m_device = 0;
68  m_interface = 0;
69  m_icmpv6 = 0;
71 }
72 
74 {
75  NS_LOG_FUNCTION (this << device << interface);
76  m_device = device;
77  m_interface = interface;
78  m_icmpv6 = icmpv6;
79 }
80 
82 {
83  NS_LOG_FUNCTION (this);
84  return m_interface;
85 }
86 
88 {
89  NS_LOG_FUNCTION (this);
90  return m_device;
91 }
92 
94 {
95  NS_LOG_FUNCTION (this << dst);
96 
97  if (m_ndCache.find (dst) != m_ndCache.end ())
98  {
99  NdiscCache::Entry* entry = m_ndCache[dst];
100  NS_LOG_LOGIC ("Found an entry: " << *entry);
101 
102  return entry;
103  }
104  NS_LOG_LOGIC ("Nothing found");
105  return 0;
106 }
107 
108 std::list<NdiscCache::Entry*> NdiscCache::LookupInverse (Address dst)
109 {
110  NS_LOG_FUNCTION (this << dst);
111 
112  std::list<NdiscCache::Entry *> entryList;
113  for (CacheI i = m_ndCache.begin (); i != m_ndCache.end (); i++)
114  {
115  NdiscCache::Entry *entry = (*i).second;
116  if (entry->GetMacAddress () == dst)
117  {
118  NS_LOG_LOGIC ("Found an entry:" << (*entry));
119  entryList.push_back (entry);
120  }
121  }
122  return entryList;
123 }
124 
125 
127 {
128  NS_LOG_FUNCTION (this << to);
129  NS_ASSERT (m_ndCache.find (to) == m_ndCache.end ());
130 
131  NdiscCache::Entry* entry = new NdiscCache::Entry (this);
132  entry->SetIpv6Address (to);
133  m_ndCache[to] = entry;
134  return entry;
135 }
136 
138 {
139  NS_LOG_FUNCTION (this << entry);
140 
141  for (CacheI i = m_ndCache.begin (); i != m_ndCache.end (); i++)
142  {
143  if ((*i).second == entry)
144  {
145  m_ndCache.erase (i);
146  entry->ClearWaitingPacket ();
147  delete entry;
148  return;
149  }
150  }
151 }
152 
154 {
155  NS_LOG_FUNCTION (this);
156 
157  for (CacheI i = m_ndCache.begin (); i != m_ndCache.end (); i++)
158  {
159  delete (*i).second; /* delete the pointer NdiscCache::Entry */
160  }
161 
162  m_ndCache.erase (m_ndCache.begin (), m_ndCache.end ());
163 }
164 
165 void NdiscCache::SetUnresQlen (uint32_t unresQlen)
166 {
167  NS_LOG_FUNCTION (this << unresQlen);
168  m_unresQlen = unresQlen;
169 }
170 
172 {
173  NS_LOG_FUNCTION (this);
174  return m_unresQlen;
175 }
176 
178 {
179  NS_LOG_FUNCTION (this << stream);
180  std::ostream* os = stream->GetStream ();
181 
182  for (CacheI i = m_ndCache.begin (); i != m_ndCache.end (); i++)
183  {
184  *os << i->first << " dev ";
185  std::string found = Names::FindName (m_device);
186  if (Names::FindName (m_device) != "")
187  {
188  *os << found;
189  }
190  else
191  {
192  *os << static_cast<int> (m_device->GetIfIndex ());
193  }
194 
195  *os << " lladdr " << i->second->GetMacAddress ();
196 
197  if (i->second->IsReachable ())
198  {
199  *os << " REACHABLE\n";
200  }
201  else if (i->second->IsDelay ())
202  {
203  *os << " DELAY\n";
204  }
205  else if (i->second->IsIncomplete ())
206  {
207  *os << " INCOMPLETE\n";
208  }
209  else if (i->second->IsProbe ())
210  {
211  *os << " PROBE\n";
212  }
213  else if (i->second->IsStale ())
214  {
215  *os << " STALE\n";
216  }
217  else if (i->second->IsPermanent ())
218  {
219  *os << " PERMANENT\n";
220  }
221  else
222  {
223  NS_FATAL_ERROR ("Test for possibly unreachable code-- please file a bug report, with a test case, if this is ever hit");
224  }
225  }
226 }
227 
229  : m_ndCache (nd),
230  m_waiting (),
231  m_router (false),
232  m_nudTimer (Timer::CANCEL_ON_DESTROY),
233  m_lastReachabilityConfirmation (Seconds (0.0)),
234  m_nsRetransmit (0)
235 {
236  NS_LOG_FUNCTION (this);
237 }
238 
240 {
241  NS_LOG_FUNCTION (this << router);
242  m_router = router;
243 }
244 
246 {
247  NS_LOG_FUNCTION (this);
248  return m_router;
249 }
250 
252 {
253  NS_LOG_FUNCTION (this << p.second << p.first);
254 
255  if (m_waiting.size () >= m_ndCache->GetUnresQlen ())
256  {
257  /* we store only m_unresQlen packet => first packet in first packet remove */
259  m_waiting.pop_front ();
260  }
261  m_waiting.push_back (p);
262 }
263 
265 {
266  NS_LOG_FUNCTION (this);
268  m_waiting.clear ();
269 }
270 
272 {
273  NS_LOG_FUNCTION (this);
274  this->MarkStale ();
275 }
276 
278 {
279  NS_LOG_FUNCTION (this);
280  Ipv6Address addr;
281 
282  /* determine source address */
283  if (m_ipv6Address.IsLinkLocal ())
284  {
285  addr = m_ndCache->GetInterface ()->GetLinkLocalAddress ().GetAddress ();
286  }
287  else if (!m_ipv6Address.IsAny ())
288  {
289  addr = m_ndCache->GetInterface ()->GetAddressMatchingDestination (m_ipv6Address).GetAddress ();
290 
291  if (addr.IsAny ()) /* maybe address has expired */
292  {
293  /* delete the entry */
294  m_ndCache->Remove (this);
295  return;
296  }
297  }
298 
299  if (m_nsRetransmit < m_ndCache->m_icmpv6->GetMaxMulticastSolicit ())
300  {
301  m_nsRetransmit++;
302 
303  m_ndCache->m_icmpv6->SendNS (addr, Ipv6Address::MakeSolicitedAddress (m_ipv6Address), m_ipv6Address, m_ndCache->GetDevice ()->GetAddress ());
304  /* arm the timer again */
305  StartRetransmitTimer ();
306  }
307  else
308  {
309  Ipv6PayloadHeaderPair malformedPacket = m_waiting.front ();
310  if (malformedPacket.first == 0)
311  {
312  malformedPacket.first = Create<Packet> ();
313  }
314  else
315  {
316  malformedPacket.first->AddHeader (malformedPacket.second);
317  }
318 
319  m_ndCache->m_icmpv6->SendErrorDestinationUnreachable (malformedPacket.first, addr, Icmpv6Header::ICMPV6_ADDR_UNREACHABLE);
320 
321  /* delete the entry */
322  m_ndCache->Remove (this);
323  }
324 }
325 
327 {
328  NS_LOG_FUNCTION (this);
329  Ipv6Address addr;
330 
331  this->MarkProbe ();
332 
333  if (m_ipv6Address.IsLinkLocal ())
334  {
335  addr = m_ndCache->GetInterface ()->GetLinkLocalAddress ().GetAddress ();
336  }
337  else if (!m_ipv6Address.IsAny ())
338  {
339  addr = m_ndCache->GetInterface ()->GetAddressMatchingDestination (m_ipv6Address).GetAddress ();
340  if (addr.IsAny ()) /* maybe address has expired */
341  {
342  /* delete the entry */
343  m_ndCache->Remove (this);
344  return;
345  }
346  }
347  else
348  {
349  /* should not happen */
350  return;
351  }
352 
353  Ipv6PayloadHeaderPair p = m_ndCache->m_icmpv6->ForgeNS (addr, m_ipv6Address, m_ipv6Address, m_ndCache->GetDevice ()->GetAddress ());
354  p.first->AddHeader (p.second);
355  m_ndCache->GetDevice ()->Send (p.first, this->GetMacAddress (), Ipv6L3Protocol::PROT_NUMBER);
356 
357  m_nsRetransmit = 1;
358  StartProbeTimer ();
359 }
360 
362 {
363  NS_LOG_FUNCTION (this);
364 
365  if (m_nsRetransmit < m_ndCache->m_icmpv6->GetMaxUnicastSolicit ())
366  {
367  m_nsRetransmit++;
368 
369  Ipv6Address addr;
370 
371  if (m_ipv6Address.IsLinkLocal ())
372  {
373  addr = m_ndCache->GetInterface ()->GetLinkLocalAddress ().GetAddress ();
374  }
375  else if (!m_ipv6Address.IsAny ())
376  {
377  addr = m_ndCache->GetInterface ()->GetAddressMatchingDestination (m_ipv6Address).GetAddress ();
378  if (addr.IsAny ()) /* maybe address has expired */
379  {
380  /* delete the entry */
381  m_ndCache->Remove (this);
382  return;
383  }
384  }
385  else
386  {
387  /* should not happen */
388  return;
389  }
390 
391  /* icmpv6->SendNS (m_ndCache->GetInterface ()->GetLinkLocalAddress (), m_ipv6Address, m_ipv6Address, m_ndCache->GetDevice ()->GetAddress ()); */
392  Ipv6PayloadHeaderPair p = m_ndCache->m_icmpv6->ForgeNS (addr, m_ipv6Address, m_ipv6Address, m_ndCache->GetDevice ()->GetAddress ());
393  p.first->AddHeader (p.second);
394  m_ndCache->GetDevice ()->Send (p.first, this->GetMacAddress (), Ipv6L3Protocol::PROT_NUMBER);
395 
396  /* arm the timer again */
397  StartProbeTimer ();
398  }
399  else
400  {
401  /* delete the entry */
402  m_ndCache->Remove (this);
403  }
404 }
405 
407 {
408  NS_LOG_FUNCTION (this << ipv6Address);
409  m_ipv6Address = ipv6Address;
410 }
411 
413 {
414  NS_LOG_FUNCTION (this);
415  return m_lastReachabilityConfirmation;
416 }
417 
419 {
420  NS_LOG_FUNCTION (this);
421  if (m_nudTimer.IsRunning ())
422  {
423  m_nudTimer.Cancel ();
424  }
425 
426  m_lastReachabilityConfirmation = Simulator::Now ();
427  m_nudTimer.SetFunction (&NdiscCache::Entry::FunctionReachableTimeout, this);
428  m_nudTimer.SetDelay (m_ndCache->m_icmpv6->GetReachableTime ());
429  m_nudTimer.Schedule ();
430 }
431 
433 {
434  NS_LOG_FUNCTION (this);
435 
436  if (m_state == REACHABLE)
437  {
438  m_lastReachabilityConfirmation = Simulator::Now ();
439  if (m_nudTimer.IsRunning ())
440  {
441  m_nudTimer.Cancel ();
442  }
443  m_nudTimer.Schedule ();
444  }
445 }
446 
448 {
449  NS_LOG_FUNCTION (this);
450  if (m_nudTimer.IsRunning ())
451  {
452  m_nudTimer.Cancel ();
453  }
454 
455  m_nudTimer.SetFunction (&NdiscCache::Entry::FunctionProbeTimeout, this);
456  m_nudTimer.SetDelay (m_ndCache->m_icmpv6->GetRetransmissionTime ());
457  m_nudTimer.Schedule ();
458 }
459 
461 {
462  NS_LOG_FUNCTION (this);
463  if (m_nudTimer.IsRunning ())
464  {
465  m_nudTimer.Cancel ();
466  }
467 
468  m_nudTimer.SetFunction (&NdiscCache::Entry::FunctionDelayTimeout, this);
469  m_nudTimer.SetDelay (m_ndCache->m_icmpv6->GetDelayFirstProbe ());
470  m_nudTimer.Schedule ();
471 }
472 
474 {
475  NS_LOG_FUNCTION (this);
476  if (m_nudTimer.IsRunning ())
477  {
478  m_nudTimer.Cancel ();
479  }
480 
481  m_nudTimer.SetFunction (&NdiscCache::Entry::FunctionRetransmitTimeout, this);
482  m_nudTimer.SetDelay (m_ndCache->m_icmpv6->GetRetransmissionTime ());
483  m_nudTimer.Schedule ();
484 }
485 
487 {
488  NS_LOG_FUNCTION (this);
489  m_nudTimer.Cancel ();
490  m_nsRetransmit = 0;
491 }
492 
494 {
495  NS_LOG_FUNCTION (this << p.second << p.first);
496  m_state = INCOMPLETE;
497 
498  if (p.first)
499  {
500  m_waiting.push_back (p);
501  }
502 }
503 
504 std::list<NdiscCache::Ipv6PayloadHeaderPair> NdiscCache::Entry::MarkReachable (Address mac)
505 {
506  NS_LOG_FUNCTION (this << mac);
507  m_state = REACHABLE;
508  m_macAddress = mac;
509  return m_waiting;
510 }
511 
513 {
514  NS_LOG_FUNCTION (this);
515  m_state = PROBE;
516 }
517 
519 {
520  NS_LOG_FUNCTION (this);
521  m_state = STALE;
522 }
523 
525 {
526  NS_LOG_FUNCTION (this);
527  m_state = REACHABLE;
528 }
529 
530 std::list<NdiscCache::Ipv6PayloadHeaderPair> NdiscCache::Entry::MarkStale (Address mac)
531 {
532  NS_LOG_FUNCTION (this << mac);
533  m_state = STALE;
534  m_macAddress = mac;
535  return m_waiting;
536 }
537 
539 {
540  NS_LOG_FUNCTION (this);
541  m_state = DELAY;
542 }
543 
545 {
546  NS_LOG_FUNCTION (this);
547  StopNudTimer ();
548  m_state = PERMANENT;
549 }
550 
552 {
553  NS_LOG_FUNCTION (this);
554  return (m_state == STALE);
555 }
556 
558 {
559  NS_LOG_FUNCTION (this);
560  return (m_state == REACHABLE);
561 }
562 
564 {
565  NS_LOG_FUNCTION (this);
566  return (m_state == DELAY);
567 }
568 
570 {
571  NS_LOG_FUNCTION (this);
572  return (m_state == INCOMPLETE);
573 }
574 
576 {
577  NS_LOG_FUNCTION (this);
578  return (m_state == PROBE);
579 }
580 
582 {
583  NS_LOG_FUNCTION (this);
584  return (m_state == PERMANENT);
585 }
586 
588 {
589  NS_LOG_FUNCTION (this);
590  return m_macAddress;
591 }
592 
594 {
595  NS_LOG_FUNCTION (this << mac << int(m_state));
596  m_macAddress = mac;
597 }
598 
599 void NdiscCache::Entry::Print (std::ostream &os) const
600 {
601  os << m_ipv6Address << " lladdr " << m_macAddress << " state ";
602  switch (m_state)
603  {
604  case INCOMPLETE:
605  os << "INCOMPLETE";
606  break;
607  case REACHABLE:
608  os << "REACHABLE";
609  break;
610  case STALE:
611  os << "STALE";
612  break;
613  case DELAY:
614  os << "DELAY";
615  break;
616  case PROBE:
617  os << "PROBE";
618  break;
619  case PERMANENT:
620  os << "PERMANENT";
621  break;
622  }
623 }
624 
625 std::ostream& operator << (std::ostream& os, NdiscCache::Entry const& entry)
626 {
627  entry.Print (os);
628  return os;
629 }
630 
631 } /* namespace ns3 */
632 
Address GetMacAddress() const
Get the MAC address of this entry.
Definition: ndisc-cache.cc:587
void FunctionDelayTimeout()
Function called when delay timer timeout.
Definition: ndisc-cache.cc:326
static TypeId GetTypeId()
Get the type ID.
Definition: ndisc-cache.cc:38
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
bool IsReachable() const
Is the entry REACHABLE.
Definition: ndisc-cache.cc:557
~NdiscCache()
Destructor.
Definition: ndisc-cache.cc:57
A simple virtual Timer class.
Definition: timer.h:73
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
virtual NdiscCache::Entry * Add(Ipv6Address to)
Add an entry.
Definition: ndisc-cache.cc:126
void Print(std::ostream &os) const
Print this entry to the given output stream.
Definition: ndisc-cache.cc:599
void SetUnresQlen(uint32_t unresQlen)
Set the max number of waiting packet.
Definition: ndisc-cache.cc:165
void StopNudTimer()
Stop NUD timer and reset the NUD retransmission counter.
Definition: ndisc-cache.cc:486
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
Ptr< Icmpv6L4Protocol > m_icmpv6
the icmpv6 L4 protocol for this cache.
Definition: ndisc-cache.h:466
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
bool IsIncomplete() const
Is the entry INCOMPLETE.
Definition: ndisc-cache.cc:569
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:346
void SetDevice(Ptr< NetDevice > device, Ptr< Ipv6Interface > interface, Ptr< Icmpv6L4Protocol > icmpv6)
Set the device and interface.
Definition: ndisc-cache.cc:73
Time GetLastReachabilityConfirmation() const
Get the time of last reachability confirmation.
Definition: ndisc-cache.cc:412
void MarkPermanent()
Change the state to this entry to PERMANENT.
Definition: ndisc-cache.cc:544
a polymophic address class
Definition: address.h:90
uint32_t GetUnresQlen()
Get the max number of waiting packet.
Definition: ndisc-cache.cc:171
Ptr< NetDevice > GetDevice() const
Get the NetDevice associated with this cache.
Definition: ndisc-cache.cc:87
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
Ptr< Ipv6Interface > m_interface
the interface.
Definition: ndisc-cache.h:461
void FunctionRetransmitTimeout()
Function called when retransmit timer timeout.
Definition: ndisc-cache.cc:277
void MarkReachable()
Changes the state to this entry to REACHABLE.
Definition: ndisc-cache.cc:524
void Flush()
Flush the cache.
Definition: ndisc-cache.cc:153
Hold an unsigned integer type.
Definition: uinteger.h:44
#define DELAY(time)
Gets the delay between a given time and the current time.
mac
Definition: third.py:99
IPv6 Neighbor Discovery cache.
Definition: ndisc-cache.h:49
Ptr< Ipv6Interface > GetInterface() const
Get the Ipv6Interface associated with this cache.
Definition: ndisc-cache.cc:81
void PrintNdiscCache(Ptr< OutputStreamWrapper > stream)
Print the NDISC cache entries.
Definition: ndisc-cache.cc:177
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
NdiscCache()
Constructor.
Definition: ndisc-cache.cc:52
void StartRetransmitTimer()
Start retransmit timer.
Definition: ndisc-cache.cc:473
std::unordered_map< Ipv6Address, NdiscCache::Entry *, Ipv6AddressHash >::iterator CacheI
Neighbor Discovery Cache container iterator.
Definition: ndisc-cache.h:428
void ClearWaitingPacket()
Clear the waiting packet list.
Definition: ndisc-cache.cc:264
Entry(NdiscCache *nd)
Constructor.
Definition: ndisc-cache.cc:228
bool IsStale() const
Is the entry STALE.
Definition: ndisc-cache.cc:551
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void StartDelayTimer()
Start delay timer.
Definition: ndisc-cache.cc:460
bool IsRouter() const
If the entry is a host or a router.
Definition: ndisc-cache.cc:245
void StartReachableTimer()
Start the reachable timer.
Definition: ndisc-cache.cc:418
void FunctionReachableTimeout()
Function called when reachable timer timeout.
Definition: ndisc-cache.cc:271
void StartProbeTimer()
Start probe timer.
Definition: ndisc-cache.cc:447
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
static const uint32_t DEFAULT_UNRES_QLEN
Default value for unres qlen.
Definition: ndisc-cache.h:63
void Remove(NdiscCache::Entry *entry)
Delete an entry.
Definition: ndisc-cache.cc:137
void FunctionProbeTimeout()
Function called when probe timer timeout.
Definition: ndisc-cache.cc:361
uint32_t m_unresQlen
Max number of packet stored in m_waiting.
Definition: ndisc-cache.h:471
void UpdateReachableTimer()
Update the reachable timer.
Definition: ndisc-cache.cc:432
std::list< NdiscCache::Entry * > LookupInverse(Address dst)
Lookup in the cache for a MAC address.
Definition: ndisc-cache.cc:108
void SetMacAddress(Address mac)
Set the MAC address of this entry.
Definition: ndisc-cache.cc:593
Describes an IPv6 address.
Definition: ipv6-address.h:49
bool IsProbe() const
Is the entry PROBE.
Definition: ndisc-cache.cc:575
virtual NdiscCache::Entry * Lookup(Ipv6Address dst)
Lookup in the cache.
Definition: ndisc-cache.cc:93
void MarkStale()
Changes the state to this entry to STALE.
Definition: ndisc-cache.cc:518
void DoDispose()
Dispose this object.
Definition: ndisc-cache.cc:63
void SetIpv6Address(Ipv6Address ipv6Address)
Set the IPv6 address.
Definition: ndisc-cache.cc:406
void MarkDelay()
Change the state to this entry to DELAY.
Definition: ndisc-cache.cc:538
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
static std::string FindName(Ptr< Object > object)
Given a pointer to an object, look to see if that object has a name associated with it and...
Definition: names.cc:817
void MarkIncomplete(Ipv6PayloadHeaderPair p)
Changes the state to this entry to INCOMPLETE.
Definition: ndisc-cache.cc:493
Cache m_ndCache
A list of Entry.
Definition: ndisc-cache.h:433
A record that holds information about a NdiscCache entry.
Definition: ndisc-cache.h:156
void SetRouter(bool router)
Set the node type.
Definition: ndisc-cache.cc:239
A base class which provides memory management and object aggregation.
Definition: object.h:87
std::pair< Ptr< Packet >, Ipv6Header > Ipv6PayloadHeaderPair
Pair of a packet and an Ipv4 header.
Definition: ndisc-cache.h:149
bool IsDelay() const
Is the entry DELAY.
Definition: ndisc-cache.cc:563
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: uinteger.h:45
bool IsPermanent() const
Is the entry PERMANENT.
Definition: ndisc-cache.cc:581
a unique identifier for an interface.
Definition: type-id.h:58
void AddWaitingPacket(Ipv6PayloadHeaderPair p)
Add a packet (or replace old value) in the queue.
Definition: ndisc-cache.cc:251
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
void MarkProbe()
Changes the state to this entry to PROBE.
Definition: ndisc-cache.cc:512
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
bool IsAny() const
If the IPv6 address is the "Any" address.
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address.
Ptr< NetDevice > m_device
The NetDevice.
Definition: ndisc-cache.h:456