A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ipv6-interface-container.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008-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_INTERFACE_CONTAINER_H
22 #define IPV6_INTERFACE_CONTAINER_H
23 
24 #include <stdint.h>
25 
26 #include <vector>
27 
28 #include "ns3/ipv6.h"
29 #include "ns3/ipv6-address.h"
30 
31 namespace ns3
32 {
33 
39 {
40 public:
41  typedef std::vector<std::pair<Ptr<Ipv6>, uint32_t> >::const_iterator Iterator;
46 
66  uint32_t GetN (void) const;
67 
73  uint32_t GetInterfaceIndex (uint32_t i) const;
74 
81  Ipv6Address GetAddress (uint32_t i, uint32_t j) const;
82 
88  void Add (Ptr<Ipv6> ipv6, uint32_t interface);
89 
110  Iterator Begin (void) const;
111 
132  Iterator End (void) const;
133 
138  void Add (Ipv6InterfaceContainer& c);
139 
145  void Add (std::string ipv6Name, uint32_t interface);
146 
152  void SetRouter (uint32_t i, bool router);
153 
159  void SetDefaultRoute (uint32_t i, uint32_t router);
160 
161 private:
162  typedef std::vector<std::pair<Ptr<Ipv6>, uint32_t> > InterfaceVector;
163 
168  InterfaceVector m_interfaces;
169 };
170 
171 } /* namespace ns3 */
172 
173 #endif /* IPV6_INTERFACE_CONTAINER_H */
174 
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
Keep track of a set of IPv6 interfaces.
void Add(Ptr< Ipv6 > ipv6, uint32_t interface)
Add a couple IPv6/interface.
InterfaceVector m_interfaces
List of IPv6 stack and interfaces index.
uint32_t GetInterfaceIndex(uint32_t i) const
Get the interface index for the specified node index.
void SetDefaultRoute(uint32_t i, uint32_t router)
Set the default route for the specified index.
void SetRouter(uint32_t i, bool router)
Set the state of the stack (act as a router or not) for the specified index.
Describes an IPv6 address.
Definition: ipv6-address.h:44
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.