3.2.4.75 R_DhcpCreateClassV6 (Opnum 74)

The R_DhcpCreateClassV6 method creates an IPv6 user class or a vendor class definition on the DHCPv6 server.

 DWORD R_DhcpCreateClassV6(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DWORD ReservedMustBeZero,
   [in] LPDHCP_CLASS_INFO_V6 ClassInfo
 );

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

ReservedMustBeZero: This flag SHOULD be set to 0. Currently it is not used, and any value set to this parameter will not affect the behavior of this method.

ClassInfo: This is of type DHCP_CLASS_INFO_V6 (section 2.2.1.2.70), containing information regarding a class.

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.

0x00004E2D

ERROR_DHCP_JET_ERROR

An error occurred while accessing the DHCP server database.

0x00004E4D

ERROR_DHCP_CLASS_ALREADY_EXISTS

The vendor class or user class that is being created already exists.

The opnum field value for this method is 74.

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.

  • If the ClassInfo parameter is NULL, return ERROR_INVALID_PARAMETER.

  • If the ClassName member is NULL, or if the ClassDataLength member is 0 and the ClassData member is not NULL, return ERROR_INVALID_PARAMETER.

  • Iterate through the server ADM element DHCPv6ClassDefList, and if there is a DHCPv6ClassDef entry with ClassName matching ClassName field in the ClassInfo structure, return ERROR_DHCP_CLASS_ALREADY_EXISTS.

  • If the ClassInfo structure has the IsVendor field set to 0, iterate through the server ADM element DHCPv6ClassDefList, and if there is a DHCPv6ClassDef entry with ClassData and ClassDataLength matching ClassData and ClassDataLength fields respectively in the ClassInfo structure, return ERROR_DHCP_CLASS_ALREADY_EXISTS.

  • If the ClassInfo structure has the IsVendor field set to 1, iterate through the server ADM element DHCPv6ClassDefList, and if there is a DHCPv6ClassDef entry with ClassData, ClassDataLength, IsVendor and EnterpriseNumber matching ClassData, ClassDataLength, IsVendor and EnterpriseNumber fields respectively in the ClassInfo structure, return ERROR_DHCP_CLASS_ALREADY_EXISTS.

  • Retrieve the DHCPv6ClassDefList object, initialize a new DHCPv6ClassDef object from the information in ClassInfo, and add it to DHCPv6ClassDefList.

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