mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-29 00:32:51 +00:00
dhcp: covert DHCP_OPTION_IDX_* from defines to enum (mainly to ease offset calculation)
This commit is contained in:
parent
cd5dfa2bc5
commit
53b9f2a5bd
@ -108,21 +108,23 @@
|
||||
* This might be moved into the struct dhcp (not necessarily since
|
||||
* lwIP is single-threaded and the array is only used while in recv
|
||||
* callback). */
|
||||
#define DHCP_OPTION_IDX_OVERLOAD 0
|
||||
#define DHCP_OPTION_IDX_MSG_TYPE 1
|
||||
#define DHCP_OPTION_IDX_SERVER_ID 2
|
||||
#define DHCP_OPTION_IDX_LEASE_TIME 3
|
||||
#define DHCP_OPTION_IDX_T1 4
|
||||
#define DHCP_OPTION_IDX_T2 5
|
||||
#define DHCP_OPTION_IDX_SUBNET_MASK 6
|
||||
#define DHCP_OPTION_IDX_ROUTER 7
|
||||
#define DHCP_OPTION_IDX_DNS_SERVER 8
|
||||
enum dhcp_option_idx {
|
||||
DHCP_OPTION_IDX_OVERLOAD = 0,
|
||||
DHCP_OPTION_IDX_MSG_TYPE,
|
||||
DHCP_OPTION_IDX_SERVER_ID,
|
||||
DHCP_OPTION_IDX_LEASE_TIME,
|
||||
DHCP_OPTION_IDX_T1,
|
||||
DHCP_OPTION_IDX_T2,
|
||||
DHCP_OPTION_IDX_SUBNET_MASK,
|
||||
DHCP_OPTION_IDX_ROUTER,
|
||||
DHCP_OPTION_IDX_DNS_SERVER,
|
||||
DHCP_OPTION_IDX_DNS_SERVER_LAST = DHCP_OPTION_IDX_DNS_SERVER + DNS_MAX_SERVERS - 1,
|
||||
#if LWIP_DHCP_GET_NTP_SRV
|
||||
#define DHCP_OPTION_IDX_NTP_SERVER (DHCP_OPTION_IDX_DNS_SERVER + DNS_MAX_SERVERS)
|
||||
#define DHCP_OPTION_IDX_MAX (DHCP_OPTION_IDX_NTP_SERVER + LWIP_DHCP_MAX_NTP_SERVERS)
|
||||
#else /* LWIP_DHCP_GET_NTP_SRV */
|
||||
#define DHCP_OPTION_IDX_MAX (DHCP_OPTION_IDX_DNS_SERVER + DNS_MAX_SERVERS)
|
||||
DHCP_OPTION_IDX_NTP_SERVER,
|
||||
DHCP_OPTION_IDX_NTP_SERVER_LAST = DHCP_OPTION_IDX_NTP_SERVER + LWIP_DHCP_MAX_NTP_SERVERS - 1,
|
||||
#endif /* LWIP_DHCP_GET_NTP_SRV */
|
||||
DHCP_OPTION_IDX_MAX
|
||||
};
|
||||
|
||||
/** Holds the decoded option values, only valid while in dhcp_recv.
|
||||
@todo: move this into struct dhcp? */
|
||||
|
Loading…
x
Reference in New Issue
Block a user