Home |
struct DHCP_conf |
struct DHCP_confBy setting the fields in the DHCP_conf structure pointed to by the conf parameter in xn_dhcp, an application can control the DHCP client behavior. It is recommended to always initialize a DHCP_conf structure with xn_init_dhcp_conf and then make modifications as needed (if any). The structure is declared as follows: struct DHCP_conf { DHCP_param * plist; int plist_entries; DHCP_cparam * cplist; int cplist_entries; int request_std_params; int apply_std_params; DWORD lease_time; // seconds BYTE client_ip_addr[4]; BYTE req_ip_addr[4]; BYTE * vendor_specific; int vs_size; }; To fill in the fields of this structure, use the following rules: A DHCP_conf variable must be allocated as a global or static variable and it must not be modified after xn_dhcp has been called. If you already know your IP address, and are using DHCP only to obtain network configuration parameters:
If you do not know your IP address, and are using DHCP to obtain an IP address lease:
If you want to request a specific IP address lease time:
If you do not want to use the standard DHCP parameters to be requested from the server:
If you do not want to use the standard DHCP parameters that are returned by the server to be automatically applied:
If you are requesting the standard DHCP parameters and want to request other parameters as well, or if you are not requesting the standard parameters and want to specify your own list of parameters to request:
If you want to include vendor specific information in the outgoing DHCP packet:
|