A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
ipv4-address-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 University of Washington
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*/
17
18
#ifndef IPV4_ADDRESS_HELPER_H
19
#define IPV4_ADDRESS_HELPER_H
20
21
#include "
ipv4-interface-container.h
"
22
23
#include "ns3/ipv4-address.h"
24
#include "ns3/net-device-container.h"
25
26
namespace
ns3
27
{
28
48
class
Ipv4AddressHelper
49
{
50
public
:
55
Ipv4AddressHelper
();
56
65
Ipv4AddressHelper
(
Ipv4Address
network,
Ipv4Mask
mask,
Ipv4Address
base =
"0.0.0.1"
);
66
95
void
SetBase
(
Ipv4Address
network,
Ipv4Mask
mask,
Ipv4Address
base =
"0.0.0.1"
);
96
123
Ipv4Address
NewNetwork
();
124
149
Ipv4Address
NewAddress
();
150
179
Ipv4InterfaceContainer
Assign
(
const
NetDeviceContainer
& c);
180
181
private
:
187
uint32_t
NumAddressBits
(uint32_t maskbits)
const
;
188
189
uint32_t
m_network
;
190
uint32_t
m_mask
;
191
uint32_t
m_address
;
192
uint32_t
m_base
;
193
uint32_t
m_shift
;
194
uint32_t
m_max
;
195
};
196
197
}
// namespace ns3
198
199
#endif
/* IPV4_ADDRESS_HELPER_H */
ns3::Ipv4AddressHelper
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Definition:
ipv4-address-helper.h:49
ns3::Ipv4AddressHelper::m_shift
uint32_t m_shift
shift, equivalent to the number of bits in the hostpart
Definition:
ipv4-address-helper.h:193
ns3::Ipv4AddressHelper::m_mask
uint32_t m_mask
network mask
Definition:
ipv4-address-helper.h:190
ns3::Ipv4AddressHelper::m_network
uint32_t m_network
network address
Definition:
ipv4-address-helper.h:189
ns3::Ipv4AddressHelper::m_base
uint32_t m_base
base address
Definition:
ipv4-address-helper.h:192
ns3::Ipv4AddressHelper::NewAddress
Ipv4Address NewAddress()
Increment the IP address counter used to allocate IP addresses.
Definition:
ipv4-address-helper.cc:100
ns3::Ipv4AddressHelper::m_max
uint32_t m_max
maximum allowed address
Definition:
ipv4-address-helper.h:194
ns3::Ipv4AddressHelper::m_address
uint32_t m_address
address
Definition:
ipv4-address-helper.h:191
ns3::Ipv4AddressHelper::Ipv4AddressHelper
Ipv4AddressHelper()
Construct a helper class to make life easier while doing simple IPv4 address assignment in scripts.
Definition:
ipv4-address-helper.cc:38
ns3::Ipv4AddressHelper::SetBase
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Definition:
ipv4-address-helper.cc:64
ns3::Ipv4AddressHelper::NumAddressBits
uint32_t NumAddressBits(uint32_t maskbits) const
Returns the number of address bits (hostpart) for a given netmask.
Definition:
ipv4-address-helper.cc:193
ns3::Ipv4AddressHelper::NewNetwork
Ipv4Address NewNetwork()
Increment the network number and reset the IP address counter to the base value provided in the SetBa...
Definition:
ipv4-address-helper.cc:123
ns3::Ipv4AddressHelper::Assign
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Definition:
ipv4-address-helper.cc:132
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::Ipv4InterfaceContainer
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Definition:
ipv4-interface-container.h:56
ns3::Ipv4Mask
a class to represent an Ipv4 address mask
Definition:
ipv4-address.h:257
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:43
ipv4-interface-container.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
helper
ipv4-address-helper.h
Generated on Sun Mar 3 2024 17:10:57 for ns-3 by
1.9.1