struct DHCP_std_params
The structure DHCP_std_params is declared in Dhcpcapi.h as below. The capitalized names in comments correspond to constants for these options.
typedef struct DHCP_std_params {
DWORD * subnet_mask; // SUBNET_MASK
DWORD * dns_server; // DNS
int dns_server_len; // length of dns
int domain_name_len // length of domain name
BYTE * domain_name; // DOMAIN_NAME
BYTE * be_a_router; // ROUTER_OPTION
WORD * mdrs; // MDRS (maximum datagram reassembly size)
BYTE * default_ip_ttl; // DEFAULT_IP_TTL
WORD * mtu; // PATH_MTU_AT
DWORD * static_route; // STATIC_ROUTE_OP
int static_route_len // length of static route information
DWORD * router_option; // ROUTER_OPTION
int router_option_len; // length of router option information
DWORD * arp_cache_timeout; // ARP_CT_OP
BYTE * tcp_default_ttl; // TCP_DEFAULT_TTL
DWORD * tcp_ka_interval; // TCP_KA_INTERVAL
BYTE * tcp_ka_garbage; // TCP_KA_GARBAGE
} DHCP_std_params;
The fields in this structure are pointers into the DHCP message body. By taking the contents of these pointers, the value of the corresponding parameters can be accessed. For example, with:
static DHCP_session DS;
static DHCP_conf DC;
Result = xn_dhcp(interface, &DS, &DC);
the MTU value returned by the server is accessed with:
if (Result != SOCKET_ERROR)
MTU = *DS.params.mtu;
DHCP Client
struct DHCP_param
Function XN_REGISTER_DHCP_CLI
|