14#include "ns3/address-utils.h"
15#include "ns3/assert.h"
17#include "ns3/simulator.h"
78 .SetGroupName(
"Internet-Apps")
107std::vector<IaOptions>
146 uint16_t duidLength = 2 + 2 + duid.
GetLength();
191 for (
auto itr : requestedOptions)
235 uint16_t optionLength = 12;
247 bool iaidPresent =
false;
250 if (itr.GetIaid() == newIa.
GetIaid())
266 bool iaidPresent =
false;
269 if (itr.GetIaid() == newIa.
GetIaid())
305 if (iaid == (*itr).GetIaid())
319 if (iaid == (*itr).GetIaid())
328 if (!isIana && !isIata)
330 NS_LOG_ERROR(
"Given IAID does not exist, cannot add address.");
342 (*itr).m_iaAddressOption.push_back(adrOpt);
345 (*itr).SetOptionLength((*itr).GetOptionLength() + 28);
351std::map<Options::OptionType, bool>
382 os <<
"(type=" << +(uint8_t)
m_msgType <<
")";
420 std::vector<IaAddressOption> iaAddresses = itr.m_iaAddressOption;
421 for (
const auto& iaItr : iaAddresses)
426 Address addr = iaItr.GetIaAddress();
429 i.
Write(addrBuf, 16);
447 for (
const auto& itr : requestedOptions)
557 if (len + 12 <= cLen)
567 while (readLen < iaAddrOptLen)
615 while (len + 2 <= cLen)
653 i.
Read(strBuf, msgLength);
654 strBuf[msgLength] =
'\0';
656 std::string statusMsg((
char*)strBuf);
a polymophic address class
uint32_t CopyTo(uint8_t buffer[MAX_SIZE]) const
Copy the address bytes into a buffer.
iterator in a Buffer instance
void Write(const uint8_t *buffer, uint32_t size)
void Read(uint8_t *buffer, uint32_t size)
void WriteHtonU16(uint16_t data)
void WriteHtonU32(uint32_t data)
void Next()
go forward by one byte
Implements the unique identifier for DHCPv6.
uint32_t Deserialize(Buffer::Iterator start, uint32_t len)
Deserialize the DUID.
uint8_t GetLength() const
Get the length of the DUID.
void Serialize(Buffer::Iterator start) const
Serialize the DUID.
uint32_t GetSerializedSize() const
Get the DUID serialized size.
Implements the IA Address options.
void SetPreferredLifetime(uint32_t preferredLifetime)
Set the preferred lifetime.
void SetValidLifetime(uint32_t validLifetime)
Set the valid lifetime.
void SetIaAddress(Ipv6Address iaAddress)
Set the IA Address.
Implements the IANA and IATA options.
std::vector< IaAddressOption > m_iaAddressOption
The list of IA Address options associated with the IANA.
void SetT1(uint32_t t1)
Set the time interval in seconds after which the client contacts the server which provided the addres...
void SetT2(uint32_t t2)
Set the time interval in seconds after which the client contacts any available server to extend the a...
uint32_t GetIaid() const
Get the unique identifier for the given IANA or IATA.
void SetIaid(uint32_t iaid)
Set the unique identifier for the given IANA or IATA.
Implements the client and server identifier options.
void SetDuid(Duid duid)
Set the DUID.
Duid GetDuid() const
Get the DUID object.
void SetOptionValue(T optionValue)
Set the option value.
T GetOptionValue() const
Get the option value.
Describes an IPv6 address.
StatusCodeValues
Enum to identify the status code of the operation.
void SetOptionCode(OptionType code)
Set the option code.
uint16_t GetOptionLength() const
Get the option length.
OptionType GetOptionCode() const
Get the option code.
OptionType
Enum to identify the option type.
void SetOptionLength(uint16_t length)
Set the option length.
Implements the Option Request option.
std::vector< OptionType > GetRequestedOptions() const
Get the option values.
void AddRequestedOption(OptionType requestedOption)
Set the option values.
Implements the Status Code option.
void SetStatusCode(StatusCodeValues statusCode)
Set the status code of the operation.
StatusCodeValues GetStatusCode() const
Get the status code of the operation.
std::string GetStatusMessage() const
Get the status message of the operation.
void SetStatusMessage(std::string statusMessage)
Set the status message of the operation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Every class exported by the ns3 library is enclosed in the ns3 namespace.