A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::Dhcp6Header Class Reference

Implements the DHCPv6 header. More...

#include "dhcp6-header.h"

+ Inheritance diagram for ns3::Dhcp6Header:
+ Collaboration diagram for ns3::Dhcp6Header:

Public Types

enum class  MessageType {
  INIT = 0 , SOLICIT = 1 , ADVERTISE = 2 , REQUEST = 3 ,
  CONFIRM = 4 , RENEW = 5 , REBIND = 6 , REPLY = 7 ,
  RELEASE = 8 , DECLINE = 9 , RECONFIGURE = 10 , INFORMATION_REQUEST = 11 ,
  RELAY_FORW = 12 , RELAY_REPL = 13
}
 Enum to identify the message type. More...
 

Public Member Functions

 Dhcp6Header ()
 Default constructor.
 
void AddAddress (uint32_t iaid, Ipv6Address address, uint32_t prefLifetime, uint32_t validLifetime)
 Add IA address option to the IANA or IATA.
 
void AddClientIdentifier (Duid duid)
 Add the client identifier option.
 
void AddElapsedTime (uint16_t timestamp)
 Set the elapsed time option.
 
void AddIanaOption (uint32_t iaid, uint32_t t1, uint32_t t2)
 Add IANA option.
 
void AddIataOption (uint32_t iaid)
 Add IATA option.
 
void AddOptionRequest (Options::OptionType optionType)
 Request additional options.
 
void AddServerIdentifier (Duid duid)
 Add the server identifier option.
 
void AddSolMaxRt ()
 Add the SOL_MAX_RT option.
 
void AddStatusCode (Options::StatusCodeValues statusCode, std::string statusMsg)
 Add the status code option.
 
IdentifierOption GetClientIdentifier ()
 Get the client identifier.
 
std::vector< IaOptionsGetIanaOptions ()
 Get the list of IA_NA options.
 
MessageType GetMessageType () const
 Get the type of message.
 
std::map< Options::OptionType, bool > GetOptionList ()
 Get list of all options set in the header.
 
RequestOptions GetOptionRequest ()
 Get the option request option.
 
IdentifierOption GetServerIdentifier ()
 Get the server identifier.
 
StatusCodeOption GetStatusCodeOption ()
 Get the status code of the operation.
 
uint32_t GetTransactId () const
 Get the transaction ID.
 
void HandleOptionRequest (std::vector< Options::OptionType > requestedOptions)
 Handle all options requested by client.
 
void ResetOptions ()
 Reset all options.
 
void SetMessageType (MessageType msgType)
 Set the message type.
 
void SetTransactId (uint32_t transactId)
 Set the transaction ID.
 
- Public Member Functions inherited from ns3::Header
 ~Header () override
 
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Header
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Chunk
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Static Public Attributes

static const uint16_t CLIENT_PORT = 546
 The port number of the DHCPv6 client.
 
static const uint16_t SERVER_PORT = 547
 The port number of the DHCPv6 server.
 

Private Member Functions

void AddIaOption (Options::OptionType optionType, uint32_t iaid, uint32_t t1=0, uint32_t t2=0)
 Add IANA or IATA option to the header.
 
void AddIdentifierOption (IdentifierOption &identifier, Options::OptionType optionType, Duid duid)
 Add an identifier option to the header.
 
void AddMessageLength (uint32_t len)
 Update the message length.
 
uint32_t Deserialize (Buffer::Iterator start) override
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
uint32_t GetSerializedSize () const override
 
void Print (std::ostream &os) const override
 
void Serialize (Buffer::Iterator start) const override
 

Private Attributes

IdentifierOption m_clientIdentifier
 The client identifier option.
 
ElapsedTimeOption m_elapsedTime
 The amount of time since the client began the transaction.
 
std::vector< IaOptionsm_ianaList
 Vector of IA_NA options.
 
std::vector< IaOptionsm_iataList
 Vector of IA_TA options.
 
uint32_t m_len
 The length of the message.
 
MessageType m_msgType
 The message type.
 
RequestOptions m_optionRequest
 List of additional options requested.
 
std::map< Options::OptionType, bool > m_options
 Options present in the header, indexed by option code.
 
PreferenceOption m_preference
 The preference value for the server.
 
IdentifierOption m_serverIdentifier
 The server identifier option.
 
uint32_t m_solMaxRt
 Default value for SOL_MAX_RT option.
 
StatusCodeOption m_statusCode
 (optional) The status code of the operation just performed.
 
