38 #ifndef LWIP_HDR_PROT_DHCP_H 39 #define LWIP_HDR_PROT_DHCP_H 50 #define DHCP_CHADDR_LEN 16U 51 #define DHCP_SNAME_OFS 44U 52 #define DHCP_SNAME_LEN 64U 53 #define DHCP_FILE_OFS 108U 54 #define DHCP_FILE_LEN 128U 55 #define DHCP_MSG_LEN 236U 56 #define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4U) 58 #ifdef PACK_STRUCT_USE_INCLUDES 59 # include "arch/bpstruct.h" 65 PACK_STRUCT_FLD_8(u8_t op);
66 PACK_STRUCT_FLD_8(u8_t htype);
67 PACK_STRUCT_FLD_8(u8_t hlen);
68 PACK_STRUCT_FLD_8(u8_t hops);
69 PACK_STRUCT_FIELD(u32_t xid);
70 PACK_STRUCT_FIELD(u16_t secs);
71 PACK_STRUCT_FIELD(u16_t flags);
72 PACK_STRUCT_FLD_S(ip4_addr_p_t ciaddr);
73 PACK_STRUCT_FLD_S(ip4_addr_p_t yiaddr);
74 PACK_STRUCT_FLD_S(ip4_addr_p_t siaddr);
75 PACK_STRUCT_FLD_S(ip4_addr_p_t giaddr);
76 PACK_STRUCT_FLD_8(u8_t chaddr[DHCP_CHADDR_LEN]);
77 PACK_STRUCT_FLD_8(u8_t sname[DHCP_SNAME_LEN]);
78 PACK_STRUCT_FLD_8(u8_t file[DHCP_FILE_LEN]);
79 PACK_STRUCT_FIELD(u32_t cookie);
80 #define DHCP_MIN_OPTIONS_LEN 68U 82 #if ((defined(DHCP_OPTIONS_LEN)) && (DHCP_OPTIONS_LEN < DHCP_MIN_OPTIONS_LEN)) 83 # undef DHCP_OPTIONS_LEN 86 #if (!defined(DHCP_OPTIONS_LEN)) 88 # define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN 93 #ifdef PACK_STRUCT_USE_INCLUDES 94 # include "arch/epstruct.h" 101 DHCP_STATE_REQUESTING = 1,
103 DHCP_STATE_REBOOTING = 3,
104 DHCP_STATE_REBINDING = 4,
105 DHCP_STATE_RENEWING = 5,
106 DHCP_STATE_SELECTING = 6,
107 DHCP_STATE_INFORMING = 7,
108 DHCP_STATE_CHECKING = 8,
109 DHCP_STATE_PERMANENT = 9,
110 DHCP_STATE_BOUND = 10,
111 DHCP_STATE_RELEASING = 11,
112 DHCP_STATE_BACKING_OFF = 12
116 #define DHCP_BOOTREQUEST 1 117 #define DHCP_BOOTREPLY 2 120 #define DHCP_DISCOVER 1 122 #define DHCP_REQUEST 3 123 #define DHCP_DECLINE 4 126 #define DHCP_RELEASE 7 127 #define DHCP_INFORM 8 129 #define DHCP_MAGIC_COOKIE 0x63825363UL 134 #define DHCP_OPTION_PAD 0 135 #define DHCP_OPTION_SUBNET_MASK 1 136 #define DHCP_OPTION_ROUTER 3 137 #define DHCP_OPTION_DNS_SERVER 6 138 #define DHCP_OPTION_HOSTNAME 12 139 #define DHCP_OPTION_IP_TTL 23 140 #define DHCP_OPTION_MTU 26 141 #define DHCP_OPTION_BROADCAST 28 142 #define DHCP_OPTION_TCP_TTL 37 143 #define DHCP_OPTION_NTP 42 144 #define DHCP_OPTION_END 255 147 #define DHCP_OPTION_REQUESTED_IP 50 148 #define DHCP_OPTION_LEASE_TIME 51 149 #define DHCP_OPTION_OVERLOAD 52 151 #define DHCP_OPTION_MESSAGE_TYPE 53 152 #define DHCP_OPTION_MESSAGE_TYPE_LEN 1 154 #define DHCP_OPTION_SERVER_ID 54 155 #define DHCP_OPTION_PARAMETER_REQUEST_LIST 55 157 #define DHCP_OPTION_MAX_MSG_SIZE 57 158 #define DHCP_OPTION_MAX_MSG_SIZE_LEN 2 160 #define DHCP_OPTION_T1 58 161 #define DHCP_OPTION_T2 59 162 #define DHCP_OPTION_US 60 163 #define DHCP_OPTION_CLIENT_ID 61 164 #define DHCP_OPTION_TFTP_SERVERNAME 66 165 #define DHCP_OPTION_BOOTFILE 67 168 #define DHCP_OVERLOAD_NONE 0 169 #define DHCP_OVERLOAD_FILE 1 170 #define DHCP_OVERLOAD_SNAME 2 171 #define DHCP_OVERLOAD_SNAME_FILE 3 IPv4 protocol definitions.
lwIP Options Configuration
#define PACK_STRUCT_BEGIN
Packed structs support.
#define PACK_STRUCT_STRUCT
Packed structs support.
#define DHCP_OPTIONS_LEN
make sure user does not configure this too small
#define PACK_STRUCT_END
Packed structs support.
minimum set of fields of any DHCP message
Support for different processor and compiler architectures.