3.2.4.63 R_DhcpDeleteSubnetV6 (Opnum 62)

The R_DhcpDeleteSubnetV6 method deletes an IPv6 prefix from the DHCPv6 server.

 DWORD R_DhcpDeleteSubnetV6(
     [in, unique, string]  DHCP_SRV_HANDLE ServerIpAddress,
     [in]    DHCP_IPV6_ADDRESS SubnetAddress,
     [in]    DHCP_FORCE_FLAG ForceFlag
 );

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

SubnetAddress: This is of type DHCP_IPV6_ADDRESS (section 2.2.1.2.28) that contains the IPv6 address of the subnet that needs to be removed from the DHCPv6 server.

ForceFlag: This is of type DHCP_FORCE_FLAG (section 2.2.1.1.9) enumeration.

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.

0x00004E27

ERROR_DHCP_ELEMENT_CANT_REMOVE

The specified subnet cannot be deleted because at least one IPv6 address has been leased out to some client from the subnet.

The opnum field value for this method is 62.

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.

  • Retrieve the DHCPv6Scope object corresponding to prefixAddress from DHCPv6ScopeList. If the DHCPv6Scope object is not found, return ERROR_FILE_NOT_FOUND.

  • If ForceFlag is DhcpNoForce, and DHCPv6Scope.DHCPv6ClientInfoList is not empty, then return ERROR_DHCP_ELEMENT_CANT_REMOVE.<65>

  • Retrieve DHCPv6Scope.DHCPv6ExclusionRangeList, DHCPv6Scope.DHCPv6ReservationList, and DHCPv6Scope.DHCPv6ScopeOptionList objects from this DHCPv6Scope object, and delete each entry in those lists.

  • Delete the DHCPv6Scope object from DHCPv6ScopeList.

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