uint32_t m_transactId: 24
 The transaction ID calculated by the client or the server.
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Detailed Description

Implements the DHCPv6 header.

Definition at line 37 of file dhcp6-header.h.

Member Enumeration Documentation

◆ MessageType

enum class ns3::Dhcp6Header::MessageType
strong

Enum to identify the message type.

RELAY_FORW, RELAY_REPL message types are not currently implemented. These symbols and values are defined in RFC 8415, section 7.3

Enumerator
INIT 
SOLICIT 
ADVERTISE 
REQUEST 
CONFIRM 
RENEW 
REBIND 
REPLY 
RELEASE 
DECLINE 
RECONFIGURE 
INFORMATION_REQUEST 
RELAY_FORW 
RELAY_REPL 

Definition at line 57 of file dhcp6-header.h.

Constructor & Destructor Documentation

◆ Dhcp6Header()

ns3::Dhcp6Header::Dhcp6Header ( )

Default constructor.

Definition at line 26 of file dhcp6-header.cc.

References m_solMaxRt.

Member Function Documentation

◆ AddAddress()

void ns3::Dhcp6Header::AddAddress ( uint32_t iaid,
Ipv6Address address,
uint32_t prefLifetime,
uint32_t validLifetime )

Add IA address option to the IANA or IATA.

Parameters
iaidthe unique identifier of the identity association.
addressThe IPv6 address to be offered.
prefLifetimethe preferred lifetime in seconds.
validLifetimethe valid lifetime in seconds.

Definition at line 293 of file dhcp6-header.cc.

References AddMessageLength(), m_ianaList, m_iataList, NS_LOG_ERROR, ns3::Options::OPTION_IAADDR, ns3::IaAddressOption::SetIaAddress(), ns3::Options::SetOptionCode(), ns3::Options::SetOptionLength(), ns3::IaAddressOption::SetPreferredLifetime(), and ns3::IaAddressOption::SetValidLifetime().

Referenced by ns3::Dhcp6Client::InterfaceConfig::DeclineOffer(), ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Client::SendRenew(), ns3::Dhcp6Server::SendReply(), and ns3::Dhcp6Client::SendRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddClientIdentifier()

void ns3::Dhcp6Header::AddClientIdentifier ( Duid duid)

Add the client identifier option.

Parameters
duidThe DUID which identifies the client.

Definition at line 129 of file dhcp6-header.cc.

References AddIdentifierOption(), m_clientIdentifier, and ns3::Options::OPTION_CLIENTID.

Referenced by ns3::Dhcp6Client::Boot(), ns3::Dhcp6Client::InterfaceConfig::DeclineOffer(), ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Client::SendRebind(), ns3::Dhcp6Client::SendRenew(), ns3::Dhcp6Server::SendReply(), ns3::Dhcp6Client::SendRequest(), and ns3::Dhcp6Server::UpdateBindings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddElapsedTime()

void ns3::Dhcp6Header::AddElapsedTime ( uint16_t timestamp)

Set the elapsed time option.

Parameters
timestampthe time at which the client began the exchange.

Definition at line 114 of file dhcp6-header.cc.

References AddMessageLength(), m_elapsedTime, m_options, ns3::Options::OPTION_ELAPSED_TIME, ns3::Options::SetOptionCode(), ns3::Options::SetOptionLength(), and ns3::IntegerOptions< T >::SetOptionValue().

Referenced by ns3::Dhcp6Client::Boot(), ns3::Dhcp6Client::InterfaceConfig::DeclineOffer(), ns3::Dhcp6Client::SendRebind(), ns3::Dhcp6Client::SendRenew(), and ns3::Dhcp6Client::SendRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddIanaOption()

void ns3::Dhcp6Header::AddIanaOption ( uint32_t iaid,
uint32_t t1,
uint32_t t2 )

Add IANA option.

Parameters
iaid
t1
t2

Definition at line 216 of file dhcp6-header.cc.

References AddIaOption(), and ns3::Options::OPTION_IA_NA.

Referenced by ns3::Dhcp6Client::Boot(), ns3::Dhcp6Client::InterfaceConfig::DeclineOffer(), ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Client::SendRebind(), ns3::Dhcp6Client::SendRenew(), ns3::Dhcp6Server::SendReply(), and ns3::Dhcp6Client::SendRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddIaOption()

void ns3::Dhcp6Header::AddIaOption ( Options::OptionType optionType,
uint32_t iaid,
uint32_t t1 = 0,
uint32_t t2 = 0 )
private

