Go to the documentation of this file.
40 #define TRACE_LEVEL DHCPV6_TRACE_LEVEL
48 #if (IPV6_SUPPORT == ENABLED)
52 IPV6_ADDR(0xFF02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002);
56 IPV6_ADDR(0xFF05, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0003);
112 uint16_t optionCode,
const void *optionValue,
size_t optionLen)
117 if(
message == NULL || messageLen == NULL)
125 if(optionLen > 0 && optionValue == NULL)
128 if(optionLen > UINT16_MAX)
140 option->code =
htons(optionCode);
141 option->length =
htons(optionLen);
144 osMemcpy(option->value, optionValue, optionLen);
166 uint16_t optionCode,
const void *optionValue,
size_t optionLen)
172 if(baseOption == NULL)
180 if(optionLen > 0 && optionValue == NULL)
183 if(optionLen > UINT16_MAX)
192 n =
ntohs(baseOption->length);
198 option->code =
htons(optionCode);
199 option->length =
htons(optionLen);
202 osMemcpy(option->value, optionValue, optionLen);
207 baseOption->length =
htons(
n);
227 size_t optionsLength, uint16_t optionCode)
233 for(i = 0; i < optionsLength; )
247 if(
ntohs(option->code) == optionCode)
__start_packed struct @3 Dhcpv6Message
DHCPv6 message.
#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.
const Ipv6Addr DHCPV6_ALL_SERVERS_ADDR
Dhcpv6StatusCode
Status code.
__start_packed struct @14 Dhcpv6StatusCodeOption
Status Code option.
__start_packed struct @5 Dhcpv6Option
DHCPv6 option.
Dhcpv6Option * dhcpv6AddOption(void *message, size_t *messageLen, uint16_t optionCode, const void *optionValue, size_t optionLen)
Add an option to a DHCPv6 message.
__start_packed struct @0 Ipv6Addr
IPv6 network address.