Go to the documentation of this file.
40 #define TRACE_LEVEL DHCPV6_TRACE_LEVEL
50 #if (IPV6_SUPPORT == ENABLED && (DHCPV6_CLIENT_SUPPORT == ENABLED || \
51 DHCPV6_RELAY_SUPPORT == ENABLED))
55 IPV6_ADDR(0xFF02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002);
59 IPV6_ADDR(0xFF05, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0003);
89 statusCode =
ntohs(statusCodeOption->statusCode);
115 uint16_t optionCode,
const void *optionValue,
size_t optionLen)
120 if(
message == NULL || messageLen == NULL)
128 if(optionLen > 0 && optionValue == NULL)
131 if(optionLen > UINT16_MAX)
143 option->code =
htons(optionCode);
144 option->length =
htons(optionLen);
147 osMemcpy(option->value, optionValue, optionLen);
169 uint16_t optionCode,
const void *optionValue,
size_t optionLen)
175 if(baseOption == NULL)
183 if(optionLen > 0 && optionValue == NULL)
186 if(optionLen > UINT16_MAX)
195 n =
ntohs(baseOption->length);
201 option->code =
htons(optionCode);
202 option->length =
htons(optionLen);
205 osMemcpy(option->value, optionValue, optionLen);
210 baseOption->length =
htons(
n);
230 size_t optionsLength, uint16_t optionCode)
236 for(i = 0; i < optionsLength; )
250 if(
ntohs(option->code) == optionCode)
DHCPv6 relay agent (Dynamic Host Configuration Protocol for IPv6)
#define IPV6_ADDR(a, b, c, d, e, f, g, h)
Definitions common to DHCPv6 client, server and relay agent.
const Ipv6Addr DHCPV6_ALL_RELAY_AGENTS_AND_SERVERS_ADDR
Dhcpv6Option * dhcpv6AddSubOption(Dhcpv6Option *baseOption, size_t *messageLen, uint16_t optionCode, const void *optionValue, size_t optionLen)
Add a suboption under an existing base option.
Dhcpv6Option * dhcpv6GetOption(const uint8_t *options, size_t optionsLength, uint16_t optionCode)
Search a DHCPv6 message for a given option.
#define DHCPV6_MAX_MSG_SIZE
#define osMemcpy(dest, src, length)
Dhcpv6StatusCode dhcpv6GetStatusCode(const uint8_t *options, size_t length)
Retrieve status code.
DHCPv6 client (Dynamic Host Configuration Protocol for IPv6)
const Ipv6Addr DHCPV6_ALL_SERVERS_ADDR
Dhcpv6StatusCode
Status code.
Dhcpv6Option * dhcpv6AddOption(void *message, size_t *messageLen, uint16_t optionCode, const void *optionValue, size_t optionLen)
Add an option to a DHCPv6 message.