A Discrete-Event Network Simulator
API
ipv6-interface.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/node.h"
23 #include "ns3/packet.h"
24 #include "ns3/net-device.h"
25 #include "ns3/mac16-address.h"
26 #include "ns3/mac64-address.h"
27 #include "ns3/traffic-control-layer.h"
28 
29 #include "ipv6-interface.h"
30 #include "ipv6-queue-disc-item.h"
31 #include "loopback-net-device.h"
32 #include "ipv6-l3-protocol.h"
33 #include "icmpv6-l4-protocol.h"
34 #include "ipv6-header.h"
35 #include "ndisc-cache.h"
36 
37 namespace ns3
38 {
39 
40 NS_LOG_COMPONENT_DEFINE ("Ipv6Interface");
41 
42 NS_OBJECT_ENSURE_REGISTERED (Ipv6Interface);
43 
45 {
46  static TypeId tid = TypeId ("ns3::Ipv6Interface")
47  .SetParent<Object> ()
48  .SetGroupName ("Internet")
49  ;
50  return tid;
51 }
52 
54  : m_ifup (false),
55  m_forwarding (true),
56  m_metric (1),
57  m_node (0),
58  m_device (0),
59  m_tc (0),
60  m_ndCache (0),
61  m_curHopLimit (0),
62  m_baseReachableTime (0),
63  m_reachableTime (0),
64  m_retransTimer (0)
65 {
66  NS_LOG_FUNCTION (this);
67 }
68 
70 {
71 }
72 
74 {
75  NS_LOG_FUNCTION (this);
76  m_node = 0;
77  m_device = 0;
78  m_tc = 0;
79  m_ndCache = 0;
81 }
82 
84 {
85  NS_LOG_FUNCTION (this);
86 
87  if (m_node == 0 || m_device == 0)
88  {
89  return;
90  }
91 
92  /* set up link-local address */
93  if (!DynamicCast<LoopbackNetDevice> (m_device)) /* no autoconf for ip6-localhost */
94  {
95  Address addr = GetDevice ()->GetAddress ();
97  AddAddress (ifaddr);
98  m_linkLocalAddress = ifaddr;
99  }
100  else
101  {
102  return; /* no NDISC cache for ip6-localhost */
103  }
104  int32_t interfaceId = m_node->GetObject<Ipv6> ()->GetInterfaceForDevice (m_device);
105  Ptr<Icmpv6L4Protocol> icmpv6 = DynamicCast<Icmpv6L4Protocol> (m_node->GetObject<Ipv6> ()->GetProtocol (Icmpv6L4Protocol::GetStaticProtocolNumber (), interfaceId));
106 
107  if (icmpv6 && !m_ndCache)
108  {
109  m_ndCache = icmpv6->CreateCache (m_device, this);
110  }
111 }
112 
114 {
115  NS_LOG_FUNCTION (this << node);
116  m_node = node;
117 }
118 
120 {
121  NS_LOG_FUNCTION (this << device);
122  m_device = device;
123 }
124 
125 void
127 {
128  NS_LOG_FUNCTION (this << tc);
129  m_tc = tc;
130 }
131 
133 {
134  NS_LOG_FUNCTION (this);
135  return m_device;
136 }
137 
138 void Ipv6Interface::SetMetric (uint16_t metric)
139 {
140  NS_LOG_FUNCTION (this << metric);
141  m_metric = metric;
142 }
143 
144 uint16_t Ipv6Interface::GetMetric () const
145 {
146  NS_LOG_FUNCTION (this);
147  return m_metric;
148 }
149 
150 bool Ipv6Interface::IsUp () const
151 {
152  NS_LOG_FUNCTION (this);
153  return m_ifup;
154 }
155 
157 {
158  NS_LOG_FUNCTION (this);
159  return !m_ifup;
160 }
161 
163 {
164  NS_LOG_FUNCTION (this);
165 
166  if (m_ifup)
167  {
168  return;
169  }
170  DoSetup ();
171  m_ifup = true;
172 }
173 
175 {
176  NS_LOG_FUNCTION (this);
177  m_ifup = false;
178  m_addresses.clear ();
179  m_ndCache->Flush ();
180 }
181 
183 {
184  NS_LOG_FUNCTION (this);
185  return m_forwarding;
186 }
187 
188 void Ipv6Interface::SetForwarding (bool forwarding)
189 {
190  NS_LOG_FUNCTION (this << forwarding);
191  m_forwarding = forwarding;
192 }
193 
195 {
196  NS_LOG_FUNCTION (this << iface);
197  Ipv6Address addr = iface.GetAddress ();
198 
199  /* DAD handling */
200  if (!addr.IsAny ())
201  {
202  for (Ipv6InterfaceAddressListCI it = m_addresses.begin (); it != m_addresses.end (); ++it)
203  {
204  if (it->first.GetAddress () == addr)
205  {
206  return false;
207  }
208  }
209 
211  m_addresses.push_back (std::make_pair (iface, solicited));
212 
213  if (!addr.IsAny () || !addr.IsLocalhost ())
214  {
215  /* DAD handling */
216 
217  int32_t interfaceId = m_node->GetObject<Ipv6> ()->GetInterfaceForDevice (m_device);
218  Ptr<Icmpv6L4Protocol> icmpv6 = DynamicCast<Icmpv6L4Protocol> (m_node->GetObject<Ipv6> ()->GetProtocol (Icmpv6L4Protocol::GetStaticProtocolNumber (), interfaceId));
219 
220  if (icmpv6)
221  {
222  if (icmpv6->IsAlwaysDad ())
223  {
224  Simulator::Schedule (Seconds (0.), &Icmpv6L4Protocol::DoDAD, icmpv6, addr, this);
226  }
227  else
228  {
230  }
231  }
232  }
233  return true;
234  }
235 
236  /* bad address */
237  return false;
238 }
239 
241 {
242  /* IPv6 interface has always at least one IPv6 link-local address */
243  NS_LOG_FUNCTION (this);
244 
245  return m_linkLocalAddress;
246 }
247 
249 {
250  /* IPv6 interface has always at least one IPv6 Solicited Multicast address */
251  NS_LOG_FUNCTION (this << address);
252 
253  for (Ipv6InterfaceAddressListCI it = m_addresses.begin (); it != m_addresses.end (); ++it)
254  {
255  if (it->second == address)
256  {
257  return true;
258  }
259  }
260 
261  return false;
262 }
263 
265 {
266  NS_LOG_FUNCTION (this << index);
267  uint32_t i = 0;
268 
269  if (m_addresses.size () > index)
270  {
271  for (Ipv6InterfaceAddressListCI it = m_addresses.begin (); it != m_addresses.end (); ++it)
272  {
273  if (i == index)
274  {
275  return it->first;
276  }
277  i++;
278  }
279  }
280  else
281  {
282  NS_FATAL_ERROR ("index " << index << " out of bounds");
283  }
285  return addr; /* quiet compiler */
286 }
287 
289 {
290  NS_LOG_FUNCTION (this);
291  return m_addresses.size ();
292 }
293 
295 {
296  NS_LOG_FUNCTION (this << index);
297  uint32_t i = 0;
298 
299  if (m_addresses.size () < index)
300  {
301  NS_FATAL_ERROR ("Removing index that does not exist in Ipv6Interface::RemoveAddress");
302  }
303 
304  for (Ipv6InterfaceAddressListI it = m_addresses.begin (); it != m_addresses.end (); ++it)
305  {
306  if (i == index)
307  {
308  Ipv6InterfaceAddress iface = it->first;
309  m_addresses.erase (it);
310  return iface;
311  }
312 
313  i++;
314  }
315  NS_FATAL_ERROR ("Address " << index << " not found");
317  return addr; /* quiet compiler */
318 }
319 
322 {
323  NS_LOG_FUNCTION(this << address);
324 
325  if (address == address.GetLoopback())
326  {
327  NS_LOG_WARN ("Cannot remove loopback address.");
328  return Ipv6InterfaceAddress();
329  }
330 
331  for (Ipv6InterfaceAddressListI it = m_addresses.begin (); it != m_addresses.end (); ++it)
332  {
333  if(it->first.GetAddress () == address)
334  {
335  Ipv6InterfaceAddress iface = it->first;
336  m_addresses.erase(it);
337  return iface;
338  }
339  }
340  return Ipv6InterfaceAddress();
341 }
342 
344 {
345  NS_LOG_FUNCTION (this << dst);
346 
347  for (Ipv6InterfaceAddressList::const_iterator it = m_addresses.begin (); it != m_addresses.end (); ++it)
348  {
349  Ipv6InterfaceAddress ifaddr = it->first;
350 
351  if (ifaddr.GetPrefix ().IsMatch (ifaddr.GetAddress (), dst))
352  {
353  return ifaddr;
354  }
355  }
356 
357  /* NS_ASSERT_MSG (false, "Not matching address."); */
359  return ret; /* quiet compiler */
360 }
361 
363 {
364  NS_LOG_FUNCTION (this << p << dest);
365 
366  if (!IsUp ())
367  {
368  return;
369  }
370 
372 
373  /* check if destination is localhost (::1), if yes we don't pass through
374  * traffic control layer */
375  if (DynamicCast<LoopbackNetDevice> (m_device))
376  {
380  p->AddHeader (hdr);
381  m_device->Send (p, m_device->GetBroadcast (), Ipv6L3Protocol::PROT_NUMBER);
382  return;
383  }
384 
385  NS_ASSERT (m_tc != 0);
386 
387  /* check if destination is for one of our interface */
388  for (Ipv6InterfaceAddressListCI it = m_addresses.begin (); it != m_addresses.end (); ++it)
389  {
390  if (dest == it->first.GetAddress ())
391  {
392  p->AddHeader (hdr);
394  m_device->GetBroadcast (),
395  m_device->GetBroadcast (),
397  return;
398  }
399  }
400 
401  /* other address */
402  if (m_device->NeedsArp ())
403  {
404  NS_LOG_LOGIC ("Needs NDISC " << dest);
405 
406  int32_t interfaceId = m_node->GetObject<Ipv6> ()->GetInterfaceForDevice (m_device);
407  Ptr<Icmpv6L4Protocol> icmpv6 = DynamicCast<Icmpv6L4Protocol> (m_node->GetObject<Ipv6> ()->GetProtocol (Icmpv6L4Protocol::GetStaticProtocolNumber (), interfaceId));
408 
409  Address hardwareDestination;
410  bool found = false;
411 
412  NS_ASSERT (icmpv6);
413 
414  if (dest.IsMulticast ())
415  {
416  NS_LOG_LOGIC ("IsMulticast");
417  NS_ASSERT_MSG (m_device->IsMulticast (), "Ipv6Interface::SendTo (): Sending multicast packet over non-multicast device");
418 
419  hardwareDestination = m_device->GetMulticast (dest);
420  found = true;
421  }
422  else
423  {
424  NS_LOG_LOGIC ("NDISC Lookup");
425  found = icmpv6->Lookup (p, hdr, dest, GetDevice (), m_ndCache, &hardwareDestination);
426  }
427 
428  if (found)
429  {
430  NS_LOG_LOGIC ("Address Resolved. Send.");
431  m_tc->Send (m_device, Create<Ipv6QueueDiscItem> (p, hardwareDestination, Ipv6L3Protocol::PROT_NUMBER, hdr));
432  }
433  }
434  else
435  {
436  NS_LOG_LOGIC ("Doesn't need NDISC");
437  m_tc->Send (m_device, Create<Ipv6QueueDiscItem> (p, m_device->GetBroadcast (), Ipv6L3Protocol::PROT_NUMBER, hdr));
438  }
439 }
440 
441 void Ipv6Interface::SetCurHopLimit (uint8_t curHopLimit)
442 {
443  NS_LOG_FUNCTION (this << curHopLimit);
444  m_curHopLimit = curHopLimit;
445 }
446 
448 {
449  NS_LOG_FUNCTION (this);
450  return m_curHopLimit;
451 }
452 
453 void Ipv6Interface::SetBaseReachableTime (uint16_t baseReachableTime)
454 {
455  NS_LOG_FUNCTION (this << baseReachableTime);
456  m_baseReachableTime = baseReachableTime;
457 }
458 
460 {
461  NS_LOG_FUNCTION (this);
462  return m_baseReachableTime;
463 }
464 
465 void Ipv6Interface::SetReachableTime (uint16_t reachableTime)
466 {
467  NS_LOG_FUNCTION (this << reachableTime);
468  m_reachableTime = reachableTime;
469 }
470 
472 {
473  NS_LOG_FUNCTION (this);
474  return m_reachableTime;
475 }
476 
477 void Ipv6Interface::SetRetransTimer (uint16_t retransTimer)
478 {
479  NS_LOG_FUNCTION (this << retransTimer);
480  m_retransTimer = retransTimer;
481 }
482 
484 {
485  NS_LOG_FUNCTION (this);
486  return m_retransTimer;
487 }
488 
490 {
491  NS_LOG_FUNCTION (this << address << state);
492 
493  for (Ipv6InterfaceAddressListI it = m_addresses.begin (); it != m_addresses.end (); ++it)
494  {
495  if (it->first.GetAddress () == address)
496  {
497  it->first.SetState (state);
498  return;
499  }
500  }
501  /* not found, maybe address has expired */
502 }
503 
505 {
506  NS_LOG_FUNCTION (this << address << uid);
507 
508  for (Ipv6InterfaceAddressListI it = m_addresses.begin (); it != m_addresses.end (); ++it)
509  {
510  if (it->first.GetAddress () == address)
511  {
512  it->first.SetNsDadUid (uid);
513  return;
514  }
515  }
516  /* not found, maybe address has expired */
517 }
518 
520 {
521  NS_LOG_FUNCTION (this);
522  return m_ndCache;
523 }
524 
525 } /* namespace ns3 */
526 
ns3::Ipv6Address::IsLocalhost
bool IsLocalhost() const
If the IPv6 address is localhost (::1).
Definition: ipv6-address.cc:707
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::Ipv6Prefix::IsMatch
bool IsMatch(Ipv6Address a, Ipv6Address b) const
If the Address match the type.
Definition: ipv6-address.cc:1045
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::Ipv6InterfaceAddress::GetPrefix
Ipv6Prefix GetPrefix() const
Get the IPv6 prefix.
Definition: ipv6-interface-address.cc:124
ns3::Ipv6InterfaceAddress
IPv6 address associated with an interface.
Definition: ipv6-interface-address.h:38
loopback-net-device.h
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
ns3::Ipv6Interface::SetNsDadUid
void SetNsDadUid(Ipv6Address address, uint32_t uid)
Update NS DAD packet UID of an interface address.
Definition: ipv6-interface.cc:504
NS_ASSERT
#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
ns3::NdiscCache::Flush
void Flush()
Flush the cache.
Definition: ndisc-cache.cc:153
ns3::Icmpv6L4Protocol::GetStaticProtocolNumber
static uint16_t GetStaticProtocolNumber()
Get ICMPv6 protocol number.
Definition: icmpv6-l4-protocol.cc:173
ipv6-l3-protocol.h
ipv6-queue-disc-item.h
ns3::Ipv6Interface::SetCurHopLimit
void SetCurHopLimit(uint8_t curHopLimit)
Set the current hop limit.
Definition: ipv6-interface.cc:441
ns3::Packet::AddHeader
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
ns3::Ipv6Interface::SetTrafficControl
void SetTrafficControl(Ptr< TrafficControlLayer > tc)
Set the TrafficControlLayer.
Definition: ipv6-interface.cc:126
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Ipv6InterfaceAddress::GetAddress
Ipv6Address GetAddress() const
Get the IPv6 address.
Definition: ipv6-interface-address.cc:89
ns3::Ipv6Interface::GetReachableTime
uint16_t GetReachableTime() const
Get the reachable time.
Definition: ipv6-interface.cc:471
ns3::Ipv6Address::MakeSolicitedAddress
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address.
Definition: ipv6-address.cc:590
ns3::Ipv6Interface::SetNode
void SetNode(Ptr< Node > node)
Set node associated with interface.
Definition: ipv6-interface.cc:113
ns3::Ipv6Interface::m_curHopLimit
uint8_t m_curHopLimit
Current hop limit.
Definition: ipv6-interface.h:367
ns3::Ipv6Interface::m_reachableTime
uint16_t m_reachableTime
Reachable time (in millisecond).
Definition: ipv6-interface.h:378
ns3::Ipv6Interface::Ipv6InterfaceAddressListI
std::list< std::pair< Ipv6InterfaceAddress, Ipv6Address > >::iterator Ipv6InterfaceAddressListI
Container Iterator for the Ipv6InterfaceAddresses.
Definition: ipv6-interface.h:307
ns3::Object::GetObject
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
ns3::Ipv6Interface::GetBaseReachableTime
uint16_t GetBaseReachableTime() const
Get the base reachable time.
Definition: ipv6-interface.cc:459
ns3::Ipv6L3Protocol
IPv6 layer implementation.
Definition: ipv6-l3-protocol.h:63
NS_LOG_WARN
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:265
ns3::Ipv6Address
Describes an IPv6 address.
Definition: ipv6-address.h:50
ns3::NetDevice::PACKET_HOST
@ PACKET_HOST
Packet addressed oo us.
Definition: net-device.h:298
ns3::Ipv6Interface::Ipv6InterfaceAddressListCI
std::list< std::pair< Ipv6InterfaceAddress, Ipv6Address > >::const_iterator Ipv6InterfaceAddressListCI
Const Container Iterator for the Ipv6InterfaceAddresses.
Definition: ipv6-interface.h:312
ndisc-cache.h
ns3::Ipv6Interface::GetAddress
Ipv6InterfaceAddress GetAddress(uint32_t index) const
Get an address from IPv6 interface.
Definition: ipv6-interface.cc:264
ns3::Ipv6InterfaceAddress::State_e
State_e
State of an address associated with an interface.
Definition: ipv6-interface-address.h:45
ns3::Simulator::Schedule
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:557
ns3::Ipv6Interface::DoSetup
void DoSetup()
Initialize interface.
Definition: ipv6-interface.cc:83
ns3::Ipv6Header
Packet header for IPv6.
Definition: ipv6-header.h:36
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::Ipv6Interface::GetAddressMatchingDestination
Ipv6InterfaceAddress GetAddressMatchingDestination(Ipv6Address dst)
Get an address which is in the same network prefix as destination.
Definition: ipv6-interface.cc:343
ns3::Icmpv6L4Protocol::FunctionDadTimeout
void FunctionDadTimeout(Ipv6Interface *interface, Ipv6Address addr)
Function called when DAD timeout.
Definition: icmpv6-l4-protocol.cc:1448
ns3::Ipv6Interface::GetCurHopLimit
uint8_t GetCurHopLimit() const
Get the current hop limit value.
Definition: ipv6-interface.cc:447
ns3::Icmpv6L4Protocol::DoDAD
void DoDAD(Ipv6Address target, Ptr< Ipv6Interface > interface)
Do the Duplication Address Detection (DAD).
Definition: icmpv6-l4-protocol.cc:197
ns3::Ipv6Interface::RemoveAddress
Ipv6InterfaceAddress RemoveAddress(uint32_t index)
Remove an address from interface.
Definition: ipv6-interface.cc:294
ns3::Ipv6Interface::DoDispose
virtual void DoDispose()
Dispose this object.
Definition: ipv6-interface.cc:73
ipv6-header.h
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::Ipv6Interface::GetMetric
uint16_t GetMetric() const
Get the metric.
Definition: ipv6-interface.cc:144
ns3::Ipv6Interface::GetNdiscCache
Ptr< NdiscCache > GetNdiscCache() const
Definition: ipv6-interface.cc:519
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::Ipv6Interface::m_metric
uint16_t m_metric
The metric.
Definition: ipv6-interface.h:342
ns3::Ipv6Interface::SetDown
void SetDown()
Disable this interface.
Definition: ipv6-interface.cc:174
ns3::Ipv6Interface::m_tc
Ptr< TrafficControlLayer > m_tc
TrafficControlLayer associated with this interface.
Definition: ipv6-interface.h:357
ns3::Ipv6Interface::m_ndCache
Ptr< NdiscCache > m_ndCache
Neighbor cache.
Definition: ipv6-interface.h:362
ns3::Ipv6Interface::IsDown
bool IsDown() const
Is the interface DOWN ?
Definition: ipv6-interface.cc:156
ns3::Address
a polymophic address class
Definition: address.h:91
ns3::Ipv6Interface::SetUp
void SetUp()
Enable this interface.
Definition: ipv6-interface.cc:162
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::Ipv6Interface::Ipv6Interface
Ipv6Interface()
Constructs an Ipv6Interface.
Definition: ipv6-interface.cc:53
ns3::Ipv6Interface::GetRetransTimer
uint16_t GetRetransTimer() const
Get the retransmission timer.
Definition: ipv6-interface.cc:483
first.address
address
Definition: first.py:44
ns3::Ipv6Interface::AddAddress
bool AddAddress(Ipv6InterfaceAddress iface)
Add an IPv6 address.
Definition: ipv6-interface.cc:194
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:88
ns3::Ipv6L3Protocol::PROT_NUMBER
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
Definition: ipv6-l3-protocol.h:74
ns3::Ipv6Interface::IsForwarding
bool IsForwarding() const
If the interface allows forwarding packets.
Definition: ipv6-interface.cc:182
ns3::Ipv6Interface::GetLinkLocalAddress
Ipv6InterfaceAddress GetLinkLocalAddress() const
Get link-local address from IPv6 interface.
Definition: ipv6-interface.cc:240
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
ns3::Ipv6Interface::m_addresses
Ipv6InterfaceAddressList m_addresses
The addresses assigned to this interface.
Definition: ipv6-interface.h:322
ns3::Ipv6Interface::m_ifup
bool m_ifup
The state of this interface.
Definition: ipv6-interface.h:332
ns3::Ipv6Interface::SetState
void SetState(Ipv6Address address, Ipv6InterfaceAddress::State_e state)
Update state of an interface address.
Definition: ipv6-interface.cc:489
ns3::Ipv6Interface::SetBaseReachableTime
void SetBaseReachableTime(uint16_t baseReachableTime)
Set the base reachable time.
Definition: ipv6-interface.cc:453
ns3::Ipv6Address::IsMulticast
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
Definition: ipv6-address.cc:714
ns3::Ipv6Interface::GetDevice
virtual Ptr< NetDevice > GetDevice() const
Get the NetDevice.
Definition: ipv6-interface.cc:132
ns3::Ipv6Interface::m_device
Ptr< NetDevice > m_device
NetDevice associated with this interface.
Definition: ipv6-interface.h:352
ns3::Ipv6Interface::SetDevice
void SetDevice(Ptr< NetDevice > device)
Set the NetDevice.
Definition: ipv6-interface.cc:119
ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress
static Ipv6Address MakeAutoconfiguredLinkLocalAddress(Address mac)
Make the autoconfigured link-local IPv6 address from a Mac address.
Definition: ipv6-address.cc:481
ns3::Ipv6Interface::m_forwarding
bool m_forwarding
Forwarding state.
Definition: ipv6-interface.h:337
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
icmpv6-l4-protocol.h
ns3::Ipv6Interface::SetMetric
void SetMetric(uint16_t metric)
Set the metric.
Definition: ipv6-interface.cc:138
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::Ipv6Interface::SetReachableTime
void SetReachableTime(uint16_t reachableTime)
Set the reachable time.
Definition: ipv6-interface.cc:465
ns3::Ipv6Interface::SetRetransTimer
void SetRetransTimer(uint16_t retransTimer)
Set the retransmission timer.
Definition: ipv6-interface.cc:477
ns3::Ipv6
Access to the IPv6 forwarding table, interfaces, and configuration.
Definition: ipv6.h:82
ns3::Ipv6Interface::m_retransTimer
uint16_t m_retransTimer
Retransmission timer (in millisecond).
Definition: ipv6-interface.h:384
ns3::Ipv6Interface::Send
void Send(Ptr< Packet > p, const Ipv6Header &hdr, Ipv6Address dest)
Send a packet through this interface.
Definition: ipv6-interface.cc:362
ns3::Ipv6Interface::m_baseReachableTime
uint16_t m_baseReachableTime
Base value used for computing the random reachable time value (in millisecond).
Definition: ipv6-interface.h:372
ns3::Ipv6Interface::IsUp
bool IsUp() const
Is the interface UP ?
Definition: ipv6-interface.cc:150
ns3::Ipv6Address::IsAny
bool IsAny() const
If the IPv6 address is the "Any" address.
Definition: ipv6-address.cc:797
ns3::Ipv6Interface::IsSolicitedMulticastAddress
bool IsSolicitedMulticastAddress(Ipv6Address address) const
Checks if the address is a Solicited Multicast address for this interface.
Definition: ipv6-interface.cc:248
ns3::Ipv6::GetProtocol
virtual Ptr< IpL4Protocol > GetProtocol(int protocolNumber) const =0
Get L4 protocol by protocol number.
ns3::Ipv6Interface::~Ipv6Interface
virtual ~Ipv6Interface()
Destructor.
Definition: ipv6-interface.cc:69
ns3::Ipv6Prefix
Describes an IPv6 prefix.
Definition: ipv6-address.h:456
ns3::Ipv6Interface::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition: ipv6-interface.cc:44
ns3::Ipv6Interface::SetForwarding
void SetForwarding(bool forward)
Set forwarding enabled or not.
Definition: ipv6-interface.cc:188
ns3::Ipv6Interface::m_node
Ptr< Node > m_node
Node associated with this interface.
Definition: ipv6-interface.h:347
ns3::Object::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:346
ipv6-interface.h
ns3::Ipv6Interface::m_linkLocalAddress
Ipv6InterfaceAddress m_linkLocalAddress
The link-local addresses assigned to this interface.
Definition: ipv6-interface.h:327
ns3::Ipv6Interface::GetNAddresses
uint32_t GetNAddresses(void) const
Get number of addresses on this IPv6 interface.
Definition: ipv6-interface.cc:288