A Discrete-Event Network Simulator
API
ipv6-l3-protocol.h
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 #ifndef IPV6_L3_PROTOCOL_H
22 #define IPV6_L3_PROTOCOL_H
23 
24 #include <list>
25 
26 #include "ns3/traced-callback.h"
27 #include "ns3/net-device.h"
28 #include "ns3/ipv6.h"
29 #include "ns3/ipv6-address.h"
30 #include "ns3/ipv6-header.h"
31 #include "ns3/ipv6-pmtu-cache.h"
32 
34 
35 namespace ns3
36 {
37 
38 class Node;
39 class Ipv6Interface;
40 class IpL4Protocol;
41 class Ipv6Route;
42 class Ipv6MulticastRoute;
43 class Ipv6RawSocketImpl;
44 class Icmpv6L4Protocol;
45 class Ipv6AutoconfiguredPrefix;
46 
62 class Ipv6L3Protocol : public Ipv6
63 {
64 public:
69  static TypeId GetTypeId ();
70 
74  static const uint16_t PROT_NUMBER;
75 
80  enum DropReason
81  {
90  };
91 
95  Ipv6L3Protocol ();
96 
100  virtual ~Ipv6L3Protocol ();
101 
106  void SetNode (Ptr<Node> node);
107 
108  virtual void Insert (Ptr<IpL4Protocol> protocol);
109  virtual void Insert (Ptr<IpL4Protocol> protocol, uint32_t interfaceIndex);
110 
111  virtual void Remove (Ptr<IpL4Protocol> protocol);
112  virtual void Remove (Ptr<IpL4Protocol> protocol, uint32_t interfaceIndex);
113 
114  virtual Ptr<IpL4Protocol> GetProtocol (int protocolNumber) const;
115  virtual Ptr<IpL4Protocol> GetProtocol (int protocolNumber, int32_t interfaceIndex) const;
116 
122 
127  void DeleteRawSocket (Ptr<Socket> socket);
128 
133  void SetDefaultTtl (uint8_t ttl);
134 
139  void SetDefaultTclass (uint8_t tclass);
140 
152  void Receive (Ptr<NetDevice> device, Ptr<const Packet> p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType);
153 
154  virtual void Send (Ptr<Packet> packet, Ipv6Address source, Ipv6Address destination, uint8_t protocol, Ptr<Ipv6Route> route);
155 
160  void SetRoutingProtocol (Ptr<Ipv6RoutingProtocol> routingProtocol);
161 
167 
173  uint32_t AddInterface (Ptr<NetDevice> device);
174 
180  Ptr<Ipv6Interface> GetInterface (uint32_t i) const;
181 
186  uint32_t GetNInterfaces () const;
187 
193  int32_t GetInterfaceForAddress (Ipv6Address addr) const;
194 
201  int32_t GetInterfaceForPrefix (Ipv6Address addr, Ipv6Prefix mask) const;
202 
208  int32_t GetInterfaceForDevice (Ptr<const NetDevice> device) const;
209 
217  bool AddAddress (uint32_t i, Ipv6InterfaceAddress address, bool addOnLinkRoute = true);
218 
225  Ipv6InterfaceAddress GetAddress (uint32_t interfaceIndex, uint32_t addressIndex) const;
226 
232  uint32_t GetNAddresses (uint32_t interface) const;
233 
240  bool RemoveAddress (uint32_t interfaceIndex, uint32_t addressIndex);
241 
248  bool RemoveAddress (uint32_t interfaceIndex, Ipv6Address address);
249 
255  void SetMetric (uint32_t i, uint16_t metric);
256 
262  uint16_t GetMetric (uint32_t i) const;
263 
269  uint16_t GetMtu (uint32_t i) const;
270 
276  virtual void SetPmtu (Ipv6Address dst, uint32_t pmtu);
277 
283  bool IsUp (uint32_t i) const;
284 
289  void SetUp (uint32_t i);
290 
295  void SetDown (uint32_t i);
296 
302  bool IsForwarding (uint32_t i) const;
303 
309  void SetForwarding (uint32_t i, bool val);
310 
311  Ipv6Address SourceAddressSelection (uint32_t interface, Ipv6Address dest);
312 
318  Ptr<NetDevice> GetNetDevice (uint32_t i);
319 
325 
336  void AddAutoconfiguredAddress (uint32_t interface, Ipv6Address network, Ipv6Prefix mask, uint8_t flags, uint32_t validTime, uint32_t preferredTime, Ipv6Address defaultRouter = Ipv6Address::GetZero ());
337 
347  void RemoveAutoconfiguredAddress (uint32_t interface, Ipv6Address network, Ipv6Prefix mask, Ipv6Address defaultRouter);
348 
352  virtual void RegisterExtensions ();
353 
357  virtual void RegisterOptions ();
358 
369  virtual void ReportDrop (Ipv6Header ipHeader, Ptr<Packet> p, DropReason dropReason);
370 
379  typedef void (* SentTracedCallback)
380  (const Ipv6Header & header, Ptr<const Packet> packet, uint32_t interface);
381 
391  typedef void (* TxRxTracedCallback)
392  (Ptr<const Packet> packet, Ptr<Ipv6> ipv6, uint32_t interface);
393 
405  typedef void (* DropTracedCallback)
406  (const Ipv6Header & header, Ptr<const Packet> packet,
407  DropReason reason, Ptr<Ipv6> ipv6,
408  uint32_t interface);
409 
415 
421  void AddMulticastAddress (Ipv6Address address, uint32_t interface);
422 
428 
434  void RemoveMulticastAddress (Ipv6Address address, uint32_t interface);
435 
442 
449  bool IsRegisteredMulticastAddress (Ipv6Address address, uint32_t interface) const;
450 
468  bool ReachabilityHint (uint32_t ipInterfaceIndex, Ipv6Address address);
469 
470 protected:
474  virtual void DoDispose ();
475 
481  virtual void NotifyNewAggregate ();
482 
483 private:
488  friend class ::Ipv6L3ProtocolTestCase;
494 
498  typedef std::vector<Ptr<Ipv6Interface> > Ipv6InterfaceList;
499 
503  typedef std::map<Ptr<const NetDevice>, uint32_t > Ipv6InterfaceReverseContainer;
504 
508  typedef std::list<Ptr<Ipv6RawSocketImpl> > SocketList;
509 
513  typedef std::pair<int, int32_t> L4ListKey_t;
514 
518  typedef std::map<L4ListKey_t, Ptr<IpL4Protocol> > L4List_t;
519 
523  typedef std::list< Ptr<Ipv6AutoconfiguredPrefix> > Ipv6AutoconfiguredPrefixList;
524 
528  typedef std::list< Ptr<Ipv6AutoconfiguredPrefix> >::iterator Ipv6AutoconfiguredPrefixListI;
529 
540  void CallTxTrace (const Ipv6Header & ipHeader, Ptr<Packet> packet, Ptr<Ipv6> ipv6, uint32_t interface);
541 
548 
555 
562 
569 
576 
584 
595  Ipv6Header BuildHeader (Ipv6Address src, Ipv6Address dst, uint8_t protocol,
596  uint16_t payloadSize, uint8_t hopLimit, uint8_t tclass);
597 
604  void SendRealOut (Ptr<Ipv6Route> route, Ptr<Packet> packet, Ipv6Header const& ipHeader);
605 
613  void IpForward (Ptr<const NetDevice> idev, Ptr<Ipv6Route> rtentry, Ptr<const Packet> p, const Ipv6Header& header);
614 
623 
630  void LocalDeliver (Ptr<const Packet> p, Ipv6Header const& ip, uint32_t iif);
631 
638  void RouteInputError (Ptr<const Packet> p, const Ipv6Header& ipHeader, Socket::SocketErrno sockErrno);
639 
645  uint32_t AddIpv6Interface (Ptr<Ipv6Interface> interface);
646 
650  void SetupLoopback ();
651 
656  virtual void SetIpForward (bool forward);
657 
662  virtual bool GetIpForward () const;
663 
668  virtual void SetMtuDiscover (bool mtuDiscover);
669 
674  virtual bool GetMtuDiscover (void) const;
675 
680  virtual void SetSendIcmpv6Redirect (bool sendIcmpv6Redirect);
681 
686  virtual bool GetSendIcmpv6Redirect () const;
687 
692 
697 
702 
707 
712 
717 
722 
726  uint32_t m_nInterfaces;
727 
731  uint8_t m_defaultTtl;
732 
737 
742 
747 
752 
757 
762 
766  typedef std::pair<Ipv6Address, uint64_t> Ipv6RegisteredMulticastAddressKey_t;
767 
771  typedef std::map<Ipv6RegisteredMulticastAddressKey_t, uint32_t> Ipv6RegisteredMulticastAddress_t;
772 
776  typedef std::map<Ipv6RegisteredMulticastAddressKey_t, uint32_t>::iterator Ipv6RegisteredMulticastAddressIter_t;
777 
781  typedef std::map<Ipv6RegisteredMulticastAddressKey_t, uint32_t>::const_iterator Ipv6RegisteredMulticastAddressCIter_t;
782 
786  typedef std::map<Ipv6Address, uint32_t> Ipv6RegisteredMulticastAddressNoInterface_t;
787 
791  typedef std::map<Ipv6Address, uint32_t>::iterator Ipv6RegisteredMulticastAddressNoInterfaceIter_t;
792 
796  typedef std::map<Ipv6Address, uint32_t>::const_iterator Ipv6RegisteredMulticastAddressNoInterfaceCIter_t;
797 
802 
807 };
808 
809 } /* namespace ns3 */
810 
811 #endif /* IPV6_L3_PROTOCOL_H */
812 
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::Ipv6InterfaceAddress
IPv6 address associated with an interface.
Definition: ipv6-interface-address.h:38
ns3::Ipv6L3Protocol::m_txTrace
TracedCallback< Ptr< const Packet >, Ptr< Ipv6 >, uint32_t > m_txTrace
Callback to trace TX (transmission) packets.
Definition: ipv6-l3-protocol.h:547
ns3::Ipv6L3Protocol::LocalDeliver
void LocalDeliver(Ptr< const Packet > p, Ipv6Header const &ip, uint32_t iif)
Deliver a packet.
Definition: ipv6-l3-protocol.cc:1332
ns3::Ipv6L3Protocol::GetMtuDiscover
virtual bool GetMtuDiscover(void) const
Get IPv6 MTU discover state.
Definition: ipv6-l3-protocol.cc:668
ns3::Ipv6L3Protocol::L4ListKey_t
std::pair< int, int32_t > L4ListKey_t
Container of the IPv6 L4 keys: protocol number, interface index.
Definition: ipv6-l3-protocol.h:513
ns3::Ipv6L3Protocol::AddAutoconfiguredAddress
void AddAutoconfiguredAddress(uint32_t interface, Ipv6Address network, Ipv6Prefix mask, uint8_t flags, uint32_t validTime, uint32_t preferredTime, Ipv6Address defaultRouter=Ipv6Address::GetZero())
Add an autoconfigured address with RA information.
Definition: ipv6-l3-protocol.cc:306
ns3::Ipv6L3Protocol::DROP_INTERFACE_DOWN
@ DROP_INTERFACE_DOWN
Interface is down so can not send packet.
Definition: ipv6-l3-protocol.h:84
ns3::Ipv6L3Protocol::IsForwarding
bool IsForwarding(uint32_t i) const
Is interface allows forwarding ?
Definition: ipv6-l3-protocol.cc:583
ns3::Ipv6L3Protocol::SetPmtu
virtual void SetPmtu(Ipv6Address dst, uint32_t pmtu)
Set the Path MTU for the specified IPv6 destination address.
Definition: ipv6-l3-protocol.cc:494
ns3::Ipv6L3Protocol::DROP_FRAGMENT_TIMEOUT
@ DROP_FRAGMENT_TIMEOUT
Fragment timeout.
Definition: ipv6-l3-protocol.h:89
ns3::Socket::SocketErrno
SocketErrno
Enumeration of the possible errors returned by a socket.
Definition: socket.h:82
ns3::Ipv6L3Protocol::Ipv6RegisteredMulticastAddressNoInterfaceIter_t
std::map< Ipv6Address, uint32_t >::iterator Ipv6RegisteredMulticastAddressNoInterfaceIter_t
Container Iterator of the IPv6 multicast addresses.
Definition: ipv6-l3-protocol.h:791
ns3::Ipv6L3Protocol::SetForwarding
void SetForwarding(uint32_t i, bool val)
Enable or disable forwarding on interface.
Definition: ipv6-l3-protocol.cc:592
ns3::Ipv6L3Protocol::GetRoutingProtocol
Ptr< Ipv6RoutingProtocol > GetRoutingProtocol() const
Get current routing protocol used.
Definition: ipv6-l3-protocol.cc:189
ns3::Ipv6L3Protocol::GetProtocol
virtual Ptr< IpL4Protocol > GetProtocol(int protocolNumber) const
Get L4 protocol by protocol number.
Definition: ipv6-l3-protocol.cc:767
ns3::Ipv6L3Protocol::RegisterOptions
virtual void RegisterOptions()
Register the IPv6 Options.
Definition: ipv6-l3-protocol.cc:1506
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Ipv6L3Protocol::m_sendOutgoingTrace
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > m_sendOutgoingTrace
Trace of sent packets.
Definition: ipv6-l3-protocol.h:564
ns3::Ipv6L3Protocol::TxRxTracedCallback
void(* TxRxTracedCallback)(Ptr< const Packet > packet, Ptr< Ipv6 > ipv6, uint32_t interface)
TracedCallback signature for packet transmission or reception events.
Definition: ipv6-l3-protocol.h:392
ns3::Ipv6L3Protocol::SetupLoopback
void SetupLoopback()
Setup loopback interface.
Definition: ipv6-l3-protocol.cc:546
ns3::Ipv6L3Protocol::SetDefaultTclass
void SetDefaultTclass(uint8_t tclass)
Set the default TCLASS.
Definition: ipv6-l3-protocol.cc:845
ns3::Ipv6L3Protocol::GetInterface
Ptr< Ipv6Interface > GetInterface(uint32_t i) const
Get an interface.
Definition: ipv6-l3-protocol.cc:228
ns3::Ipv6L3Protocol::GetNInterfaces
uint32_t GetNInterfaces() const
Get current number of interface on this stack.
Definition: ipv6-l3-protocol.cc:239
ns3::Ipv6L3Protocol
IPv6 layer implementation.
Definition: ipv6-l3-protocol.h:63
ns3::Ipv6L3Protocol::DROP_UNKNOWN_OPTION
@ DROP_UNKNOWN_OPTION
Unknown option.
Definition: ipv6-l3-protocol.h:87
ns3::Ipv6L3Protocol::m_defaultTtl
uint8_t m_defaultTtl
Default TTL for outgoing packets.
Definition: ipv6-l3-protocol.h:731
ns3::Ipv6L3Protocol::Ipv6InterfaceReverseContainer
std::map< Ptr< const NetDevice >, uint32_t > Ipv6InterfaceReverseContainer
Container of NetDevices registered to IPv6 and their interface indexes.
Definition: ipv6-l3-protocol.h:503
ns3::Ipv6L3Protocol::SetDown
void SetDown(uint32_t i)
set an interface down.
Definition: ipv6-l3-protocol.cc:533
ns3::Ipv6L3Protocol::SetIpForward
virtual void SetIpForward(bool forward)
Set IPv6 forwarding state.
Definition: ipv6-l3-protocol.cc:645
ns3::Ipv6L3Protocol::Remove
virtual void Remove(Ptr< IpL4Protocol > protocol)
Remove a L4 protocol.
Definition: ipv6-l3-protocol.cc:735
ns3::Ipv6Address
Describes an IPv6 address.
Definition: ipv6-address.h:50
ns3::Ipv6L3Protocol::GetInterfaceForAddress
int32_t GetInterfaceForAddress(Ipv6Address addr) const
Get interface index which has specified IPv6 address.
Definition: ipv6-l3-protocol.cc:245
ns3::Ipv6L3Protocol::IsUp
bool IsUp(uint32_t i) const
Is specified interface up ?
Definition: ipv6-l3-protocol.cc:501
ns3::Ipv6L3Protocol::DeleteRawSocket
void DeleteRawSocket(Ptr< Socket > socket)
Remove raw IPv6 socket.
Definition: ipv6-l3-protocol.cc:810
ns3::Ipv6L3Protocol::SentTracedCallback
void(* SentTracedCallback)(const Ipv6Header &header, Ptr< const Packet > packet, uint32_t interface)
TracedCallback signature for packet sent, forwarded or local-delivered events.
Definition: ipv6-l3-protocol.h:380
ns3::Ipv6L3Protocol::IpMulticastForward
void IpMulticastForward(Ptr< const NetDevice > idev, Ptr< Ipv6MulticastRoute > mrtentry, Ptr< const Packet > p, const Ipv6Header &header)
Forward a multicast packet.
Definition: ipv6-l3-protocol.cc:1300
ns3::Ipv6L3Protocol::Ipv6RegisteredMulticastAddressIter_t
std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t >::iterator Ipv6RegisteredMulticastAddressIter_t
Container Iterator of the IPv6 multicast addresses.
Definition: ipv6-l3-protocol.h:776
ns3::Ipv6L3Protocol::SourceAddressSelection
Ipv6Address SourceAddressSelection(uint32_t interface, Ipv6Address dest)
Choose the source address to use with destination address.
Definition: ipv6-l3-protocol.cc:599
ns3::Ipv6L3Protocol::AddIpv6Interface
uint32_t AddIpv6Interface(Ptr< Ipv6Interface > interface)
Add an IPv6 interface to the stack.
Definition: ipv6-l3-protocol.cc:217
ns3::Ipv6L3Protocol::DROP_MALFORMED_HEADER
@ DROP_MALFORMED_HEADER
Malformed header.
Definition: ipv6-l3-protocol.h:88
ns3::Ipv6L3Protocol::SetNode
void SetNode(Ptr< Node > node)
Set node associated with this stack.
Definition: ipv6-l3-protocol.cc:704
ns3::Ipv6Header
Packet header for IPv6.
Definition: ipv6-header.h:36
ns3::Ipv6L3Protocol::m_routingProtocol
Ptr< Ipv6RoutingProtocol > m_routingProtocol
Routing protocol.
Definition: ipv6-l3-protocol.h:746
ns3::Ipv6L3Protocol::m_rxTrace
TracedCallback< Ptr< const Packet >, Ptr< Ipv6 >, uint32_t > m_rxTrace
Callback to trace RX (reception) packets.
Definition: ipv6-l3-protocol.h:554
ns3::Ipv6L3Protocol::ReportDrop
virtual void ReportDrop(Ipv6Header ipHeader, Ptr< Packet > p, DropReason dropReason)
Report a packet drop.
Definition: ipv6-l3-protocol.cc:1528
ns3::Ipv6L3Protocol::RegisterExtensions
virtual void RegisterExtensions()
Register the IPv6 Extensions.
Definition: ipv6-l3-protocol.cc:1473
ns3::Ipv6L3Protocol::GetAddress
Ipv6InterfaceAddress GetAddress(uint32_t interfaceIndex, uint32_t addressIndex) const
Get an address.
Definition: ipv6-l3-protocol.cc:419
ns3::Ipv6L3Protocol::GetNAddresses
uint32_t GetNAddresses(uint32_t interface) const
Get number of address for an interface.
Definition: ipv6-l3-protocol.cc:412
ns3::Ipv6L3Protocol::DoDispose
virtual void DoDispose()
Dispose object.
Definition: ipv6-l3-protocol.cc:141
ns3::Ipv6L3Protocol::SetSendIcmpv6Redirect
virtual void SetSendIcmpv6Redirect(bool sendIcmpv6Redirect)
Set the ICMPv6 Redirect sending state.
Definition: ipv6-l3-protocol.cc:674
ns3::Ipv6L3Protocol::SendRealOut
void SendRealOut(Ptr< Ipv6Route > route, Ptr< Packet > packet, Ipv6Header const &ipHeader)
Send packet with route.
Definition: ipv6-l3-protocol.cc:1096
ns3::Ipv6L3Protocol::GetSendIcmpv6Redirect
virtual bool GetSendIcmpv6Redirect() const
Get the ICMPv6 Redirect sending state.
Definition: ipv6-l3-protocol.cc:680
ns3::Ipv6L3Protocol::DropReason
DropReason
Reason why a packet has been dropped.
Definition: ipv6-l3-protocol.h:81
ns3::Ipv6L3Protocol::SetRoutingProtocol
void SetRoutingProtocol(Ptr< Ipv6RoutingProtocol > routingProtocol)
Set routing protocol for this stack.
Definition: ipv6-l3-protocol.cc:182
ns3::Ipv6L3Protocol::DropTracedCallback
void(* DropTracedCallback)(const Ipv6Header &header, Ptr< const Packet > packet, DropReason reason, Ptr< Ipv6 > ipv6, uint32_t interface)
TracedCallback signature for packet drop events.
Definition: ipv6-l3-protocol.h:406
ns3::Ipv6L3Protocol::m_dropTrace
TracedCallback< const Ipv6Header &, Ptr< const Packet >, DropReason, Ptr< Ipv6 >, uint32_t > m_dropTrace
Callback to trace drop packets.
Definition: ipv6-l3-protocol.h:561
ns3::Ipv6L3Protocol::m_strongEndSystemModel
bool m_strongEndSystemModel
Rejects packets directed to an interface with wrong address (RFC 1222).
Definition: ipv6-l3-protocol.h:741
ns3::Ipv6L3Protocol::RemoveAddress
bool RemoveAddress(uint32_t interfaceIndex, uint32_t addressIndex)
Remove an address from an interface.
Definition: ipv6-l3-protocol.cc:426
ns3::Ipv6L3Protocol::m_localDeliverTrace
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > m_localDeliverTrace
Trace of locally delivered packets.
Definition: ipv6-l3-protocol.h:568
ns3::Ptr< Node >
ns3::Ipv6L3Protocol::SetUp
void SetUp(uint32_t i)
Set an interface up.
Definition: ipv6-l3-protocol.cc:508
ns3::Ipv6L3Protocol::Ipv6RegisteredMulticastAddressCIter_t
std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t >::const_iterator Ipv6RegisteredMulticastAddressCIter_t
Container Const Iterator of the IPv6 multicast addresses.
Definition: ipv6-l3-protocol.h:781
ns3::Ipv6L3Protocol::m_sockets
SocketList m_sockets
List of IPv6 raw sockets.
Definition: ipv6-l3-protocol.h:751
ns3::Ipv6L3Protocol::m_defaultTclass
uint8_t m_defaultTclass
Default TCLASS for outgoing packets.
Definition: ipv6-l3-protocol.h:736
ns3::Ipv6L3Protocol::Ipv6RegisteredMulticastAddressNoInterface_t
std::map< Ipv6Address, uint32_t > Ipv6RegisteredMulticastAddressNoInterface_t
Container of the IPv6 multicast addresses.
Definition: ipv6-l3-protocol.h:786
ns3::Ipv6L3Protocol::Ipv6AutoconfiguredPrefixList
std::list< Ptr< Ipv6AutoconfiguredPrefix > > Ipv6AutoconfiguredPrefixList
Container of the IPv6 Autoconfigured addresses.
Definition: ipv6-l3-protocol.h:523
ns3::Ipv6L3Protocol::GetMetric
uint16_t GetMetric(uint32_t i) const
Get metric for an interface.
Definition: ipv6-l3-protocol.cc:473
ns3::Ipv6L3Protocol::m_node
Ptr< Node > m_node
Node attached to stack.
Definition: ipv6-l3-protocol.h:691
ns3::Ipv6L3Protocol::GetNetDevice
Ptr< NetDevice > GetNetDevice(uint32_t i)
Get device by index.
Definition: ipv6-l3-protocol.cc:287
ns3::Ipv6L3Protocol::GetIcmpv6
Ptr< Icmpv6L4Protocol > GetIcmpv6() const
Get ICMPv6 protocol.
Definition: ipv6-l3-protocol.cc:824
ns3::Address
a polymophic address class
Definition: address.h:91
ns3::Ipv6L3Protocol::DROP_TTL_EXPIRED
@ DROP_TTL_EXPIRED
Packet TTL has expired.
Definition: ipv6-l3-protocol.h:82
ns3::Ipv6L3Protocol::GetInterfaceForPrefix
int32_t GetInterfaceForPrefix(Ipv6Address addr, Ipv6Prefix mask) const
Get interface index which match specified address/prefix.
Definition: ipv6-l3-protocol.cc:267
ns3::Ipv6L3Protocol::DROP_ROUTE_ERROR
@ DROP_ROUTE_ERROR
Route error.
Definition: ipv6-l3-protocol.h:85
ns3::Ipv6L3Protocol::~Ipv6L3Protocol
virtual ~Ipv6L3Protocol()
Destructor.
Definition: ipv6-l3-protocol.cc:136
first.address
address
Definition: first.py:44
ns3::Ipv6L3Protocol::Ipv6RegisteredMulticastAddressNoInterfaceCIter_t
std::map< Ipv6Address, uint32_t >::const_iterator Ipv6RegisteredMulticastAddressNoInterfaceCIter_t
Container Const Iterator of the IPv6 multicast addresses.
Definition: ipv6-l3-protocol.h:796
ns3::Ipv6L3Protocol::Insert
virtual void Insert(Ptr< IpL4Protocol > protocol)
Add a L4 protocol.
Definition: ipv6-l3-protocol.cc:712
ns3::Ipv6L3Protocol::GetTypeId
static TypeId GetTypeId()
Get the type ID of this class.
Definition: ipv6-l3-protocol.cc:60
ns3::Ipv6L3Protocol::PROT_NUMBER
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
Definition: ipv6-l3-protocol.h:74
ns3::Ipv6L3Protocol::RouteInputError
void RouteInputError(Ptr< const Packet > p, const Ipv6Header &ipHeader, Socket::SocketErrno sockErrno)
Fallback when no route is found.
Definition: ipv6-l3-protocol.cc:1444
ns3::Ipv6L3Protocol::m_protocols
L4List_t m_protocols
List of transport protocol.
Definition: ipv6-l3-protocol.h:711
ns3::Ipv6Address::GetZero
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
Definition: ipv6-address.cc:890
ns3::Ipv6L3Protocol::L4List_t
std::map< L4ListKey_t, Ptr< IpL4Protocol > > L4List_t
Container of the IPv6 L4 instances.
Definition: ipv6-l3-protocol.h:518
ns3::Ipv6L3Protocol::SocketList
std::list< Ptr< Ipv6RawSocketImpl > > SocketList
Container of the IPv6 Raw Sockets.
Definition: ipv6-l3-protocol.h:508
ns3::Ipv6L3Protocol::m_prefixes
Ipv6AutoconfiguredPrefixList m_prefixes
List of IPv6 prefix received from RA.
Definition: ipv6-l3-protocol.h:756
ns3::Ipv6ExtensionLooseRouting
IPv6 Extension Loose Routing.
Definition: ipv6-extension.h:603
ns3::Ipv6L3Protocol::m_pmtuCache
Ptr< Ipv6PmtuCache > m_pmtuCache
Path MTU Cache.
Definition: ipv6-l3-protocol.h:706
ns3::Ipv6L3Protocol::Ipv6RegisteredMulticastAddressKey_t
std::pair< Ipv6Address, uint64_t > Ipv6RegisteredMulticastAddressKey_t
IPv6 multicast addresses / interface key.
Definition: ipv6-l3-protocol.h:766
ns3::Ipv6L3Protocol::CreateRawSocket
Ptr< Socket > CreateRawSocket()
Create raw IPv6 socket.
Definition: ipv6-l3-protocol.cc:801
ns3::Ipv6L3Protocol::m_multicastAddresses
Ipv6RegisteredMulticastAddress_t m_multicastAddresses
List of multicast IP addresses of interest, divided per interface.
Definition: ipv6-l3-protocol.h:801
ns3::Ipv6L3Protocol::IpForward
void IpForward(Ptr< const NetDevice > idev, Ptr< Ipv6Route > rtentry, Ptr< const Packet > p, const Ipv6Header &header)
Forward a packet.
Definition: ipv6-l3-protocol.cc:1216
ns3::Ipv6L3Protocol::m_interfaces
Ipv6InterfaceList m_interfaces
List of IPv6 interfaces.
Definition: ipv6-l3-protocol.h:716
ns3::Ipv6L3Protocol::m_ipForward
bool m_ipForward
Forwarding packets (i.e.
Definition: ipv6-l3-protocol.h:696
ns3::Ipv6L3Protocol::SetMtuDiscover
virtual void SetMtuDiscover(bool mtuDiscover)
Set IPv6 MTU discover state.
Definition: ipv6-l3-protocol.cc:662
ns3::Ipv6L3Protocol::Send
virtual void Send(Ptr< Packet > packet, Ipv6Address source, Ipv6Address destination, uint8_t protocol, Ptr< Ipv6Route > route)
Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers.
Definition: ipv6-l3-protocol.cc:851
ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress
void RemoveAutoconfiguredAddress(uint32_t interface, Ipv6Address network, Ipv6Prefix mask, Ipv6Address defaultRouter)
Remove an autoconfigured address.
Definition: ipv6-l3-protocol.cc:360
ns3::Ipv6L3Protocol::Ipv6AutoconfiguredPrefixListI
std::list< Ptr< Ipv6AutoconfiguredPrefix > >::iterator Ipv6AutoconfiguredPrefixListI
Iterator of the container of the IPv6 Autoconfigured addresses.
Definition: ipv6-l3-protocol.h:528
ns3::Ipv6L3Protocol::CallTxTrace
void CallTxTrace(const Ipv6Header &ipHeader, Ptr< Packet > packet, Ptr< Ipv6 > ipv6, uint32_t interface)
Make a copy of the packet, add the header and invoke the TX trace callback.
Definition: ipv6-l3-protocol.cc:1088
ns3::Ipv6L3Protocol::RemoveMulticastAddress
void RemoveMulticastAddress(Ipv6Address address)
Removes a multicast address from the list of addresses to pass to local deliver.
Definition: ipv6-l3-protocol.cc:1573
ns3::Ipv6L3Protocol::DROP_UNKNOWN_PROTOCOL
@ DROP_UNKNOWN_PROTOCOL
Unknown L4 protocol.
Definition: ipv6-l3-protocol.h:86
Ipv6L3ProtocolTestCase
IPv6 Test.
Definition: ipv6-test.cc:42
ns3::Ipv6L3Protocol::BuildHeader
Ipv6Header BuildHeader(Ipv6Address src, Ipv6Address dst, uint8_t protocol, uint16_t payloadSize, uint8_t hopLimit, uint8_t tclass)
Construct an IPv6 header.
Definition: ipv6-l3-protocol.cc:1459
ns3::Ipv6L3Protocol::m_mtuDiscover
bool m_mtuDiscover
MTU Discover (i.e.
Definition: ipv6-l3-protocol.h:701
ns3::Ipv6L3Protocol::operator=
Ipv6L3Protocol & operator=(const Ipv6L3Protocol &)
Copy constructor.
ns3::Ipv6L3Protocol::Receive
void Receive(Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
Receive method when a packet arrive in the stack.
Definition: ipv6-l3-protocol.cc:934
ns3::Ipv6L3Protocol::NotifyNewAggregate
virtual void NotifyNewAggregate()
Notify other components connected to the node that a new stack member is now connected.
Definition: ipv6-l3-protocol.cc:686
ns3::Ipv6L3Protocol::IsRegisteredMulticastAddress
bool IsRegisteredMulticastAddress(Ipv6Address address) const
Checks if the address has been registered.
Definition: ipv6-l3-protocol.cc:1598
ns3::Ipv6L3Protocol::m_nInterfaces
uint32_t m_nInterfaces
Number of IPv6 interfaces managed by the stack.
Definition: ipv6-l3-protocol.h:726
ns3::Ipv6
Access to the IPv6 forwarding table, interfaces, and configuration.
Definition: ipv6.h:82
ns3::Ipv6L3Protocol::GetInterfaceForDevice
int32_t GetInterfaceForDevice(Ptr< const NetDevice > device) const
Get interface index which is on a specified net device.
Definition: ipv6-l3-protocol.cc:293
ns3::Ipv6L3Protocol::m_sendIcmpv6Redirect
bool m_sendIcmpv6Redirect
Allow ICMPv6 Redirect sending state.
Definition: ipv6-l3-protocol.h:761
ns3::Ipv6L3Protocol::DROP_NO_ROUTE
@ DROP_NO_ROUTE
No route to host.
Definition: ipv6-l3-protocol.h:83
ns3::NetDevice::PacketType
PacketType
Packet types are used as they are in Linux.
Definition: net-device.h:297
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition: traced-callback.h:53
ns3::Ipv6L3Protocol::Ipv6RegisteredMulticastAddress_t
std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t > Ipv6RegisteredMulticastAddress_t
Container of the IPv6 multicast addresses.
Definition: ipv6-l3-protocol.h:771
ns3::Ipv6L3Protocol::GetMtu
uint16_t GetMtu(uint32_t i) const
Get MTU for an interface.
Definition: ipv6-l3-protocol.cc:480
ns3::Ipv6L3Protocol::Ipv6L3Protocol
Ipv6L3Protocol()
Constructor.
Definition: ipv6-l3-protocol.cc:126
ns3::Ipv6L3Protocol::m_reverseInterfacesContainer
Ipv6InterfaceReverseContainer m_reverseInterfacesContainer
Container of NetDevice / Interface index associations.
Definition: ipv6-l3-protocol.h:721
ns3::Ipv6L3Protocol::SetDefaultTtl
void SetDefaultTtl(uint8_t ttl)
Set the default TTL.
Definition: ipv6-l3-protocol.cc:839
ns3::Ipv6L3Protocol::Ipv6L3Protocol
Ipv6L3Protocol(const Ipv6L3Protocol &)
Copy constructor.
ns3::Ipv6L3Protocol::AddInterface
uint32_t AddInterface(Ptr< NetDevice > device)
Add IPv6 interface for a device.
Definition: ipv6-l3-protocol.cc:195
ns3::Ipv6Prefix
Describes an IPv6 prefix.
Definition: ipv6-address.h:456
ns3::Ipv6L3Protocol::GetIpForward
virtual bool GetIpForward() const
Get IPv6 forwarding state.
Definition: ipv6-l3-protocol.cc:656
ns3::Ipv6L3Protocol::m_multicastAddressesNoInterface
Ipv6RegisteredMulticastAddressNoInterface_t m_multicastAddressesNoInterface
List of multicast IP addresses of interest for all the interfaces.
Definition: ipv6-l3-protocol.h:806
ns3::Ipv6L3Protocol::Ipv6InterfaceList
std::vector< Ptr< Ipv6Interface > > Ipv6InterfaceList
Container of the IPv6 Interfaces.
Definition: ipv6-l3-protocol.h:498
ns3::Ipv6L3Protocol::m_unicastForwardTrace
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > m_unicastForwardTrace
Trace of unicast forwarded packets.
Definition: ipv6-l3-protocol.h:566
ns3::Ipv6L3Protocol::AddAddress
bool AddAddress(uint32_t i, Ipv6InterfaceAddress address, bool addOnLinkRoute=true)
Add an address on interface.
Definition: ipv6-l3-protocol.cc:391
ns3::Ipv6L3Protocol::SetMetric
void SetMetric(uint32_t i, uint16_t metric)
Set metric for an interface.
Definition: ipv6-l3-protocol.cc:466
ns3::Ipv6L3Protocol::ReachabilityHint
bool ReachabilityHint(uint32_t ipInterfaceIndex, Ipv6Address address)
Provides reachability hint for Neighbor Cache Entries from L4-L7 protocols.
Definition: ipv6-l3-protocol.cc:1611
ns3::Ipv6L3Protocol::AddMulticastAddress
void AddMulticastAddress(Ipv6Address address)
Adds a multicast address to the list of addresses to pass to local deliver.
Definition: ipv6-l3-protocol.cc:1547