A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
ipv4-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 INRIA
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: Mathieu Lacage <mathieu.lacage@cutebugs.net>
19
*/
20
21
#ifndef IPV4_INTERFACE_CONTAINER_H
22
#define IPV4_INTERFACE_CONTAINER_H
23
24
#include <stdint.h>
25
#include <vector>
26
#include "ns3/ipv4.h"
27
#include "ns3/ipv4-address.h"
28
29
namespace
ns3
{
30
54
class
Ipv4InterfaceContainer
55
{
56
public
:
60
typedef
std::vector<std::pair<Ptr<Ipv4>, uint32_t> >::const_iterator
Iterator
;
61
65
Ipv4InterfaceContainer
();
66
71
void
Add
(
const
Ipv4InterfaceContainer
& other);
72
93
Iterator
Begin
(
void
)
const
;
94
115
Iterator
End
(
void
)
const
;
116
138
uint32_t
GetN
(
void
)
const
;
139
150
Ipv4Address
GetAddress
(uint32_t i, uint32_t j = 0)
const
;
151
157
void
SetMetric
(uint32_t i, uint16_t metric);
158
166
void
Add
(
Ptr<Ipv4>
ipv4, uint32_t interface);
167
174
void
Add
(std::pair<
Ptr<Ipv4>
, uint32_t> ipInterfacePair);
175
184
void
Add
(std::string ipv4Name, uint32_t interface);
185
207
std::pair<Ptr<Ipv4>, uint32_t>
Get
(uint32_t i)
const
;
208
209
private
:
213
typedef
std::vector<std::pair<Ptr<Ipv4>,uint32_t> >
InterfaceVector
;
214
218
InterfaceVector
m_interfaces
;
219
};
220
221
}
// namespace ns3
222
223
#endif
/* IPV4_INTERFACE_CONTAINER_H */
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:41
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:74
ns3::Ipv4InterfaceContainer::GetN
uint32_t GetN(void) const
Definition:
ipv4-interface-container.cc:53
ns3::Ipv4InterfaceContainer::m_interfaces
InterfaceVector m_interfaces
List of IPv4 stack and interfaces index.
Definition:
ipv4-interface-container.h:218
ns3::Ipv4InterfaceContainer::End
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
Definition:
ipv4-interface-container.cc:47
ns3::Ipv4InterfaceContainer::Begin
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
Definition:
ipv4-interface-container.cc:41
ns3::Ipv4InterfaceContainer::SetMetric
void SetMetric(uint32_t i, uint16_t metric)
Set a metric for the given interface.
Definition:
ipv4-interface-container.cc:67
ns3::Ipv4InterfaceContainer
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Definition:
ipv4-interface-container.h:55
ns3::Ipv4InterfaceContainer::Get
std::pair< Ptr< Ipv4 >, uint32_t > Get(uint32_t i) const
Get the std::pair of an Ptr<Ipv4> and interface stored at the location specified by the index.
Definition:
ipv4-interface-container.cc:90
ns3::Ipv4InterfaceContainer::Ipv4InterfaceContainer
Ipv4InterfaceContainer()
Create an empty Ipv4InterfaceContainer.
Definition:
ipv4-interface-container.cc:27
ns3::Ipv4InterfaceContainer::Add
void Add(const Ipv4InterfaceContainer &other)
Concatenate the entries in the other container with ours.
Definition:
ipv4-interface-container.cc:32
ns3::Ipv4InterfaceContainer::InterfaceVector
std::vector< std::pair< Ptr< Ipv4 >, uint32_t > > InterfaceVector
Container for pairs of Ipv4 smart pointer / Interface Index.
Definition:
ipv4-interface-container.h:213
ns3::Ipv4InterfaceContainer::Iterator
std::vector< std::pair< Ptr< Ipv4 >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of Ipv4 smart pointer / Interface Index.
Definition:
ipv4-interface-container.h:60
ns3::Ipv4InterfaceContainer::GetAddress
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Definition:
ipv4-interface-container.cc:59
src
internet
helper
ipv4-interface-container.h
Generated on Fri Oct 1 2021 17:03:04 for ns-3 by
1.8.20