Microsoft KB Archive/290279

= INFO: Configuring Windows CE to Send and Receive DHCP Options =

Article ID: 290279

Article Last Modified on 11/22/2005

-

APPLIES TO


 * Microsoft Windows CE 3.0 for the Handheld PC
 * Microsoft Windows CE 2.12 for the Handheld PC
 * Microsoft Windows CE 2.11 for the Handheld PC
 * Microsoft Windows CE 2.0 for the Handheld PC

-



This article was previously published under Q290279



IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SUMMARY
Dynamic Host Control Protocol (DHCP), as specified in RFC 2131, is implemented in Windows CE beginning with version 2.0. The main purpose of DHCP is to enable dynamic configuration of network addressing parameters. However, it also includes provisions for requesting other information from the server (see RFC 1533). This article describes the mechanism used by Windows CE to request additional DHCP options and retrieve information returned by the server.



MORE INFORMATION
There are two categories of option support in DHCP: requested options, which are used to obtain additional information from the server, and send options, which are used to give additional information to the server. Refer to RFC 1533 for a full list of DHCP-defined options.

Requested Options
The default list of options requested from the server includes the following:

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

To change this default list, options which are to be sent out by Windows CE are read from the registry on a per adapter basis under the following key:

HKEY_LOCAL_MACHINE\Comm\ \Parms\TcpIp\DhcpOptions

Values are created under this key that have the names of the options to request. The default (&quot;@&quot;) value under the DhcpOptions key must also be defined.

The registry setting format is a binary structure equivalent to the actual DHCP option encoding (as per RFC 1533), a one-byte code, followed by a one-byte length value, followed by the actual data.

Example: The following setting (in .REG file notation) shows requesting the value for the subnet mask option:

HKEY_LOCAL_MACHINE Comm\ \Parms\TcpIp\DhcpOptions

@=&quot;&quot;

&quot;1&quot;

After DHCP has retrieved the information from the server, you might find the following under the value &quot;1&quot; above:

01 04 ff ff ff 00

This corresponds to a subnet mask of 255.255.255.0. (type 1, length 4, data 0xFFFFFF00).

Send Options
Windows CE version 2.12 (with QFE fix #1 applied) and later also supports the capability to supply data to send options to the server. The most common case requiring this is the sending of the host name option.

The key for the send options is as follows:

HKEY_LOCAL_MACHINE\Comm\ \Parms\TcpIp\DhcpSendOptions

Values are created under this key which have the names of the options to send. The default (&quot;@&quot;) value under the DhcpOptions key must also be set. The format of the option data must include type and length fields, as specific by RFC 1533. Windows CE does not attempt to parse the data, it just copies it into the packet.

Example: The following example setting shows how to set the host name option (12) to the value &quot;myhost&quot;:

HKEY_LOCAL_MACHINE\Comm\ \Parms\TcpIp\DhcpSendOptions

@=&quot;&quot;

&quot;12&quot;=hex:0c,06,6d,79,68,6f,73,74

