42 using ot::Encoding::BigEndian::HostSwap16;
43 using ot::Encoding::BigEndian::HostSwap32;
65 kDhcpClientPort = 546,
66 kDhcpServerPort = 547,
67 kTransactionIdSize = 3,
68 kLinkLayerAddressLen = 8,
69 kHardwareTypeEui64 = 27,
87 kTypeReconfigure = 10,
88 kTypeInformationRequest = 11,
89 kTypeRelayForward = 12,
92 kTypeLeaseQueryReply = 15,
108 void Init(
void) { mType = 0; mTransactionId[0] = 0; }
144 uint8_t mTransactionId[kTransactionIdSize];
153 kOptionClientIdentifier = 1,
154 kOptionServerIdentifier = 2,
157 kOptionIaAddress = 5,
158 kOptionRequestOption = 6,
159 kOptionPreference = 7,
160 kOptionElapsedTime = 8,
161 kOptionRelayMessage = 9,
162 kOptionAuthentication = 11,
163 kOptionServerUnicast = 12,
164 kOptionStatusCode = 13,
165 kOptionRapidCommit = 14,
166 kOptionUserClass = 15,
167 kOptionVendorClass = 16,
168 kOptionVendorSpecificInformation = 17,
169 kOptionInterfaceId = 18,
170 kOptionReconfigureMessage = 19,
171 kOptionReconfigureAccept = 20,
172 kOptionLeaseQuery = 44,
173 kOptionClientData = 45,
174 kOptionClientLastTransactionTime = 46,
189 void Init(
void) { mCode = 0; mLength = 0; }
205 void SetCode(
Code aCode) { mCode = HostSwap16(static_cast<uint16_t>(aCode)); }
213 uint16_t
GetLength(
void)
const {
return HostSwap16(mLength); }
221 void SetLength(uint16_t aLength) { mLength = HostSwap16(aLength); }
247 void Init(
void) { SetCode(kOptionClientIdentifier); SetLength(
sizeof(*
this) -
sizeof(
Dhcp6Option)); }
279 void SetDuidHardwareType(uint16_t aDuidHardwareType) { mDuidHardwareType = HostSwap16(aDuidHardwareType); }
299 uint16_t mDuidHardwareType;
300 uint8_t mDuidLinkLayerAddress[kLinkLayerAddressLen];
311 void Init(
void) { SetCode(kOptionServerIdentifier); SetLength(
sizeof(*
this) -
sizeof(
Dhcp6Option)); }
343 void SetDuidHardwareType(uint16_t aDuidHardwareType) { mDuidHardwareType = HostSwap16(aDuidHardwareType); }
363 uint16_t mDuidHardwareType;
364 uint8_t mDuidLinkLayerAddress[kLinkLayerAddressLen];
375 void Init(
void) { SetCode(kOptionIaNa); SetLength(
sizeof(*
this) -
sizeof(
Dhcp6Option)); }
383 uint32_t
GetIaid(
void)
const {
return HostSwap32(mIaid); }
391 void SetIaid(uint32_t aIaid) { mIaid = HostSwap32(aIaid); }
399 uint32_t
GetT1(
void)
const {
return HostSwap32(mT1); }
407 void SetT1(uint32_t aT1) { mT1 = HostSwap32(aT1); }
415 uint32_t
GetT2(
void)
const {
return HostSwap32(mT2); }
423 void SetT2(uint32_t aT2) { mT2 = HostSwap32(aT2); }
439 void Init(
void) { SetCode(kOptionIaAddress); SetLength(
sizeof(*
this) -
sizeof(
Dhcp6Option)); }
471 void SetPreferredLifetime(uint32_t aPreferredLifetime) { mPreferredLifetime = HostSwap32(aPreferredLifetime); }
487 void SetValidLifetime(uint32_t aValidLifetime) { mValidLifetime = HostSwap32(aValidLifetime); }
491 uint32_t mPreferredLifetime;
492 uint32_t mValidLifetime;
503 void Init(
void) { SetCode(kOptionElapsedTime); SetLength(
sizeof(*
this) -
sizeof(
Dhcp6Option)); }
519 void SetElapsedTime(uint16_t aElapsedTime) { mElapsedTime = HostSwap16(aElapsedTime); }
522 uint16_t mElapsedTime;
532 kStatusUnspecFail = 1,
533 kStatusNoAddrsAvail = 2,
534 kStatusNoBinding = 3,
535 kStatusNotOnLink = 4,
536 kStatusUseMulticast = 5,
537 kUnknownQueryType = 7,
551 void Init(
void) { SetCode(kOptionStatusCode); SetLength(
sizeof(*
this) -
sizeof(
Dhcp6Option)); }
581 void Init(
void) { SetCode(kOptionRapidCommit); SetLength(
sizeof(*
this) -
sizeof(
Dhcp6Option)); }
Code
DHCPv6 Option Codes.
Definition: dhcp6.hpp:151
void SetT1(uint32_t aT1)
This method sets the value of T1.
Definition: dhcp6.hpp:407
This structure represents an IPv6 address.
Definition: types.h:417
void SetDuidType(DuidType aDuidType)
This method sets the server Duid Type.
Definition: dhcp6.hpp:327
union otIp6Address::OT_TOOL_PACKED_FIELD mFields
IPv6 accessor fields.
void Init(void)
This method initializes the DHCPv6 Option.
Definition: dhcp6.hpp:375
void SetPreferredLifetime(uint32_t aPreferredLifetime)
This method sets the preferred lifetime of the IPv6 address.
Definition: dhcp6.hpp:471
void SetIaid(uint32_t aIaid)
This method sets the client IAID.
Definition: dhcp6.hpp:391
void Init(void)
This method initializes the DHCPv6 Option.
Definition: dhcp6.hpp:247
Type GetType(void) const
This method returns the DHCPv6 message type.
Definition: dhcp6.hpp:116
Type
DHCPv6 Message Types.
Definition: dhcp6.hpp:76
void SetElapsedTime(uint16_t aElapsedTime)
This method sets the elapsed time since solicit starts.
Definition: dhcp6.hpp:519
Definition: dhcp6.hpp:304
uint32_t GetValidLifetime(void) const
This method returns the valid lifetime of the IPv6 address.
Definition: dhcp6.hpp:479
void SetDuidHardwareType(uint16_t aDuidHardwareType)
This method sets the server Duid HardwareType.
Definition: dhcp6.hpp:343
uint32_t GetPreferredLifetime(void) const
This method returns the preferred lifetime of the IPv6 address.
Definition: dhcp6.hpp:463
void SetValidLifetime(uint32_t aValidLifetime)
This method sets the valid lifetime of the IPv6 address.
Definition: dhcp6.hpp:487
DuidType
Duid Type.
Definition: dhcp6.hpp:232
void Init(void)
This method initializes the DHCPv6 Option.
Definition: dhcp6.hpp:581
uint32_t GetT1(void) const
This method returns T1.
Definition: dhcp6.hpp:399
Definition: dhcp6.hpp:240
uint32_t GetIaid(void) const
This method returns client IAID.
Definition: dhcp6.hpp:383
void Init(void)
This method initializes the DHCPv6 header to all zeros.
Definition: dhcp6.hpp:108
void Init(void)
This method initializes the DHCPv6 Option.
Definition: dhcp6.hpp:503
Status GetStatusCode(void) const
This method returns the status code.
Definition: dhcp6.hpp:559
DuidType GetDuidType(void) const
This method returns the client Duid Type.
Definition: dhcp6.hpp:255
This file includes definitions for UDP/IPv6 sockets.
This structure represents an IEEE 802.15.4 Extended Address.
Definition: mac_frame.hpp:84
uint16_t GetElapsedTime(void) const
This method returns the elapsed time since solicit starts.
Definition: dhcp6.hpp:511
void Init(void)
This method initializes the DHCPv6 Option.
Definition: dhcp6.hpp:439
Definition: dhcp6.hpp:544
enum ot::Dhcp6::Code Code
DHCPv6 Option Codes.
uint16_t GetDuidHardwareType(void) const
This method returns the server Duid HardwareType.
Definition: dhcp6.hpp:335
DuidType GetDuidType(void) const
This method returns the server Duid Type.
Definition: dhcp6.hpp:319
Code GetCode(void) const
This method returns the DHCPv6 option code.
Definition: dhcp6.hpp:197
void SetTransactionId(uint8_t *aBuf)
This method sets the DHCPv6 message transaction id.
Definition: dhcp6.hpp:140
void SetAddress(otIp6Address &aAddress)
This method sets the IPv6 address.
Definition: dhcp6.hpp:455
void Init(void)
This method initializes the DHCPv6 Option.
Definition: dhcp6.hpp:551
void SetDuidHardwareType(uint16_t aDuidHardwareType)
This method sets the client Duid HardwareType.
Definition: dhcp6.hpp:279
This file includes definitions for the message buffer pool and message buffers.
void SetDuidType(DuidType aDuidType)
This method sets the client Duid Type.
Definition: dhcp6.hpp:263
uint8_t * GetDuidLinkLayerAddress(void)
This method returns the client LinkLayerAddress.
Definition: dhcp6.hpp:287
uint32_t GetT2(void) const
This method returns T2.
Definition: dhcp6.hpp:415
uint8_t * GetDuidLinkLayerAddress(void)
This method returns the server LinkLayerAddress.
Definition: dhcp6.hpp:351
void SetDuidLinkLayerAddress(const Mac::ExtAddress *aDuidLinkLayerAddress)
This method sets the server LinkLayerAddress.
Definition: dhcp6.hpp:359
void SetDuidLinkLayerAddress(const Mac::ExtAddress *aDuidLinkLayerAddress)
This method sets the client LinkLayerAddress.
Definition: dhcp6.hpp:295
void SetStatusCode(Status aStatus)
This method sets the status code.
Definition: dhcp6.hpp:567
Definition: dhcp6.hpp:368
enum ot::Dhcp6::DuidType DuidType
Duid Type.
uint16_t GetLength(void) const
This method returns the Length of DHCPv6 option.
Definition: dhcp6.hpp:213
otIp6Address * GetAddress(void)
This method returns the pointer to the IPv6 address.
Definition: dhcp6.hpp:447
Definition: dhcp6.hpp:432
void SetT2(uint32_t aT2)
This method sets the value of T2.
Definition: dhcp6.hpp:423
void Init(void)
This method initializes the DHCPv6 option to all zeros.
Definition: dhcp6.hpp:189
Definition: dhcp6.hpp:574
Definition: dhcp6.hpp:496
uint8_t * GetTransactionId(void)
This method returns the DHCPv6 message transaction id.
Definition: dhcp6.hpp:132
enum ot::Dhcp6::Status Status
Status Code.
void SetLength(uint16_t aLength)
This method sets the length of DHCPv6 option.
Definition: dhcp6.hpp:221
void SetType(Type aType)
This method sets the DHCPv6 message type.
Definition: dhcp6.hpp:124
uint16_t GetDuidHardwareType(void) const
This method returns the client Duid HardwareType.
Definition: dhcp6.hpp:271
void SetCode(Code aCode)
This method sets the DHCPv6 option code.
Definition: dhcp6.hpp:205
Status
Status Code.
Definition: dhcp6.hpp:529
enum ot::Dhcp6::Type Type
DHCPv6 Message Types.
This file includes compile-time configuration constants for OpenThread.
void Init(void)
This method initializes the DHCPv6 Option.
Definition: dhcp6.hpp:311
This class implements DHCPv6 option.
Definition: dhcp6.hpp:182