A Discrete-Event Network Simulator
API
ipv6-interface-container.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008-2009 Strasbourg University
4  * 2013 Universita' di Firenze
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
20  * Tommaso Pecorella <tommaso.pecorella@unifi.it>
21  */
22 
23 #ifndef IPV6_INTERFACE_CONTAINER_H
24 #define IPV6_INTERFACE_CONTAINER_H
25 
26 #include <stdint.h>
27 
28 #include <vector>
29 
30 #include "ns3/ipv6.h"
31 #include "ns3/ipv6-address.h"
32 
33 namespace ns3
34 {
35 
42 {
43 public:
44 
48  typedef std::vector<std::pair<Ptr<Ipv6>, uint32_t> >::const_iterator Iterator;
49 
54 
74  uint32_t GetN (void) const;
75 
81  uint32_t GetInterfaceIndex (uint32_t i) const;
82 
89  Ipv6Address GetAddress (uint32_t i, uint32_t j) const;
90 
96  Ipv6Address GetLinkLocalAddress (uint32_t i);
97 
104 
110  void Add (Ptr<Ipv6> ipv6, uint32_t interface);
111 
132  Iterator Begin (void) const;
133 
154  Iterator End (void) const;
155 
160  void Add (const Ipv6InterfaceContainer& c);
161 
167  void Add (std::string ipv6Name, uint32_t interface);
168 
175  void SetForwarding (uint32_t i, bool state);
176 
181  void SetDefaultRouteInAllNodes (uint32_t router);
182 
188  void SetDefaultRouteInAllNodes (Ipv6Address routerAddr);
189 
195  void SetDefaultRoute (uint32_t i, uint32_t router);
196 
203  void SetDefaultRoute (uint32_t i, Ipv6Address routerAddr);
204 
205 private:
209  typedef std::vector<std::pair<Ptr<Ipv6>, uint32_t> > InterfaceVector;
210 
215 };
216 
217 } /* namespace ns3 */
218 
219 #endif /* IPV6_INTERFACE_CONTAINER_H */
220 
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
Keep track of a set of IPv6 interfaces.
void SetDefaultRouteInAllNodes(uint32_t router)
Set the default route for all the devices (except the router itself).
void Add(Ptr< Ipv6 > ipv6, uint32_t interface)
Add a couple IPv6/interface.
std::vector< std::pair< Ptr< Ipv6 >, uint32_t > > InterfaceVector
Container for pairs of Ipv6 smart pointer / Interface Index.
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
void SetForwarding(uint32_t i, bool state)
Set the state of the stack (act as a router or as an host) for the specified index.
std::vector< std::pair< Ptr< Ipv6 >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of Ipv6 smart pointer / Interface Index.
InterfaceVector m_interfaces
List of IPv6 stack and interfaces index.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
void SetDefaultRoute(uint32_t i, uint32_t router)
Set the default route for the specified index.
Ipv6Address GetLinkLocalAddress(uint32_t i)
Get the link-local address for the specified index.
uint32_t GetInterfaceIndex(uint32_t i) const
Get the interface index for the specified node index.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
address
Definition: first.py:44
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
Describes an IPv6 address.
Definition: ipv6-address.h:49