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

Implements the functionality of DHCPv6 options. More...

#include "dhcp6-options.h"

+ Inheritance diagram for ns3::Options:
+ Collaboration diagram for ns3::Options:

Public Types

enum class  OptionType {
  OPTION_INIT = 0 , OPTION_CLIENTID = 1 , OPTION_SERVERID = 2 , OPTION_IA_NA = 3 ,
  OPTION_IA_TA = 4 , OPTION_IAADDR = 5 , OPTION_ORO = 6 , OPTION_PREFERENCE = 7 ,
  OPTION_ELAPSED_TIME = 8 , OPTION_RELAY_MSG = 9 , OPTION_AUTH = 11 , OPTION_UNICAST = 12 ,
  OPTION_STATUS_CODE = 13 , OPTION_RAPID_COMMIT = 14 , OPTION_USER_CLASS = 15 , OPTION_VENDOR_CLASS = 16 ,
  OPTION_VENDOR_OPTS = 17 , OPTION_INTERFACE_ID = 18 , OPTION_RECONF_MSG = 19 , OPTION_RECONF_ACCEPT = 20 ,
  OPTION_IA_PD = 25 , OPTION_IAPREFIX = 26 , OPTION_INFORMATION_REFRESH_TIME = 32 , OPTION_SOL_MAX_RT = 82 ,
  OPTION_INF_MAX_RT = 83
}
 Enum to identify the option type. More...
 
enum class  StatusCodeValues {
  Success = 0 , UnspecFail = 1 , NoAddrsAvail = 2 , NoBinding = 3 ,
  NotOnLink = 4 , UseMulticast = 5 , NoPrefixAvail = 6
}
 Enum to identify the status code of the operation. More...
 

Public Member Functions

 Options ()
 Default constructor.
 
 Options (OptionType code, uint16_t length)
 Constructor.
 
OptionType GetOptionCode () const
 Get the option code.
 
uint16_t GetOptionLength () const
 Get the option length.
 
void SetOptionCode (OptionType code)
 Set the option code.
 
void SetOptionLength (uint16_t length)
 Set the option length.
 

Private Attributes

OptionType m_optionCode
 Option code.
 
uint16_t m_optionLength
 Option length.
 

Detailed Description

Implements the functionality of DHCPv6 options.

Definition at line 33 of file dhcp6-options.h.

Member Enumeration Documentation

◆ OptionType

enum class ns3::Options::OptionType
strong

Enum to identify the option type.

These symbols and values are defined in [RFC 8415, section 21] (https://datatracker.ietf.org/doc/html/rfc8415#section-21)

Enumerator
OPTION_INIT 
OPTION_CLIENTID 
OPTION_SERVERID 
OPTION_IA_NA 
OPTION_IA_TA 
OPTION_IAADDR 
OPTION_ORO 
OPTION_PREFERENCE 
OPTION_ELAPSED_TIME 
OPTION_RELAY_MSG 
OPTION_AUTH 
OPTION_UNICAST 
OPTION_STATUS_CODE 
OPTION_RAPID_COMMIT 
OPTION_USER_CLASS 
OPTION_VENDOR_CLASS 
OPTION_VENDOR_OPTS 
OPTION_INTERFACE_ID 
OPTION_RECONF_MSG 
OPTION_RECONF_ACCEPT 
OPTION_IA_PD 
OPTION_IAPREFIX 
OPTION_INFORMATION_REFRESH_TIME 
OPTION_SOL_MAX_RT 
OPTION_INF_MAX_RT 

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

◆ StatusCodeValues

enum class ns3::Options::StatusCodeValues
strong

Enum to identify the status code of the operation.

These symbols and values are defined in RFC 8415, section 21.13

Enumerator
Success 
UnspecFail 
NoAddrsAvail 
NoBinding 
NotOnLink 
UseMulticast 
NoPrefixAvail 

Definition at line 41 of file dhcp6-options.h.

Constructor & Destructor Documentation

◆ Options() [1/2]

ns3::Options::Options ( )

Default constructor.

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

References m_optionCode, m_optionLength, and OPTION_INIT.

◆ Options() [2/2]

ns3::Options::Options ( OptionType code,
uint16_t length )

Constructor.

Parameters
codeThe option code.
lengthThe option length.

Definition at line 32 of file dhcp6-options.cc.

References m_optionCode, m_optionLength, and NS_LOG_FUNCTION.

Member Function Documentation

◆ GetOptionCode()

Options::OptionType ns3::Options::GetOptionCode ( ) const

Get the option code.

Returns
option code

Definition at line 40 of file dhcp6-options.cc.

References m_optionCode.

Referenced by ns3::Dhcp6Header::Serialize().

+ Here is the caller graph for this function:

◆ GetOptionLength()

uint16_t ns3::Options::GetOptionLength ( ) const

Get the option length.

Returns
option length

Definition at line 53 of file dhcp6-options.cc.

References m_optionLength.

Referenced by ns3::Dhcp6Header::AddOptionRequest(), ns3::Dhcp6Header::AddStatusCode(), ns3::Dhcp6Header::Deserialize(), and ns3::Dhcp6Header::Serialize().

+ Here is the caller graph for this function:

◆ SetOptionCode()

void ns3::Options::SetOptionCode ( OptionType code)

Set the option code.

Parameters
codeThe option code to be added.

Definition at line 46 of file dhcp6-options.cc.

References m_optionCode, and NS_LOG_FUNCTION.

Referenced by ns3::Dhcp6Header::AddAddress(), ns3::Dhcp6Header::AddElapsedTime(), ns3::Dhcp6Header::AddIaOption(), ns3::Dhcp6Header::AddIdentifierOption(), ns3::Dhcp6Header::AddOptionRequest(), ns3::Dhcp6Header::AddStatusCode(), and ns3::Dhcp6Header::Deserialize().

+ Here is the caller graph for this function:

◆ SetOptionLength()

void ns3::Options::SetOptionLength ( uint16_t length)

Set the option length.

Parameters
lengthThe option length to be parsed.

Definition at line 59 of file dhcp6-options.cc.

References m_optionLength, and NS_LOG_FUNCTION.

Referenced by ns3::Dhcp6Header::AddAddress(), ns3::Dhcp6Header::AddElapsedTime(), ns3::Dhcp6Header::AddIaOption(), ns3::Dhcp6Header::AddIdentifierOption(), ns3::Dhcp6Header::AddOptionRequest(), ns3::Dhcp6Header::AddStatusCode(), and ns3::Dhcp6Header::Deserialize().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_optionCode

OptionType ns3::Options::m_optionCode
private

Option code.

Definition at line 123 of file dhcp6-options.h.

Referenced by Options(), Options(), GetOptionCode(), and SetOptionCode().

◆ m_optionLength

uint16_t ns3::Options::m_optionLength
private

Option length.

Definition at line 124 of file dhcp6-options.h.

Referenced by Options(), Options(), GetOptionLength(), and SetOptionLength().


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