Definitions common to DHCPv6 client, server and relay agent. More...
Go to the source code of this file.
Macros | |
#define | DHCPV6_CLIENT_PORT 546 |
#define | DHCPV6_SERVER_PORT 547 |
#define | DHCPV6_MAX_MSG_SIZE 1232 |
#define | DHCPV6_MAX_DUID_SIZE 130 |
#define | DHCPV6_HOP_COUNT_LIMIT 8 |
#define | DHCPV6_MAX_SERVER_PREFERENCE 255 |
#define | DHCPV6_INFINITE_TIME 0xFFFFFFFF |
Functions | |
Dhcpv6StatusCode | dhcpv6GetStatusCode (const uint8_t *options, size_t length) |
Retrieve status code. More... | |
Dhcpv6Option * | dhcpv6AddOption (void *message, size_t *messageLen, uint16_t optionCode, const void *optionValue, size_t optionLen) |
Add an option to a DHCPv6 message. More... | |
Dhcpv6Option * | dhcpv6AddSubOption (Dhcpv6Option *baseOption, size_t *messageLen, uint16_t optionCode, const void *optionValue, size_t optionLen) |
Add a suboption under an existing base option. More... | |
Dhcpv6Option * | dhcpv6GetOption (const uint8_t *options, size_t optionsLength, uint16_t optionCode) |
Search a DHCPv6 message for a given option. More... | |
Detailed Description
Definitions common to DHCPv6 client, server and relay agent.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file dhcpv6_common.h.
Macro Definition Documentation
◆ DHCPV6_CLIENT_PORT
#define DHCPV6_CLIENT_PORT 546 |
Definition at line 40 of file dhcpv6_common.h.
◆ DHCPV6_HOP_COUNT_LIMIT
#define DHCPV6_HOP_COUNT_LIMIT 8 |
Definition at line 49 of file dhcpv6_common.h.
◆ DHCPV6_INFINITE_TIME
#define DHCPV6_INFINITE_TIME 0xFFFFFFFF |
Definition at line 53 of file dhcpv6_common.h.
◆ DHCPV6_MAX_DUID_SIZE
#define DHCPV6_MAX_DUID_SIZE 130 |
Definition at line 46 of file dhcpv6_common.h.
◆ DHCPV6_MAX_MSG_SIZE
#define DHCPV6_MAX_MSG_SIZE 1232 |
Definition at line 44 of file dhcpv6_common.h.
◆ DHCPV6_MAX_SERVER_PREFERENCE
#define DHCPV6_MAX_SERVER_PREFERENCE 255 |
Definition at line 51 of file dhcpv6_common.h.
◆ DHCPV6_SERVER_PORT
#define DHCPV6_SERVER_PORT 547 |
Definition at line 41 of file dhcpv6_common.h.
Enumeration Type Documentation
◆ Dhcpv6DuidType
enum Dhcpv6DuidType |
DUID types.
Enumerator | |
---|---|
DHCPV6_DUID_LLT | |
DHCPV6_DUID_EN | |
DHCPV6_DUID_LL |
Definition at line 65 of file dhcpv6_common.h.
◆ Dhcpv6HardwareType
enum Dhcpv6HardwareType |
Hardware types.
Enumerator | |
---|---|
DHCPV6_HARDWARE_TYPE_ETH | |
DHCPV6_HARDWARE_TYPE_EUI64 |
Definition at line 77 of file dhcpv6_common.h.
◆ Dhcpv6MessageType
enum Dhcpv6MessageType |
DHCPv6 message types.
Definition at line 88 of file dhcpv6_common.h.
◆ Dhcpv6OptionCode
enum Dhcpv6OptionCode |
DHCPv6 option codes.
Definition at line 110 of file dhcpv6_common.h.
◆ Dhcpv6StatusCode
enum Dhcpv6StatusCode |
Status code.
Enumerator | |
---|---|
DHCPV6_STATUS_SUCCESS | |
DHCPV6_STATUS_UNSPEC_FAILURE | |
DHCPV6_STATUS_NO_ADDRS_AVAILABLE | |
DHCPV6_STATUS_NO_BINDING | |
DHCPV6_STATUS_NOT_ON_LINK | |
DHCPV6_STATUS_USE_MULTICAST |
Definition at line 145 of file dhcpv6_common.h.
Function Documentation
◆ dhcpv6AddOption()
Dhcpv6Option* dhcpv6AddOption | ( | void * | message, |
size_t * | messageLen, | ||
uint16_t | optionCode, | ||
const void * | optionValue, | ||
size_t | optionLen | ||
) |
Add an option to a DHCPv6 message.
- Parameters
-
[in] message Pointer to the DHCPv6 message [in,out] messageLen Actual length of the DHCPv6 message [in] optionCode Option code [in] optionValue Option value [in] optionLen Length of the option value
- Returns
- If the option was successfully added, a pointer to the freshly created option is returned. Otherwise NULL pointer is returned
Definition at line 114 of file dhcpv6_common.c.
◆ dhcpv6AddSubOption()
Dhcpv6Option* dhcpv6AddSubOption | ( | Dhcpv6Option * | baseOption, |
size_t * | messageLen, | ||
uint16_t | optionCode, | ||
const void * | optionValue, | ||
size_t | optionLen | ||
) |
Add a suboption under an existing base option.
- Parameters
-
[in] baseOption Pointer to the base option [in,out] messageLen Length of the overall DHCPv6 message [in] optionCode Option code [in] optionValue Option value [in] optionLen Length of the option value
- Returns
- If the option was successfully added, a pointer to the freshly created option is returned. Otherwise NULL pointer is returned
Definition at line 168 of file dhcpv6_common.c.
◆ dhcpv6GetOption()
Dhcpv6Option* dhcpv6GetOption | ( | const uint8_t * | options, |
size_t | optionsLength, | ||
uint16_t | optionCode | ||
) |
Search a DHCPv6 message for a given option.
- Parameters
-
[in] options Pointer to the Options field [in] optionsLength Length of the Options field [in] optionCode Code of the option to find
- Returns
- If the specified option was found, a pointer to the corresponding option is returned. Otherwise NULL pointer is returned
Definition at line 229 of file dhcpv6_common.c.
◆ dhcpv6GetStatusCode()
Dhcpv6StatusCode dhcpv6GetStatusCode | ( | const uint8_t * | options, |
size_t | length | ||
) |
Retrieve status code.
This function returns a status indication related to the DHCPv6 message or option in which it appears
- Parameters
-
[in] options Pointer to the Options field [in] length Length of the Options field
- Returns
- Status code
Definition at line 73 of file dhcpv6_common.c.
Variable Documentation
◆ __packed_struct
typedef __packed_struct |
DUID-LLT structure.
Fully Qualified Domain Name option.
IA_PD Prefix option.
Identity Association for Prefix Delegation Option.
Domain Search List option.
DNS Recursive Name Server option.
Reconfigure Message option.
Status Code option.
Server Unicast option.
Authentication option.
Elapsed Time option.
Preference option.
Option Request option.
IA Address option.
Identity Association for Temporary Addresses option.
Identity Association for Non-temporary Addresses option.
DHCPv6 option.
DHCPv6 relay agent message.
DHCPv6 message.
DUID-LL structure.
DUID-EN structure.
Definition at line 168 of file dhcpv6_common.h.
◆ algorithm
uint8_t algorithm |
Definition at line 317 of file dhcpv6_common.h.
◆ authInfo
uint8_t authInfo[] |
Definition at line 320 of file dhcpv6_common.h.
◆ DHCPV6_ALL_RELAY_AGENTS_AND_SERVERS_ADDR
|
extern |
Definition at line 54 of file dhcpv6_common.c.
◆ DHCPV6_ALL_SERVERS_ADDR
|
extern |
Definition at line 58 of file dhcpv6_common.c.
◆ Dhcpv6AuthOption
Dhcpv6AuthOption |
Definition at line 321 of file dhcpv6_common.h.
◆ Dhcpv6DnsServersOption
Dhcpv6DnsServersOption |
Definition at line 362 of file dhcpv6_common.h.
◆ Dhcpv6DomainListOption
Dhcpv6DomainListOption |
Definition at line 372 of file dhcpv6_common.h.
◆ Dhcpv6DuidEn
Dhcpv6DuidEn |
Definition at line 186 of file dhcpv6_common.h.
◆ Dhcpv6DuidLl
Dhcpv6DuidLl |
Definition at line 202 of file dhcpv6_common.h.
◆ Dhcpv6DuidLlt
Dhcpv6DuidLlt |
Definition at line 174 of file dhcpv6_common.h.
◆ Dhcpv6ElapsedTimeOption
Dhcpv6ElapsedTimeOption |
Definition at line 307 of file dhcpv6_common.h.
◆ Dhcpv6FqdnOption
Dhcpv6FqdnOption |
Definition at line 420 of file dhcpv6_common.h.
◆ Dhcpv6IaAddrOption
Dhcpv6IaAddrOption |
Definition at line 277 of file dhcpv6_common.h.
◆ Dhcpv6IaNaOption
Dhcpv6IaNaOption |
Definition at line 253 of file dhcpv6_common.h.
◆ Dhcpv6IaPdOption
Dhcpv6IaPdOption |
Definition at line 385 of file dhcpv6_common.h.
◆ Dhcpv6IaPrefixOption
Dhcpv6IaPrefixOption |
Definition at line 399 of file dhcpv6_common.h.
◆ Dhcpv6IaTaOption
Dhcpv6IaTaOption |
Definition at line 264 of file dhcpv6_common.h.
◆ Dhcpv6Message
Dhcpv6Message |
Definition at line 214 of file dhcpv6_common.h.
◆ Dhcpv6Option
Dhcpv6Option |
Definition at line 240 of file dhcpv6_common.h.
◆ Dhcpv6OroOption
Dhcpv6OroOption |
Definition at line 287 of file dhcpv6_common.h.
◆ Dhcpv6PreferenceOption
Dhcpv6PreferenceOption |
Definition at line 297 of file dhcpv6_common.h.
◆ Dhcpv6ReconfMessageOption
Dhcpv6ReconfMessageOption |
Definition at line 352 of file dhcpv6_common.h.
◆ Dhcpv6RelayMessage
Dhcpv6RelayMessage |
Definition at line 228 of file dhcpv6_common.h.
◆ Dhcpv6ServerUnicastOption
Dhcpv6ServerUnicastOption |
Definition at line 331 of file dhcpv6_common.h.
◆ Dhcpv6StatusCodeOption
Dhcpv6StatusCodeOption |
Definition at line 342 of file dhcpv6_common.h.
◆ domainName
uint8_t domainName[] |
Definition at line 419 of file dhcpv6_common.h.
◆ enterpriseNumber
uint32_t enterpriseNumber |
Definition at line 184 of file dhcpv6_common.h.
◆ hardwareType
uint16_t hardwareType |
Definition at line 171 of file dhcpv6_common.h.
◆ hopCount
uint8_t hopCount |
Definition at line 224 of file dhcpv6_common.h.
◆ identifier
uint8_t identifier |
Definition at line 185 of file dhcpv6_common.h.
◆ length
uint16_t length |
Definition at line 238 of file dhcpv6_common.h.
◆ linkAddress
Ipv6Addr linkAddress |
Definition at line 225 of file dhcpv6_common.h.
◆ linkLayerAddr
MacAddr linkLayerAddr |
Definition at line 173 of file dhcpv6_common.h.
◆ mbz
uint8_t mbz |
Definition at line 417 of file dhcpv6_common.h.
◆ n
uint8_t n |
Definition at line 416 of file dhcpv6_common.h.
◆ o
uint8_t o |
Definition at line 415 of file dhcpv6_common.h.
◆ options
uint8_t options[] |
Definition at line 213 of file dhcpv6_common.h.
◆ peerAddress
Ipv6Addr peerAddress |
Definition at line 226 of file dhcpv6_common.h.
◆ preferredLifetime
uint32_t preferredLifetime |
Definition at line 274 of file dhcpv6_common.h.
◆ prefix
Ipv6Addr prefix |
Definition at line 397 of file dhcpv6_common.h.
◆ prefixLen
uint8_t prefixLen |
Definition at line 396 of file dhcpv6_common.h.
◆ rdm
uint8_t rdm |
Definition at line 318 of file dhcpv6_common.h.
◆ replayDetection
uint8_t replayDetection[8] |
Definition at line 319 of file dhcpv6_common.h.
◆ statusMessage
char_t statusMessage[] |
Definition at line 341 of file dhcpv6_common.h.
◆ t1
uint32_t t1 |
Definition at line 250 of file dhcpv6_common.h.
◆ t2
uint32_t t2 |
Definition at line 251 of file dhcpv6_common.h.
◆ time
uint32_t time |
Definition at line 172 of file dhcpv6_common.h.
◆ transactionId
uint8_t transactionId[3] |
Definition at line 212 of file dhcpv6_common.h.
◆ validLifetime
uint16_t validLifetime |
Definition at line 275 of file dhcpv6_common.h.
◆ value
uint8_t value[] |
Definition at line 239 of file dhcpv6_common.h.