Skip to content

Commit

Permalink
dhcp: Add hook for appending extra client's request options
Browse files Browse the repository at this point in the history
Co-Authored-By: Liu Han <liuhan@espressif.com> (ae7edc2a)
Ref IDF-4817
  • Loading branch information
david-cermak committed Mar 29, 2022
1 parent 632ac61 commit f978e87
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/ipv4/dhcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
#define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset) do { LWIP_UNUSED_ARG(msg); } while(0)
#endif

/** LWIP_HOOK_DHCP_EXTRA_REQUEST_OPTIONS: Additional options added to the list of options
* that the client requests from the servers (opt 55: DHCP_OPTION_PARAMETER_REQUEST_LIST)
*/
#ifndef LWIP_HOOK_DHCP_EXTRA_REQUEST_OPTIONS
#define LWIP_HOOK_DHCP_EXTRA_REQUEST_OPTIONS
#endif

#ifndef DHCP_DEFINE_CUSTOM_TIMEOUTS
static inline u32_t timeout_from_offered(u32_t lease, u32_t min, u32_t max)
{
Expand Down Expand Up @@ -197,6 +204,7 @@ static u8_t dhcp_discover_request_options[] = {
#if LWIP_DHCP_GET_NTP_SRV
, DHCP_OPTION_NTP
#endif /* LWIP_DHCP_GET_NTP_SRV */
LWIP_HOOK_DHCP_EXTRA_REQUEST_OPTIONS
};

#ifdef DHCP_GLOBAL_XID
Expand Down

0 comments on commit f978e87

Please sign in to comment.