57 #ifndef LWIP_HDR_PROT_DHCP_H 58 #define LWIP_HDR_PROT_DHCP_H 66 #define DHCP_CLIENT_PORT 68 67 #define DHCP_SERVER_PORT 67 71 #define DHCP_CHADDR_LEN 16U 72 #define DHCP_SNAME_OFS 44U 73 #define DHCP_SNAME_LEN 64U 74 #define DHCP_FILE_OFS 108U 75 #define DHCP_FILE_LEN 128U 76 #define DHCP_MSG_LEN 236U 77 #define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4U) 79 #ifdef PACK_STRUCT_USE_INCLUDES 80 # include "arch/bpstruct.h" 86 PACK_STRUCT_FLD_8(u8_t op);
87 PACK_STRUCT_FLD_8(u8_t htype);
88 PACK_STRUCT_FLD_8(u8_t hlen);
89 PACK_STRUCT_FLD_8(u8_t hops);
90 PACK_STRUCT_FIELD(u32_t xid);
91 PACK_STRUCT_FIELD(u16_t secs);
92 PACK_STRUCT_FIELD(u16_t flags);
93 PACK_STRUCT_FLD_S(ip4_addr_p_t ciaddr);
94 PACK_STRUCT_FLD_S(ip4_addr_p_t yiaddr);
95 PACK_STRUCT_FLD_S(ip4_addr_p_t siaddr);
96 PACK_STRUCT_FLD_S(ip4_addr_p_t giaddr);
97 PACK_STRUCT_FLD_8(u8_t chaddr[DHCP_CHADDR_LEN]);
98 PACK_STRUCT_FLD_8(u8_t sname[DHCP_SNAME_LEN]);
99 PACK_STRUCT_FLD_8(u8_t file[DHCP_FILE_LEN]);
100 PACK_STRUCT_FIELD(u32_t cookie);
101 #define DHCP_MIN_OPTIONS_LEN 68U 103 #if ((defined(DHCP_OPTIONS_LEN)) && (DHCP_OPTIONS_LEN < DHCP_MIN_OPTIONS_LEN)) 104 # undef DHCP_OPTIONS_LEN 107 #if (!defined(DHCP_OPTIONS_LEN)) 109 # define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN 112 } PACK_STRUCT_STRUCT;
114 #ifdef PACK_STRUCT_USE_INCLUDES 115 # include "arch/epstruct.h" 122 DHCP_STATE_REQUESTING = 1,
124 DHCP_STATE_REBOOTING = 3,
125 DHCP_STATE_REBINDING = 4,
126 DHCP_STATE_RENEWING = 5,
127 DHCP_STATE_SELECTING = 6,
128 DHCP_STATE_INFORMING = 7,
129 DHCP_STATE_CHECKING = 8,
130 DHCP_STATE_PERMANENT = 9,
131 DHCP_STATE_BOUND = 10,
132 DHCP_STATE_RELEASING = 11,
133 DHCP_STATE_BACKING_OFF = 12
137 #define DHCP_BOOTREQUEST 1 138 #define DHCP_BOOTREPLY 2 141 #define DHCP_DISCOVER 1 143 #define DHCP_REQUEST 3 144 #define DHCP_DECLINE 4 147 #define DHCP_RELEASE 7 148 #define DHCP_INFORM 8 151 #define DHCP_HTYPE_ETH 1 153 #define DHCP_MAGIC_COOKIE 0x63825363UL 158 #define DHCP_OPTION_PAD 0 159 #define DHCP_OPTION_SUBNET_MASK 1 160 #define DHCP_OPTION_ROUTER 3 161 #define DHCP_OPTION_DNS_SERVER 6 162 #define DHCP_OPTION_HOSTNAME 12 163 #define DHCP_OPTION_IP_TTL 23 164 #define DHCP_OPTION_MTU 26 165 #define DHCP_OPTION_BROADCAST 28 166 #define DHCP_OPTION_TCP_TTL 37 167 #define DHCP_OPTION_NTP 42 168 #define DHCP_OPTION_END 255 171 #define DHCP_OPTION_REQUESTED_IP 50 172 #define DHCP_OPTION_LEASE_TIME 51 173 #define DHCP_OPTION_OVERLOAD 52 175 #define DHCP_OPTION_MESSAGE_TYPE 53 176 #define DHCP_OPTION_MESSAGE_TYPE_LEN 1 178 #define DHCP_OPTION_SERVER_ID 54 179 #define DHCP_OPTION_PARAMETER_REQUEST_LIST 55 181 #define DHCP_OPTION_MAX_MSG_SIZE 57 182 #define DHCP_OPTION_MAX_MSG_SIZE_LEN 2 184 #define DHCP_OPTION_T1 58 185 #define DHCP_OPTION_T2 59 186 #define DHCP_OPTION_US 60 187 #define DHCP_OPTION_CLIENT_ID 61 188 #define DHCP_OPTION_TFTP_SERVERNAME 66 189 #define DHCP_OPTION_BOOTFILE 67 192 #define DHCP_OVERLOAD_NONE 0 193 #define DHCP_OVERLOAD_FILE 1 194 #define DHCP_OVERLOAD_SNAME 2 195 #define DHCP_OVERLOAD_SNAME_FILE 3
#define PACK_STRUCT_BEGIN