A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
ipv6-interface-container.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008-2009 Strasbourg University
3
* 2013 Universita' di Firenze
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
* Tommaso Pecorella <tommaso.pecorella@unifi.it>
20
*/
21
22
#ifndef IPV6_INTERFACE_CONTAINER_H
23
#define IPV6_INTERFACE_CONTAINER_H
24
25
#include "ns3/ipv6-address.h"
26
#include "ns3/ipv6.h"
27
28
#include <stdint.h>
29
#include <vector>
30
31
namespace
ns3
32
{
33
39
class
Ipv6InterfaceContainer
40
{
41
public
:
45
typedef
std::vector<std::pair<Ptr<Ipv6>,
uint32_t
>>::const_iterator
Iterator
;
46
50
Ipv6InterfaceContainer
();
51
71
uint32_t
GetN
()
const
;
72
78
uint32_t
GetInterfaceIndex
(
uint32_t
i)
const
;
79
86
Ipv6Address
GetAddress
(
uint32_t
i,
uint32_t
j)
const
;
87
93
Ipv6Address
GetLinkLocalAddress
(
uint32_t
i);
94
100
Ipv6Address
GetLinkLocalAddress
(
Ipv6Address
address);
101
107
void
Add
(
Ptr<Ipv6>
ipv6,
uint32_t
interface);
108
129
Iterator
Begin
()
const
;
130
151
Iterator
End
()
const
;
152
157
void
Add
(
const
Ipv6InterfaceContainer
& c);
158
164
void
Add
(std::string ipv6Name,
uint32_t
interface);
165
187
std::pair<Ptr<Ipv6>,
uint32_t
>
Get
(
uint32_t
i)
const
;
188
195
void
SetForwarding
(
uint32_t
i,
bool
state);
196
201
void
SetDefaultRouteInAllNodes
(
uint32_t
router);
202
209
void
SetDefaultRouteInAllNodes
(
Ipv6Address
routerAddr);
210
216
void
SetDefaultRoute
(
uint32_t
i,
uint32_t
router);
217
225
void
SetDefaultRoute
(
uint32_t
i,
Ipv6Address
routerAddr);
226
227
private
:
231
typedef
std::vector<std::pair<Ptr<Ipv6>,
uint32_t
>>
InterfaceVector
;
232
236
InterfaceVector
m_interfaces
;
237
};
238
239
}
/* namespace ns3 */
240
241
#endif
/* IPV6_INTERFACE_CONTAINER_H */
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:49
ns3::Ipv6InterfaceContainer
Keep track of a set of IPv6 interfaces.
Definition:
ipv6-interface-container.h:40
ns3::Ipv6InterfaceContainer::SetForwarding
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.
Definition:
ipv6-interface-container.cc:98
ns3::Ipv6InterfaceContainer::GetInterfaceIndex
uint32_t GetInterfaceIndex(uint32_t i) const
Get the interface index for the specified node index.
Definition:
ipv6-interface-container.cc:55
ns3::Ipv6InterfaceContainer::Ipv6InterfaceContainer
Ipv6InterfaceContainer()
Constructor.
Definition:
ipv6-interface-container.cc:32
ns3::Ipv6InterfaceContainer::SetDefaultRouteInAllNodes
void SetDefaultRouteInAllNodes(uint32_t router)
Set the default route for all the devices (except the router itself).
Definition:
ipv6-interface-container.cc:105
ns3::Ipv6InterfaceContainer::SetDefaultRoute
void SetDefaultRoute(uint32_t i, uint32_t router)
Set the default route for the specified index.
Definition:
ipv6-interface-container.cc:174
ns3::Ipv6InterfaceContainer::m_interfaces
InterfaceVector m_interfaces
List of IPv6 stack and interfaces index.
Definition:
ipv6-interface-container.h:236
ns3::Ipv6InterfaceContainer::InterfaceVector
std::vector< std::pair< Ptr< Ipv6 >, uint32_t > > InterfaceVector
Container for pairs of Ipv6 smart pointer / Interface Index.
Definition:
ipv6-interface-container.h:231
ns3::Ipv6InterfaceContainer::Iterator
std::vector< std::pair< Ptr< Ipv6 >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of Ipv6 smart pointer / Interface Index.
Definition:
ipv6-interface-container.h:45
ns3::Ipv6InterfaceContainer::GetAddress
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
Definition:
ipv6-interface-container.cc:61
ns3::Ipv6InterfaceContainer::GetLinkLocalAddress
Ipv6Address GetLinkLocalAddress(uint32_t i)
Get the link-local address for the specified index.
Definition:
ipv6-interface-container.cc:236
ns3::Ipv6InterfaceContainer::GetN
uint32_t GetN() const
Definition:
ipv6-interface-container.cc:49
ns3::Ipv6InterfaceContainer::End
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Definition:
ipv6-interface-container.cc:43
ns3::Ipv6InterfaceContainer::Add
void Add(Ptr< Ipv6 > ipv6, uint32_t interface)
Add a couple IPv6/interface.
Definition:
ipv6-interface-container.cc:69
ns3::Ipv6InterfaceContainer::Get
std::pair< Ptr< Ipv6 >, uint32_t > Get(uint32_t i) const
Get the std::pair of an Ptr<Ipv6> and interface stored at the location specified by the index.
Definition:
ipv6-interface-container.cc:92
ns3::Ipv6InterfaceContainer::Begin
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
Definition:
ipv6-interface-container.cc:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
helper
ipv6-interface-container.h
Generated on Sun Jul 2 2023 18:21:38 for ns-3 by
1.9.6