Add IANA or IATA option to the header.

Parameters
optionTypeidentify whether to add an IANA or IATA.
iaid
t1
t2

Definition at line 228 of file dhcp6-header.cc.

References AddMessageLength(), ns3::IaOptions::GetIaid(), m_ianaList, m_iataList, m_options, ns3::Options::OPTION_IA_NA, ns3::Options::OPTION_IA_TA, ns3::IaOptions::SetIaid(), ns3::Options::SetOptionCode(), ns3::Options::SetOptionLength(), ns3::IaOptions::SetT1(), and ns3::IaOptions::SetT2().

Referenced by AddIanaOption(), and AddIataOption().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddIataOption()

void ns3::Dhcp6Header::AddIataOption ( uint32_t iaid)

Add IATA option.

Parameters
iaid

Definition at line 222 of file dhcp6-header.cc.

References AddIaOption(), and ns3::Options::OPTION_IA_TA.

+ Here is the call graph for this function:

◆ AddIdentifierOption()

void ns3::Dhcp6Header::AddIdentifierOption ( IdentifierOption & identifier,
Options::OptionType optionType,
Duid duid )
private

Add an identifier option to the header.

Parameters
identifierthe client or server identifier option object.
optionTypeidentify whether to add a client or server identifier.
duidThe unique identifier for the client or server.

Definition at line 141 of file dhcp6-header.cc.

References AddMessageLength(), ns3::Duid::GetLength(), m_options, ns3::IdentifierOption::SetDuid(), ns3::Options::SetOptionCode(), and ns3::Options::SetOptionLength().

Referenced by AddClientIdentifier(), and AddServerIdentifier().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddMessageLength()

void ns3::Dhcp6Header::AddMessageLength ( uint32_t len)
private

Update the message length.

Parameters
lenThe length to be added to the total.

Definition at line 61 of file dhcp6-header.cc.

References m_len.

Referenced by AddAddress(), AddElapsedTime(), AddIaOption(), AddIdentifierOption(), AddOptionRequest(), AddSolMaxRt(), and AddStatusCode().

+ Here is the caller graph for this function:

◆ AddOptionRequest()

void ns3::Dhcp6Header::AddOptionRequest ( Options::OptionType optionType)

Request additional options.

Parameters
optionTypethe option to be requested.

Definition at line 167 of file dhcp6-header.cc.

References AddMessageLength(), ns3::RequestOptions::AddRequestedOption(), ns3::Options::GetOptionLength(), m_optionRequest, m_options, ns3::Options::OPTION_ORO, ns3::Options::SetOptionCode(), and ns3::Options::SetOptionLength().

Referenced by ns3::Dhcp6Client::Boot(), ns3::Dhcp6Client::SendRebind(), ns3::Dhcp6Client::SendRenew(), and ns3::Dhcp6Client::SendRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddServerIdentifier()

void ns3::Dhcp6Header::AddServerIdentifier ( Duid duid)

Add the server identifier option.

Parameters
duidThe DUID which identifies the server.

Definition at line 135 of file dhcp6-header.cc.

References AddIdentifierOption(), m_serverIdentifier, and ns3::Options::OPTION_SERVERID.

Referenced by ns3::Dhcp6Client::InterfaceConfig::DeclineOffer(), ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Client::SendRenew(), ns3::Dhcp6Server::SendReply(), ns3::Dhcp6Client::SendRequest(), and ns3::Dhcp6Server::UpdateBindings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddSolMaxRt()

void ns3::Dhcp6Header::AddSolMaxRt ( )

Add the SOL_MAX_RT option.

Definition at line 205 of file dhcp6-header.cc.

References AddMessageLength(), m_options, and ns3::Options::OPTION_SOL_MAX_RT.

Referenced by HandleOptionRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddStatusCode()

void ns3::Dhcp6Header::AddStatusCode ( Options::StatusCodeValues statusCode,
std::string statusMsg )

Add the status code option.

Parameters
statusCodethe status code of the operation.
statusMsgthe status message.

Definition at line 358 of file dhcp6-header.cc.

References AddMessageLength(), ns3::Options::GetOptionLength(), ns3::StatusCodeOption::GetStatusMessage(), m_options, m_statusCode, ns3::Options::OPTION_STATUS_CODE, ns3::Options::SetOptionCode(), ns3::Options::SetOptionLength(), ns3::StatusCodeOption::SetStatusCode(), and ns3::StatusCodeOption::SetStatusMessage().

