3.2.4.62 R_DhcpRemoveSubnetElementV6 (Opnum 61)
The R_DhcpRemoveSubnetElementV6 method removes an IPv6 prefix element (such as IPv6 reservation or IPv6 exclusion range) from an IPv6 prefix defined on the DHCPv6 server.
-
DWORD R_DhcpRemoveSubnetElementV6( [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress, [in] DHCP_IPV6_ADDRESS SubnetAddress, [in, ref] LPDHCP_SUBNET_ELEMENT_DATA_V6 RemoveElementInfo, [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), containing the IPv6 address of the subnet for which the IPv6 prefix element is removed.
RemoveElementInfo: This is a pointer of type DHCP_SUBNET_ELEMENT_DATA_V6 (section 2.2.1.2.60), containing the IPv6 prefix element that needs to be removed from the IPv6 prefix.
ForceFlag: This is of type DHCP_FORCE_FLAG (section 2.2.1.1.9) enumeration. Currently it is not used, and any value set to this parameter will not affect the behavior of this method.
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.
The opnum field value for this method is 61.
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 SubnetAddress from DHCPv6ScopeList. If the DHCPv6Scope object corresponding to SubnetAddress does not exist, return ERROR_FILE_NOT_FOUND.
If ElementType is Dhcpv6ExcludeIpRanges, and the specified exclusion range is outside of the subnet prefix specified in the SubnetAddress parameter, the server behavior is undefined.
If the ElementType field is set to DhcpReservedIps, and the specified reservation address does not correspond to any DHCPv6Reservation object in DHCPv6Scope.DHCPv6ReservationList, return ERROR_FILE_NOT_FOUND.
If ElementType is set to DhcpReservedIps, the corresponding DHCPv6Scope.DHCPv6ReservationList.DHCPv6Reservation object is removed along with the corresponding DHCPv6Scope.DHCPv6ClientInfoList.DHCPv6ClientInfo object that does not correspond to an active lease. The server ignores the ReservedForClient field specified in DHCP_IP_RESERVATION_V6 (section 2.2.1.2.58) when locating and deleting the DHCPv6Reservation object.
If ElementType is Dhcpv6ExcludeIpRanges, and the specified exclusion range is outside of the subnet prefix specified in the SubnetAddress parameter, the server behavior is undefined.
If ElementType is set to DhcpExcludedIpRanges, and the specified exclusion range does not exist in DHCPv6Scope.DHCPv6ExclusionRangeList, return ERROR_FILE_NOT_FOUND; else, remove the found DHCPv6Scope.DHCPv6ExclusionRangeList.DHCPv6ExclusionRange object from DHCPv6ExclusionRangeList.
If ElementType is set to Dhcpv6Ipranges, do no processing and return ERROR_SUCCESS.
Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].