#include <dolphin/ip.h>
#define DHCP_STATE_INIT 0
#define DHCP_STATE_SELECTING 1
#define DHCP_STATE_REQUESTING 2
#define DHCP_STATE_BOUND 3
#define DHCP_STATE_RENEWING 4
#define DHCP_STATE_REBINDING 5
#define DHCP_STATE_INIT_REBOOT 6
#define DHCP_STATE_REBOOTING 7
typedef struct DHCPInfo
{
u8 ipaddr[4]; // your IP address
u8 broadcast[4]; // DHCP_OPT_BROADCAST_ADDR
u8 server[4]; // DHCP_OPT_SERVER_ID
u8 netmask[4]; // DHCP_OPT_SUBNETMASK
u8 router[4]; // DHCP_OPT_ROUTER (1st)
u8 dns1[4]; // DHCP_OPT_DNS (1st)
u8 dns2[4]; // DHCP_OPT_DNS (2nd)
u8 domain[256]; // DHCP_OPT_DOMAIN_NAME
u32 renewal; // DHCP_OPT_RENEWAL_TIME [sec] (t1)
u32 rebinding; // DHCP_OPT_REBINDING_TIME [sec] (t2)
u32 lease; // DHCP_OPT_LEASE_TIME [sec]
} DHCPInfo;
int DHCPGetStatus(DHCPInfo* info);
DHCPGetStatus() gets the current DHCP state machine state as well as the
current host configuration information. Note that DHCP state machine must have been
started at least once with DHCPStartup().
info |
Optional pointer to DHCPInfo that receives the current
host configuration. |
One of DHCP_STATE_*.