3.2.4.49 R_DhcpSetOptionInfoV6 (Opnum 48)

The R_DhcpSetOptionInfoV6 method modifies the option definition for the specific user class and vendor class at the default level. If the user class or vendor class is not specified, the default user class or vendor class will be used.

 DWORD R_DhcpSetOptionInfoV6(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DWORD Flags,
   [in] DHCP_OPTION_ID OptionID,
   [in, string, unique] WCHAR* ClassName,
   [in, string, unique] WCHAR* VendorName,
   [in] LPDHCP_OPTION OptionInfo
 );

ServerIpAddress: The IP address/host name of the DHCP server. This parameter is unused.

Flags: This is of type DWORD that specifies that the option definition is modified for a specific or default vendor class.

Value

Meaning

DHCP_FLAGS_OPTION_DEFAULT

0x00000000

Option is modified for a default vendor class.

DHCP_FLAGS_OPTION_IS_VENDOR

0x00000003

If a bitwise AND operation with this bitmask yields a nonzero value, it indicates that the option is modified for a specific vendor class.

OptionID: This is of type DHCP_OPTION_ID (section 2.2.1.2.3), containing the option identifier for the option definition being modified.

ClassName: A pointer to a null-terminated Unicode string that contains the name of the user class to which the option definition is modified. This parameter is optional.

VendorName: A pointer to a null-terminated Unicode string that contains the name of the vendor class to which the option definition is modified. This parameter is optional, and if vendor class is not specified, the option definition is created for the default vendor class.

OptionInfo: This is a pointer of type DHCP_OPTION (section 2.2.1.2.25) that contains the new option definition for the option being modified.

Return Values: A 32-bit unsigned integer value that indicates return status. A return value ERROR_SUCCESS (0x00000000) indicates that the operation was completed successfully, else it contains a Win32 error code, as specified in [MS-ERREF]. This error code value can correspond to a DHCP-specific failure, which takes a value between 20000 and 20099, or any generic failure.

Return value/code

Description

0x00000000

ERROR_SUCCESS

The call was successful.

0x00004E2A

ERROR_DHCP_OPTION_NOT_PRESENT

The option to be modified does not exist.

0x00004E2D

ERROR_DHCP_JET_ERROR

An error occurred while accessing the DHCP server database.

0x00004E59

ERROR_DHCP_INVALID_PARAMETER_OPTION32

The information refresh time option value is invalid, as it is less than the minimum option value.

The opnum field value for this method is 48.

When processing this call, the DHCP server MUST do the following:

  • Validate if this method is authorized for read/write access per section 3.5.5. If not, return the error ERROR_ACCESS_DENIED.

  • The Flags parameter MUST pass one of the validations given in the Flags field description. Otherwise, the method returns ERROR_INVALID_PARAMETER.

  • Validate the DefaultValue data structure, pointed to by the OptionInfo parameter, by checking that its Elements member is not NULL and that its NumElements member is not zero. If either check fails, return ERROR_INVALID_PARAMETER.

  • If the option specified is Information Refresh Time Option (option identifier 32) and the value specified is less than the minimum specified ([RFC4242] section 3.1), then return ERROR_DHCP_INVALID_PARAMETER_OPTION32.

  • If ClassName is not NULL, retrieve the DHCPv6ClassDef entry corresponding to the ClassName from the server ADM element DHCPv6ClassDefList. If the DHCPv6ClassDef entry is not found, return ERROR_FILE_NOT_FOUND. If ClassName is NULL, use the default user class (section 3.1.1.20) for the retrieval of DHCPv6ClassedOptionDef.

  • If VendorName is not NULL, retrieve the DHCPv6ClassDef entry corresponding to the VendorName from the server ADM element DHCPv6ClassDefList. If the DHCPv6ClassDef entry is not found, return ERROR_FILE_NOT_FOUND. If VendorName is NULL, use the default vendor class (section 3.1.1.20) for the retrieval of DHCPv6ClassedOptionDef.

  • Retrieve the DHCPv6ClassedOptionDef object from DHCPv6ClassedOptionDefList for the specific user and vendor class. If it is not found, return ERROR_FILE_NOT_FOUND.

  • Retrieve the DHCPv6OptionDef object corresponding to the OptionId, user, and vendor class from DHCPv6ClassedOptionDef.DHCPv6OptionDefList. If it is not found, return ERROR_DHCP_OPTION_NOT_PRESENT.

  • Delete the found DHCPv6OptionDef object corresponding to the OptionID for a specific user and vendor class from DHCPv6ClassedOptionDef.DHCPv6OptionDefList.

  • Create a new DHCPv6OptionDefList.DHCPv6OptionDef object from the information in OptionInfo.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].