Expand Minimize

DhcpCreateOption function

The DhcpCreateOption function creates an option definition for the default user and vendor class at the default option level.

Syntax


DWORD DHCP_API_FUNCTION DhcpCreateOption(
  _In_  DHCP_CONST WCHAR *ServerIpAddress,
  _In_  DHCP_OPTION_ID OptionID,
  _In_  DHCP_CONST DHCP_OPTION *OptionInfo
);

Parameters

ServerIpAddress [in]

Unicode string containing the IPv4 address of the DHCP server.

OptionID [in]

DHCP_OPTION_ID value that contains the unique option ID number (also called an "option code") of the new option. Many of these option ID numbers are defined; a complete list of standard DHCP and BOOTP option codes can be found in DHCP Options and BOOTP Vendor Extensions.

OptionInfo [in]

DHCP_OPTION structure that contains information describing the new DHCP option, including the name, an optional comment, and any related data items.

Return value

This function returns ERROR_SUCCESS upon a successful call. Otherwise, it returns one of the DHCP Server Management API Error Codes.

Return codeDescription
ERROR_DHCP_JET_ERROR

An error occurred while accessing the DHCP server database.

ERROR_DHCP_OPTION_EXISTS

The specified option definition already exists in the DHCP server database.

 

Remarks

An option is a client configuration parameter assigned by a DHCP server to DHCP and BOOTP clients. For example, some commonly used options include IP addresses for gateways (subnet routers), WINS servers, and DNS servers. Typically, these options are enabled and configured for a particular scope, but default options can be created for all scopes served by a given DHCP server.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Dhcpsapi.h

Library

Dhcpsapi.lib

DLL

Dhcpsapi.dll

See also

DhcpCreateOptionV5
DHCP_OPTION_ID

 

 

Community Additions

ADD
Show:
© 2014 Microsoft