Referenced by ns3::Dhcp6Server::UpdateBindings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Deserialize()

uint32_t ns3::Dhcp6Header::Deserialize ( Buffer::Iterator start)
overrideprivatevirtual
Parameters
startan iterator which points to where the header should read from.
Returns
the number of bytes read.

This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.

Note that data is not actually removed from the buffer to which the iterator points. Both Packet::RemoveHeader() and Packet::PeekHeader() call Deserialize(), but only the RemoveHeader() has additional statements to remove the header bytes from the underlying buffer and associated metadata.

Implements ns3::Header.

Definition at line 475 of file dhcp6-header.cc.

References ns3::RequestOptions::AddRequestedOption(), ns3::Duid::Deserialize(), ns3::Options::GetOptionLength(), ns3::Buffer::Iterator::GetSize(), m_clientIdentifier, m_elapsedTime, ns3::IaOptions::m_iaAddressOption, m_ianaList, m_len, m_msgType, m_optionRequest, m_options, m_serverIdentifier, m_solMaxRt, m_statusCode, m_transactId, ns3::Buffer::Iterator::Next(), NS_LOG_INFO, NS_LOG_WARN, ns3::Options::OPTION_CLIENTID, ns3::Options::OPTION_ELAPSED_TIME, ns3::Options::OPTION_IA_NA, ns3::Options::OPTION_ORO, ns3::Options::OPTION_SERVERID, ns3::Options::OPTION_SOL_MAX_RT, ns3::Options::OPTION_STATUS_CODE, ns3::Buffer::Iterator::Read(), ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadNtohU32(), ns3::IdentifierOption::SetDuid(), ns3::IaAddressOption::SetIaAddress(), ns3::IaOptions::SetIaid(), ns3::Options::SetOptionCode(), ns3::Options::SetOptionLength(), ns3::IntegerOptions< T >::SetOptionValue(), ns3::IaAddressOption::SetPreferredLifetime(), ns3::StatusCodeOption::SetStatusCode(), ns3::StatusCodeOption::SetStatusMessage(), ns3::IaOptions::SetT1(), ns3::IaOptions::SetT2(), and ns3::IaAddressOption::SetValidLifetime().

+ Here is the call graph for this function:

◆ GetClientIdentifier()

IdentifierOption ns3::Dhcp6Header::GetClientIdentifier ( )

Get the client identifier.

Returns
the client identifier option.

Definition at line 90 of file dhcp6-header.cc.

References m_clientIdentifier.

Referenced by ns3::Dhcp6Server::ProcessSolicit(), ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Server::SendReply(), ns3::Dhcp6Server::UpdateBindings(), and ns3::Dhcp6Client::ValidateAdvertise().

+ Here is the caller graph for this function:

◆ GetIanaOptions()

std::vector< IaOptions > ns3::Dhcp6Header::GetIanaOptions ( )

Get the list of IA_NA options.

Returns
the list of IA_NA options.

Definition at line 108 of file dhcp6-header.cc.

References m_ianaList.

Referenced by ns3::Dhcp6Client::ProcessReply(), ns3::Dhcp6Server::ProcessSolicit(), ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Server::SendReply(), ns3::Dhcp6Client::SendRequest(), and ns3::Dhcp6Server::UpdateBindings().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::Dhcp6Header::GetInstanceTypeId ( ) const
overrideprivatevirtual

Get the most derived TypeId for this Object.

This method is provided by ns3::Object::GetInstanceTypeId but classes which derive from ns3::ObjectBase directly have to implement it themselves. Typically, this method should simply return the output of GetTypeId().

Returns
The TypeId associated to the most-derived type of this instance.

Implements ns3::ObjectBase.

Definition at line 84 of file dhcp6-header.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetMessageType()

Dhcp6Header::MessageType ns3::Dhcp6Header::GetMessageType ( ) const

Get the type of message.

Returns
integer corresponding to the message type.

Definition at line 35 of file dhcp6-header.cc.

References m_msgType.

Referenced by ns3::Dhcp6Client::NetHandler(), ns3::Dhcp6Server::NetHandler(), and ns3::Dhcp6Server::UpdateBindings().

+ Here is the caller graph for this function:

◆ GetOptionList()

std::map< Options::OptionType, bool > ns3::Dhcp6Header::GetOptionList ( )

Get list of all options set in the header.

Returns
the list of options.

