Definitions common to DHCPv6 client, server and relay agent. More...
#include "core/net.h"
#include "dhcpv6/dhcpv6_client.h"
#include "dhcpv6/dhcpv6_relay.h"
#include "dhcpv6/dhcpv6_common.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL DHCPV6_TRACE_LEVEL |
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... | |
Variables | |
const Ipv6Addr | DHCPV6_ALL_RELAY_AGENTS_AND_SERVERS_ADDR |
const Ipv6Addr | DHCPV6_ALL_SERVERS_ADDR |
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.
Description
The Dynamic Host Configuration Protocol for IPv6 enables DHCP servers to pass configuration parameters such as IPv6 network addresses to IPv6 nodes. This protocol is a stateful counterpart to IPv6 Stateless Address Autoconfiguration (RFC 2462), and can be used separately or concurrently with the latter to obtain configuration parameters. Refer to RFC 3315
- Version
- 2.4.4
Definition in file dhcpv6_common.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL DHCPV6_TRACE_LEVEL |
Definition at line 40 of file dhcpv6_common.c.
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
◆ DHCPV6_ALL_RELAY_AGENTS_AND_SERVERS_ADDR
const Ipv6Addr DHCPV6_ALL_RELAY_AGENTS_AND_SERVERS_ADDR |
Definition at line 54 of file dhcpv6_common.c.
◆ DHCPV6_ALL_SERVERS_ADDR
const Ipv6Addr DHCPV6_ALL_SERVERS_ADDR |
Definition at line 58 of file dhcpv6_common.c.