21 #include "ns3/assert.h" 
   25 #include "ns3/net-device.h" 
   26 #include "ns3/loopback-net-device.h" 
   27 #include "ns3/mac16-address.h" 
   28 #include "ns3/mac48-address.h" 
   29 #include "ns3/mac64-address.h" 
   31 #include "ns3/ipv6-address-generator.h" 
   32 #include "ns3/traffic-control-helper.h" 
   33 #include "ns3/traffic-control-layer.h" 
   62                  "Ipv6AddressHelper: network address and prefix mismatch: " << 
m_network << 
" " << 
m_prefix);
 
   65                  "Ipv6AddressHelper: base address and prefix mismatch: " << base << 
" " << 
m_prefix);
 
   79                  "Ipv6AddressHelper::SetBase(): network address and prefix mismatch: " << 
m_network << 
" " << 
m_prefix);
 
   82                  "Ipv6AddressHelper::SetBase(): base address and prefix mismatch: " << base << 
" " << 
m_prefix);
 
  115       NS_FATAL_ERROR (
"Did not pass in a valid Mac Address (8, 16, 48 or 64 bits)");
 
  138                  "Ipv6AddressHelper::NewAddress(): Too many hosts in the network: " << 
m_address << 
" " << 
m_prefix);
 
  140   for (uint8_t i=0; i<16; i++)
 
  142       addrBuf[i] = netBuf[i] | hostBuf[i];
 
  149   sum = 
static_cast<uint16_t
> (hostBuf[15]) + 1;
 
  151   for (uint8_t index=0; index<15; index++)
 
  153       if (sum > hostBuf[15-index])
 
  155           sum = 
static_cast<uint16_t
> (hostBuf[14-index]) + 1;
 
  156           hostBuf[14-index] += 1;
 
  180   for (uint8_t index=0; index<16; index++)
 
  183       if (index==prefixIndex)
 
  185           addBuf[index] = (1<<prefixPosition);
 
  190   for (uint8_t index=0; index<16; index++)
 
  192       sum[index] = 
static_cast<uint16_t
> (netBuf[index]) + static_cast<uint16_t> (addBuf[index]);
 
  193       netBuf[index] += addBuf[index];
 
  196   for (uint8_t index=0; index<15; index++)
 
  198       if (sum[15-index] > netBuf[15-index])
 
  200           sum[14-index] = 
static_cast<uint16_t
> (netBuf[14-index]) + 1;
 
  201           netBuf[14-index] += 1;
 
  214   for (uint32_t i = 0; i < c.
GetN (); ++i) 
 
  219       NS_ASSERT_MSG (node, 
"Ipv6AddressHelper::Allocate (): Bad node");
 
  222       NS_ASSERT_MSG (ipv6, 
"Ipv6AddressHelper::Allocate (): Bad ipv6");
 
  225       ifIndex = ipv6->GetInterfaceForDevice (device);
 
  228           ifIndex = ipv6->AddInterface (device);
 
  230       NS_ASSERT_MSG (ifIndex >= 0, 
"Ipv6AddressHelper::Allocate (): " 
  231                      "Interface index not found");
 
  234       ipv6->SetMetric (ifIndex, 1);
 
  235       ipv6->AddAddress (ifIndex, ipv6Addr);
 
  236       ipv6->SetUp (ifIndex);
 
  238       retval.
Add (ipv6, ifIndex);
 
  244       if (tc && DynamicCast<LoopbackNetDevice> (device) == 0 && tc->GetRootQueueDiscOnDevice (device) == 0)
 
  246           NS_LOG_LOGIC (
"Installing default traffic control configuration");
 
  258   for (uint32_t i = 0; i < c.
GetN (); ++i) 
 
  263       NS_ASSERT_MSG (node, 
"Ipv6AddressHelper::Allocate (): Bad node");
 
  266       NS_ASSERT_MSG (ipv6, 
"Ipv6AddressHelper::Allocate (): Bad ipv6");
 
  268       int32_t ifIndex = ipv6->GetInterfaceForDevice (device);
 
  271           ifIndex = ipv6->AddInterface (device);
 
  273       NS_ASSERT_MSG (ifIndex >= 0, 
"Ipv6AddressHelper::Allocate (): " 
  274                      "Interface index not found");
 
  276       ipv6->SetMetric (ifIndex, 1);
 
  278       if (withConfiguration.at (i))
 
  281           ipv6->AddAddress (ifIndex, ipv6Addr);
 
  284       ipv6->SetUp (ifIndex);
 
  285       retval.
Add (ipv6, ifIndex);
 
  291       if (tc && DynamicCast<LoopbackNetDevice> (device) == 0 && tc->GetRootQueueDiscOnDevice (device) == 0)
 
  293           NS_LOG_LOGIC (
"Installing default traffic control configuration");
 
  305   std::vector<bool> withConfiguration;
 
  306   for (uint32_t i = 0; i < c.
GetN (); ++i) 
 
  308       withConfiguration.push_back (
false);
 
  310   return Assign (c, withConfiguration);
 
static bool IsMatchingType(const Address &address)
 
Smart pointer class similar to boost::intrusive_ptr. 
 
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
 
QueueDiscContainer Install(NetDeviceContainer c)
 
Keep track of a set of IPv6 interfaces. 
 
Ptr< T > GetObject(void) const 
Get a pointer to the requested aggregated Object. 
 
Access to the IPv6 forwarding table, interfaces, and configuration. 
 
Ptr< NetDevice > Get(uint32_t i) const 
Get the Ptr stored in this container at a given index. 
 
Introspection did not find any typical Config paths. 
 
static Mac16Address ConvertFrom(const Address &address)
 
static bool IsMatchingType(const Address &address)
 
void Add(Ptr< Ipv6 > ipv6, uint32_t interface)
Add a couple IPv6/interface. 
 
static Ipv6Address MakeAutoconfiguredAddress(Mac16Address addr, Ipv6Address prefix)
Make the autoconfigured IPv6 address with Mac16Address. 
 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
 
IPv6 address associated with an interface. 
 
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID. 
 
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate. 
 
static bool IsMatchingType(const Address &address)
Check that a generic Address is compatible with Mac8Address. 
 
Ipv6Address m_address
host address 
 
a polymophic address class 
 
Ipv6InterfaceContainer Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses. 
 
uint32_t GetN(void) const 
Get the number of Ptr stored in this container. 
 
NS_ASSERT_MSG(false,"Ipv4AddressGenerator::MaskToIndex(): Impossible")
 
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address. 
 
Ipv6Prefix m_prefix
prefix length 
 
holds a vector of ns3::NetDevice pointers 
 
Build a set of QueueDisc objects. 
 
void GetBytes(uint8_t buf[16]) const 
Get the bytes corresponding to the address. 
 
static Mac48Address ConvertFrom(const Address &address)
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
 
Describes an IPv6 address. 
 
static Mac64Address ConvertFrom(const Address &address)
 
static bool AddAllocated(const Ipv6Address addr)
Add the Ipv6Address to the list of IPv6 entries. 
 
Ipv6Address m_network
network address 
 
Describes an IPv6 prefix. 
 
uint8_t GetPrefixLength() const 
Get prefix length. 
 
static TrafficControlHelper Default(void)
 
static bool IsMatchingType(const Address &address)
 
Ipv6InterfaceContainer AssignWithoutAddress(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer but do not assign any IPv6 addresses. 
 
Ipv6Address CombinePrefix(Ipv6Prefix const &prefix)
Combine this address with a prefix. 
 
static Mac8Address ConvertFrom(const Address &address)
Convert a generic address to a Mac8Address. 
 
Ipv6AddressHelper()
Constructor. 
 
void NewNetwork(void)
Allocate a new network. 
 
Ipv6Address m_base
host base address 
 
Ipv6Address NewAddress(void)
Allocate a new Ipv6Address with interface ID equal to the next one in the underlying generator...