/usr/include/ns3.26/ns3/ipv6-address-helper.h is in libns3-dev 3.26+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2008-2009 Strasbourg University
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
* modified by Tom Henderson for ns-3.14 release
*/
#ifndef IPV6_ADDRESS_HELPER_H
#define IPV6_ADDRESS_HELPER_H
#include <vector>
#include "ns3/ipv6-address.h"
#include "ns3/net-device-container.h"
#include "ipv6-interface-container.h"
namespace ns3 {
/**
* \ingroup ipv6Helpers
*
* \brief Helper class to auto-assign global IPv6 unicast addresses
*
* Assign global unicast IPv6 addresses based on \RFC{4291} definition.
*
* | n bits | 64-n bits | 64 bits |
* +-------------------------+-----------+----------------------------+
* | global routing prefix | subnet ID | interface ID |
* +-------------------------+-----------+----------------------------+
* <-------------network---------------->
*
* 11111111111111111111111111000000000000
* <---prefix of length n--->
*
* This class handles the following quantities.
* 1) The "network" which covers the 64 bit union of the global routing
* prefix and the subnet ID
* 2) the "prefix" length "n" which demarcates the global routing prefix
* and the subnet ID
* 3) the "base" which is the initial 64-bit interface ID.
*
* The names "network", "prefix" and "base" are chosen to be consistent
* with a similar address helper for IPv4.
*
* This helper class allows users to set or reset the network and
* interface components, and call "NewAddress ()" to sequentially increment
* the interface ID, and call "NewNetwork ()" to allocate a new subnet
* (until the subnet ID quantity rolls over). A call to NewNetwork ()
* that causes the subnet ID to roll over will trigger an assertion.
*
* By default, the prefix is 32 bits and the network is '2001:db8::/32'
* (\RFC{5156} section 2.6 Documentation prefix). The prefix may range
* from length 0 to 64, with the value 64 having a special meaning that
* no subnet ID boundary is enforced (equivalent to value 0).
*
* There are two variants of interface ID supported (\RFC{4291}, Sec. 2.5.1)
* The default is a "local" scope, but a "universal" scoped ID may be
* formed by calling "NewAddress (Address addr)" with a 48-bit MAC address.
* If this method is called, the addressed returned will include a
* modified EUI-64-format identifier created from the MAC address as
* specified in \RFC{4291}.
*
* BEWARE: the underlying implementation acts as a Singleton.
* In other terms, two different instances of Ipv6AddressHelper will
* pick IPv6 numbers from the same pool. Changing the network in one of them
* will also change the network in the other instances.
*/
class Ipv6AddressHelper
{
public:
/**
* \brief Constructor.
*/
Ipv6AddressHelper ();
/**
* \brief Constructor.
* \param network The IPv6 network
* \param prefix The prefix
* \param base The base interface ID
*/
Ipv6AddressHelper (Ipv6Address network, Ipv6Prefix prefix,
Ipv6Address base = Ipv6Address ("::1"));
/**
* \brief Set the base network number, network prefix, and base interface ID
*
* \param network The IPv6 network
* \param prefix The prefix
* \param base The base interface ID
*/
void SetBase (Ipv6Address network, Ipv6Prefix prefix,
Ipv6Address base = Ipv6Address ("::1"));
/**
* \brief Allocate a new network.
*
* This method will cause the subnet prefix to increment, for future
* network IDs, and resets the interface ID to the previously used
* base.
*/
void NewNetwork (void);
/**
* \brief Allocate a new Ipv6Address.
*
* If a Mac48Address is passed in, an Ipv6 autoconfigured address
* according to the current subnet prefix is returned. If something
* other than Mac48 address is passed in, the program will terminate.
*
* \param addr address used to generate the interface ID of the IPv6 address
* \return newly created Ipv6Address
*/
Ipv6Address NewAddress (Address addr);
/**
* \brief Allocate a new Ipv6Address with interface ID equal to the
* next one in the underlying generator.
*
* \return newly created Ipv6Address
*/
Ipv6Address NewAddress (void);
/**
* \brief Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
* \param c netdevice container
* \return newly created Ipv6InterfaceContainer
*/
Ipv6InterfaceContainer Assign (const NetDeviceContainer &c);
/**
* \brief Allocate an Ipv6InterfaceContainer, and control whether the
* interfaces have addresses auto-assigned to them
*
* \param c netdevice container
* \param withConfiguration a vector of values for which, for a
* given device, true : interface automatically addressed,
* false : no automatic address
* \return newly created Ipv6InterfaceContainer
*/
Ipv6InterfaceContainer Assign (const NetDeviceContainer &c, std::vector<bool> withConfiguration);
/**
* \brief Allocate an Ipv6InterfaceContainer but do not assign any IPv6 addresses
*
* This method is used when IPv6 address assignment may occur later
* (such as dynamic address assignment)
*
* Equivalent to AssignWithoutAddress (c, std::vector<bool> of false);
*
* \param c netdevice container
* \return newly created Ipv6InterfaceContainer
*/
Ipv6InterfaceContainer AssignWithoutAddress (const NetDeviceContainer &c);
};
} /* namespace ns3 */
#endif /* IPV6_ADDRESS_STATIC_H */
|