3.2.4.125 R_DhcpV6CreateClientInfo (Opnum 124)

The R_DhcpV6CreateClientInfo method creates a DHCPv6 client lease record on the DHCP server.

 DWORD R_DhcpV6CreateClientInfo(
     [in, unique, string] DHCP_SRV_HANDLE  ServerIpAddress,
     [in, ref] LPDHCP_CLIENT_INFO_V6  ClientInfo
 );

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

ClientInfo: A pointer to a DHCP_CLIENT_INFO_V6 (section 2.2.1.2.64) structure that contains the DHCPv6 client lease record information to be set on the DHCPv6 server. The caller MUST pass the ClientIPAddress, ClientDUID, and IAID members when adding a DHCPv6 client lease record to the DHCPv6 server. The ClientDUID member represents a DHCPv6 Client-Identifier as specified in section 2.2.1.2.5.3. The ClientName, ClientComment, ClientLeaseValidLeaseExpires, and OwnerHost members can optionally be passed by the caller and will be set on the DHCPv6 client lease record.

Return Values: A 32-bit unsigned integer value that indicates return status. A return value of ERROR_SUCCESS (0x00000000) indicates that the operation was completed successfully. Otherwise, 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 to any generic failure.

Return value/code

Description

0x00000000

ERROR_SUCCESS

The call completed successfully.

0x00004E25

ERROR_DHCP_SUBNET_NOT_PRESENT

The specified subnet does not exist.

0x00004E2E

ERROR_DHCP_CLIENT_EXISTS

The specified client already exists on the server.

The opnum field value for this method is 124.

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

  • Validate that this method is authorized for read/write access as specified in section 3.5.5. If not, return the error ERROR_ACCESS_DENIED.

  • If the DHCPv4 client's ClientDUID value is null or its length is 0, return ERROR_INVALID_PARAMETER.

  • Iterate through the server ADM element DHCPv6ScopesList, and retrieve the DHCPv6Scope ADM element entry such that the ClientIpAddress member of the ClientInfo parameter falls within the scope. If no such DHCPV6Scope exists, return ERROR_DHCP_SUBNET_NOT_PRESENT.

  • If there is a DHCPv6ClientInfo ADM element entry corresponding to this DHCPv4 ClientDUID value or IAID value, and/or to the client IP address already in the DHCPv6ClientInfoList ADM element, return ERROR_DHCP_CLIENT_EXISTS. Otherwise, create a DHCPv6ClientInfo object and set the ClientIPAddress, ClientDUID, IAID, ClientName, ClientComment, and ClientValidLeaseExpires members as specified in the ClientInfo input parameter. Set the other fields of the DHCPv6Client ADM element as follows:

    • The DHCPv6ClientInfo.AddressType ADM element is set to ADDRESS_TYPE_IANA.

    • The DHCPv6ClientInfo.OwnerHost.NetBiosName ADM element is set to NULL.

    • The DHCPv6ClientInfo.OwnerHost.IpAddress ADM element is set to the IPv6 address of the current server.

    • The DHCPv6ClientInfo.OwnerHost.HostName ADM element is set to NULL.

      Insert the object into the DHCPv6Scope.DHCPv6ClientInfoList ADM element.

  • Return ERROR_SUCCESS.

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