Go to the documentation of this file.
32 #define TRACE_LEVEL DHCP_TRACE_LEVEL
42 #if (IPV4_SUPPORT == ENABLED && (DHCP_CLIENT_SUPPORT == ENABLED || \
43 DHCP_SERVER_SUPPORT == ENABLED))
57 uint8_t optionCode,
const void *optionValue,
size_t optionLen)
63 if(
message == NULL || messageLen == NULL)
67 if(*messageLen < (
sizeof(
DhcpMessage) +
sizeof(uint8_t)))
71 if(optionLen > 0 && optionValue == NULL)
74 if(optionLen > UINT8_MAX)
89 option->code = optionCode;
91 option->length = (uint8_t) optionLen;
93 osMemcpy(option->value, optionValue, optionLen);
131 for(i = 0; i <
length; i++)
163 if(option->code == optionCode)
169 i += option->length + 1;
DHCP client (Dynamic Host Configuration Protocol)
#define DHCP_MAX_MSG_SIZE
error_t dhcpAddOption(DhcpMessage *message, size_t *messageLen, uint8_t optionCode, const void *optionValue, size_t optionLen)
Append an option to a DHCP message.
@ ERROR_INVALID_PARAMETER
Invalid parameter.
#define osMemcpy(dest, src, length)
Definitions common to DHCP client and server.
DHCP server (Dynamic Host Configuration Protocol)
DhcpOption * dhcpGetOption(const DhcpMessage *message, size_t length, uint8_t optionCode)
Search a DHCP message for a given option.