Definition at line 352 of file dhcp6-header.cc.

References m_options.

Referenced by ns3::Dhcp6Server::ProcessSolicit(), ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), and ns3::Dhcp6Server::SendReply().

+ Here is the caller graph for this function:

◆ GetOptionRequest()

RequestOptions ns3::Dhcp6Header::GetOptionRequest ( )

Get the option request option.

Returns
the option request option.

Definition at line 161 of file dhcp6-header.cc.

References m_optionRequest.

Referenced by ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), and ns3::Dhcp6Server::SendReply().

+ Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::Dhcp6Header::GetSerializedSize ( ) const
overrideprivatevirtual
Returns
the expected size of the header.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.

Implements ns3::Header.

Definition at line 374 of file dhcp6-header.cc.

References m_len.

◆ GetServerIdentifier()

IdentifierOption ns3::Dhcp6Header::GetServerIdentifier ( )

Get the server identifier.

Returns
the server identifier option.

Definition at line 96 of file dhcp6-header.cc.

References m_serverIdentifier.

Referenced by ns3::Dhcp6Client::SendRequest(), and ns3::Dhcp6Client::ValidateAdvertise().

+ Here is the caller graph for this function:

◆ GetStatusCodeOption()

StatusCodeOption ns3::Dhcp6Header::GetStatusCodeOption ( )

Get the status code of the operation.

Returns
the status code option.

Definition at line 102 of file dhcp6-header.cc.

References m_statusCode.

Referenced by ns3::Dhcp6Client::CheckLeaseStatus().

+ Here is the caller graph for this function:

◆ GetTransactId()

uint32_t ns3::Dhcp6Header::GetTransactId ( ) const

Get the transaction ID.

Returns
the 32-bit transaction ID

Definition at line 48 of file dhcp6-header.cc.

References m_transactId.

Referenced by ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Server::SendReply(), ns3::Dhcp6Server::UpdateBindings(), and ns3::Dhcp6Client::ValidateAdvertise().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::Dhcp6Header::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 74 of file dhcp6-header.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleOptionRequest()

void ns3::Dhcp6Header::HandleOptionRequest ( std::vector< Options::OptionType > requestedOptions)

Handle all options requested by client.

Parameters
requestedOptionsthe options requested by the client.

Definition at line 188 of file dhcp6-header.cc.

References AddSolMaxRt(), NS_LOG_WARN, and ns3::Options::OPTION_SOL_MAX_RT.

Referenced by ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), and ns3::Dhcp6Server::SendReply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Print()

void ns3::Dhcp6Header::Print ( std::ostream & os) const
overrideprivatevirtual
Parameters
osoutput stream This method is used by Packet::Print to print the content of a header as ascii data to a c++ output stream. Although the header is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5

Implements ns3::Header.

Definition at line 380 of file dhcp6-header.cc.

References m_msgType.

◆ ResetOptions()

void ns3::Dhcp6Header::ResetOptions ( )

Reset all options.

Definition at line 67 of file dhcp6-header.cc.

References m_len, and m_options.

Referenced by ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Server::SendReply(), ns3::Dhcp6Client::SendRequest(), and ns3::Dhcp6Server::UpdateBindings().

+ Here is the caller graph for this function:

◆ Serialize()

void ns3::Dhcp6Header::Serialize ( Buffer::Iterator start) const
overrideprivatevirtual

◆ SetMessageType()

void ns3::Dhcp6Header::SetMessageType ( MessageType msgType)

Set the message type.

Parameters
msgTypeinteger corresponding to the message type.

Definition at line 41 of file dhcp6-header.cc.

References m_msgType, and NS_LOG_FUNCTION.

Referenced by ns3::Dhcp6Client::Boot(), ns3::Dhcp6Client::InterfaceConfig::DeclineOffer(), ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Client::SendRebind(), ns3::Dhcp6Client::SendRenew(), ns3::Dhcp6Server::SendReply(), ns3::Dhcp6Client::SendRequest(), and ns3::Dhcp6Server::UpdateBindings().

+ Here is the caller graph for this function:

◆ SetTransactId()

void ns3::Dhcp6Header::SetTransactId ( uint32_t transactId)

Set the transaction ID.

Parameters
transactIdA 32-bit transaction ID.

Definition at line 54 of file dhcp6-header.cc.

References m_transactId, and NS_LOG_FUNCTION.

