A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
dhcp6-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 NITK Surathkal
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Kavya Bhat <kavyabhat@gmail.com>
7 *
8 */
9
10#ifndef DHCP6_HELPER_H
11#define DHCP6_HELPER_H
12
13#include "ns3/application-container.h"
14#include "ns3/dhcp6-server.h"
15#include "ns3/ipv6-address.h"
16#include "ns3/ipv6-interface-container.h"
17#include "ns3/net-device-container.h"
18#include "ns3/node-container.h"
19#include "ns3/object-factory.h"
20
21#include <stdint.h>
22
23namespace ns3
24{
25
26/**
27 * @ingroup dhcp6
28 *
29 * @class Dhcp6Helper
30 * @brief The helper class used to configure and install DHCPv6 applications on nodes
31 */
33{
34 public:
35 /**
36 * @brief Default constructor.
37 */
39
40 /**
41 * @brief Set DHCPv6 client attributes
42 * @param name Name of the attribute
43 * @param value Value to be set
44 */
45 void SetClientAttribute(std::string name, const AttributeValue& value);
46
47 /**
48 * @brief Set DHCPv6 server attributes
49 * @param name Name of the attribute
50 * @param value Value to be set
51 */
52 void SetServerAttribute(std::string name, const AttributeValue& value);
53
54 /**
55 * @brief Install DHCPv6 client on a set of nodes
56 *
57 * If there is already a DHCPv6 client on the node, the app is not installed,
58 * and the already existing one is returned.
59 *
60 * @param clientNodes Nodes on which the DHCPv6 client is installed
61 * @return The application container with DHCPv6 client installed
62 */
64
65 /**
66 * @brief Install DHCPv6 server on a node / NetDevice. Also updates the
67 * interface -> server map.
68 * @param netDevices The NetDevices on which DHCPv6 server application has to be installed
69 * @return The application container with DHCPv6 server installed
70 */
72
73 private:
74 /**
75 * @brief Helper method that iterates through the installed applications
76 * on a node to look for a Dhcp6Client application. It either installs a
77 * new Dhcp6Client or returns an existing one.
78 * @param clientNode The node on which the application is to be installed.
79 * @return Pointer to the Dhcp6Client application on the node.
80 */
82
83 ObjectFactory m_clientFactory; //!< DHCPv6 client factory.
84 ObjectFactory m_serverFactory; //!< DHCPv6 server factory.
85};
86
87} // namespace ns3
88
89#endif /* DHCP6_HELPER_H */
holds a vector of ns3::Application pointers.
Hold a value for an Attribute.
Definition attribute.h:59
The helper class used to configure and install DHCPv6 applications on nodes.
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.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.