@ -55,44 +55,35 @@ struct dhcp
# endif
} ;
/* MUST be compiled with "pack structs" or equivalent! */
# ifdef PACK_STRUCT_USE_INCLUDES
# include "arch / bpstruct.h"
# endif
PACK_STRUCT_BEGIN
/** minimum set of fields of any DHCP message */
struct dhcp_msg
{
PACK_STRUCT_FIELD ( u8_t op ) ;
PACK_STRUCT_FIELD ( u8_t htype ) ;
PACK_STRUCT_FIELD ( u8_t hlen ) ;
PACK_STRUCT_FIELD ( u8_t hops ) ;
PACK_STRUCT_FIELD ( u32_t xid ) ;
PACK_STRUCT_FIELD ( u16_t secs ) ;
PACK_STRUCT_FIELD ( u16_t flags ) ;
PACK_STRUCT_FIELD ( struct ip_addr ciaddr ) ;
PACK_STRUCT_FIELD ( struct ip_addr yiaddr ) ;
PACK_STRUCT_FIELD ( struct ip_addr siaddr ) ;
PACK_STRUCT_FIELD ( struct ip_addr giaddr ) ;
u8_t op ;
u8_t htype ;
u8_t hlen ;
u8_t hops ;
u32_t xid ;
u16_t secs ;
u16_t flags ;
struct ip_addr ciaddr ;
struct ip_addr yiaddr ;
struct ip_addr siaddr ;
struct ip_addr giaddr ;
# define DHCP_CHADDR_LEN 16U
PACK_STRUCT_FIELD ( u8_t chaddr [ DHCP_CHADDR_LEN ] ) ;
u8_t chaddr [ DHCP_CHADDR_LEN ] ;
# define DHCP_SNAME_LEN 64U
PACK_STRUCT_FIELD ( u8_t sname [ DHCP_SNAME_LEN ] ) ;
u8_t sname [ DHCP_SNAME_LEN ] ;
# define DHCP_FILE_LEN 128U
PACK_STRUCT_FIELD ( u8_t file [ DHCP_FILE_LEN ] ) ;
PACK_STRUCT_FIELD ( u32_t cookie ) ;
u8_t file [ DHCP_FILE_LEN ] ;
u32_t cookie ;
# define DHCP_MIN_OPTIONS_LEN 68U
/** allow this to be configured in lwipopts.h, but not too small */
# if ((!defined(DHCP_OPTIONS_LEN)) || (DHCP_OPTIONS_LEN < DHCP_MIN_OPTIONS_LEN))
/** set this to be sufficient for your options in outgoing DHCP msgs */
# define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN
# endif
PACK_STRUCT_FIELD ( u8_t options [ DHCP_OPTIONS_LEN ] ) ;
} PACK_STRUCT_STRUCT ;
PACK_STRUCT_END
# ifdef PACK_STRUCT_USE_INCLUDES
# include "arch / epstruct.h"
# endif
u8_t options [ DHCP_OPTIONS_LEN ] ;
} ;
/** start DHCP configuration */
err_t dhcp_start ( struct netif * netif ) ;