/* DHCP.H Edition: 1.00 Last changed: 08/Aug/2003 Link: TCPIP.lib 2003/05/29 or later DHCP.H: Include file definitions for DHCP server * * * * * * * * * * * * * * * * * * * * * * * * * ** ** MODIFICATION HISTORY ** ** 08/Aug/2003 Creation by Sean ** * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Maximum delay in DHCP client retry loop (Not time) */ #define MAXDELAY 1000 // selectsock timeout is 6 ms ,Total timeout is about 1000* (6+1.5)=7500ms (1.2 ms means the process time of the other functions) #define NTRACE 4 //Print debug message /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** ** DHCP_Get: User routine to get DHCP bootload information ** ** int DHCP_Get(int netno, unsigned long lease) ** ** PARAMETERS: ** (in) netno: index into network configuration table ** 1~32 defined on the #define NCONNS 32 in the TCPIP.h ** (in) lease: desired length of lease (The time is in units of seconds) ** ** DESCRIPTION: ** DHCP_Get contacts a DHCP server to obtain an IP address and other ** network parameters for a host. Note that this client does not ** automatically obtain configuration parameters (such as network ** mask, DNS server, etc) other than the IP address. ** ** RETURNS: ** < 0: Error given by error code ** 0: No action needed (lease doesn't need renewing) ** > 0: IP address allocated or renewed ** ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ int DHCP_Get(int netno, unsigned long lease); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** ** DHCPrelease: User-called routine to release IP address ** ** int DHCPrelease(int netno) ** ** PARAMETERS: ** (in) netno: index into network configuration table ** ** DESCRIPTION: ** DHCPrelease() sends a message to a DHCP server to release ** the currently held client IP address. There is no response ** to this message; so there is no guarantee that the server ** actually receives the release. Note that the release is ** unicast to the DHCP server which originally handed out the ** client's IP address. ** ** RETURNS: ** < 0: Error given by error code ** 0: DHCP server not stored in network configuration structure ** > 0: IP address released ** ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ int DHCP_Release(int netno);