Referenced by ns3::Dhcp6Client::Boot(), ns3::Dhcp6Client::InterfaceConfig::DeclineOffer(), ns3::Dhcp6Server::RenewRebindLeases(), ns3::Dhcp6Server::SendAdvertise(), ns3::Dhcp6Client::SendRebind(), ns3::Dhcp6Client::SendRenew(), ns3::Dhcp6Server::SendReply(), ns3::Dhcp6Client::SendRequest(), and ns3::Dhcp6Server::UpdateBindings().

+ Here is the caller graph for this function:

Member Data Documentation

◆ CLIENT_PORT

const uint16_t ns3::Dhcp6Header::CLIENT_PORT = 546
static

The port number of the DHCPv6 client.

Definition at line 211 of file dhcp6-header.h.

Referenced by ns3::Dhcp6Client::ReceiveMflag().

◆ m_clientIdentifier

IdentifierOption ns3::Dhcp6Header::m_clientIdentifier
private

The client identifier option.

Definition at line 255 of file dhcp6-header.h.

Referenced by AddClientIdentifier(), Deserialize(), GetClientIdentifier(), and Serialize().

◆ m_elapsedTime

ElapsedTimeOption ns3::Dhcp6Header::m_elapsedTime
private

The amount of time since the client began the transaction.

Definition at line 283 of file dhcp6-header.h.

Referenced by AddElapsedTime(), Deserialize(), and Serialize().

◆ m_ianaList

std::vector<IaOptions> ns3::Dhcp6Header::m_ianaList
private

Vector of IA_NA options.

Definition at line 257 of file dhcp6-header.h.

Referenced by AddAddress(), AddIaOption(), Deserialize(), GetIanaOptions(), and Serialize().

◆ m_iataList

std::vector<IaOptions> ns3::Dhcp6Header::m_iataList
private

Vector of IA_TA options.

Definition at line 258 of file dhcp6-header.h.

Referenced by AddAddress(), and AddIaOption().

◆ m_len

uint32_t ns3::Dhcp6Header::m_len
private

The length of the message.

Definition at line 253 of file dhcp6-header.h.

Referenced by AddMessageLength(), Deserialize(), GetSerializedSize(), and ResetOptions().

◆ m_msgType

MessageType ns3::Dhcp6Header::m_msgType
private

The message type.

Definition at line 254 of file dhcp6-header.h.

Referenced by Deserialize(), GetMessageType(), Print(), Serialize(), and SetMessageType().

◆ m_optionRequest

RequestOptions ns3::Dhcp6Header::m_optionRequest
private

List of additional options requested.

Definition at line 277 of file dhcp6-header.h.

Referenced by AddOptionRequest(), Deserialize(), GetOptionRequest(), and Serialize().

◆ m_options

std::map<Options::OptionType, bool> ns3::Dhcp6Header::m_options
private

Options present in the header, indexed by option code.

TODO: Use std::set instead.

Definition at line 271 of file dhcp6-header.h.

Referenced by AddElapsedTime(), AddIaOption(), AddIdentifierOption(), AddOptionRequest(), AddSolMaxRt(), AddStatusCode(), Deserialize(), GetOptionList(), ResetOptions(), and Serialize().

◆ m_preference

PreferenceOption ns3::Dhcp6Header::m_preference
private

The preference value for the server.

Definition at line 280 of file dhcp6-header.h.

◆ m_serverIdentifier

IdentifierOption ns3::Dhcp6Header::m_serverIdentifier
private

The server identifier option.

Definition at line 256 of file dhcp6-header.h.

Referenced by AddServerIdentifier(), Deserialize(), GetServerIdentifier(), and Serialize().

◆ m_solMaxRt

uint32_t ns3::Dhcp6Header::m_solMaxRt
private

Default value for SOL_MAX_RT option.

Definition at line 259 of file dhcp6-header.h.

Referenced by Dhcp6Header(), Deserialize(), and Serialize().

◆ m_statusCode

StatusCodeOption ns3::Dhcp6Header::m_statusCode
private

(optional) The status code of the operation just performed.

Definition at line 274 of file dhcp6-header.h.

Referenced by AddStatusCode(), Deserialize(), GetStatusCodeOption(), and Serialize().

◆ m_transactId

uint32_t ns3::Dhcp6Header::m_transactId
private

The transaction ID calculated by the client or the server.

This is a 24-bit integer.

Definition at line 265 of file dhcp6-header.h.

Referenced by Deserialize(), GetTransactId(), Serialize(), and SetTransactId().

◆ SERVER_PORT


The documentation for this class was generated from the following files: