12#include "ns3/dhcp6-client.h"
13#include "ns3/dhcp6-server.h"
16#include "ns3/loopback-net-device.h"
18#include "ns3/uinteger.h"
47 for (
auto iter = clientNodes.
Begin(); iter != clientNodes.
End(); iter++)
50 installedApps.
Add(app);
60 for (
auto itr = netDevices.
Begin(); itr != netDevices.
End(); itr++)
64 NS_ASSERT_MSG(node,
"Dhcp6Helper: NetDevice is not associated with any node -> fail");
68 "Dhcp6Helper: NetDevice is associated"
69 " with a node without IPv6 stack installed -> fail "
70 "(maybe need to use InternetStackHelper?)");
72 uint32_t nApplications = node->GetNApplications();
74 for (
uint32_t i = 0; i < nApplications; i++)
80 node->AddApplication(app);
81 app->SetDhcp6ServerNetDevice(netDevices);
82 installedApps.
Add(app);
86 if (nApplications == 0)
89 node->AddApplication(app);
90 app->SetDhcp6ServerNetDevice(netDevices);
91 installedApps.
Add(app);
102 for (
uint32_t index = 0; index < clientNode->GetNApplications(); index++)
104 app = clientNode->GetApplication(index);
112 clientNode->AddApplication(app);
holds a vector of ns3::Application pointers.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
Hold a value for an Attribute.
Implements the DHCPv6 client.
static TypeId GetTypeId()
Get the type ID.
void SetServerAttribute(std::string name, const AttributeValue &value)
Set DHCPv6 server attributes.
ObjectFactory m_serverFactory
DHCPv6 server factory.
Ptr< Application > InstallDhcp6ClientInternal(Ptr< Node > clientNode) const
Helper method that iterates through the installed applications on a node to look for a Dhcp6Client ap...
void SetClientAttribute(std::string name, const AttributeValue &value)
Set DHCPv6 client attributes.
ObjectFactory m_clientFactory
DHCPv6 client factory.
Dhcp6Helper()
Default constructor.
ApplicationContainer InstallDhcp6Client(NodeContainer clientNodes) const
Install DHCPv6 client on a set of nodes.
ApplicationContainer InstallDhcp6Server(NetDeviceContainer netDevices)
Install DHCPv6 server on a node / NetDevice.
Implements the DHCPv6 server.
static TypeId GetTypeId()
Get the type ID.
Access to the IPv6 forwarding table, interfaces, and configuration.
holds a vector of ns3::NetDevice pointers
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.