3.2.4.7 R_DhcpRemoveMScopeElement (Opnum 6)
The R_DhcpRemoveMScopeElement method removes an IPv4 multicast subnet element (IPv4 multicast range or IPv4 exclusion range) from the IPv4 multicast subnet defined on the MADCAP server.
-
DWORD R_DhcpRemoveMScopeElement( [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress, [in, ref, string] LPWSTR* MScopeName, [in, ref] LPDHCP_SUBNET_ELEMENT_DATA_V4 RemoveElementInfo, [in] DHCP_FORCE_FLAG ForceFlag );
ServerIpAddress: The IP address/host name of the MADCAP server. This parameter is unused.
MScopeName: This is a pointer to a Unicode string that contains the name of the multicast subnet from which the IPv4 multicast subnet element is removed. There is no restriction on the length of this field.
RemoveElementInfo: This is of type DHCP_SUBNET_ELEMENT_DATA_V4 (section 2.2.1.2.35), containing the IPv4 multicast subnet element that needs to be removed from the IPv4 multicast subnet.
ForceFlag: This is of type DHCP_FORCE_FLAG (section 2.2.1.1.9) that defines the behavior of this method. If the flag is set to DhcpNoForce and this IPv4 multicast subnet has served the IPv4 address to some MADCAP clients, the IPv4 multicast subnet is not deleted. If the flag is set to DhcpFullForce, the IPv4 multicast subnet is deleted along with the MADCAP client lease record on the MADCAP server.
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.
0x00004E27
ERROR_DHCP_ELEMENT_CANT_REMOVE
The specified IPv4 multicast subnet element cannot be removed because at least one multicast IPv4 address has been leased out to a MADCAP client.
The starting address of the specified Multicast exclusion range is not part of any multicast exclusion range configured on the server.
There is an error in deleting the exclusion range from the database.
0x00004E2D
ERROR_DHCP_JET_ERROR
An error occurred while accessing the MADCAP server database.
0x00004E37
ERROR_DHCP_INVALID_RANGE
The specified IPv4 range either overlaps an existing IPv4 range or is not valid.
The opnum field value for this method is 6.
When processing this call, the MADCAP 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 MScopeName parameter is NULL, return ERROR_INVALID_PARAMETER.
Retrieve the DHCPv4MScope entry corresponding to the MScopeName from the server ADM element DHCPv4MScopesList.
If the DHCPv4MScope entry is not found, return ERROR_FILE_NOT_FOUND.
If the ElementType field in the RemoveElementInfo parameter is set to DhcpSecondaryHosts, return ERROR_CALL_NOT_IMPLEMENTED.
If the ElementType is set to DhcpReservedIps or DhcpIpUsedClusters, return ERROR_INVALID_PARAMETER.
If ElementType is set to DhcpExcludedIpRanges, delete the DHCPv4ExclusionRange entry corresponding to the ExcludeIpRange field of the RemoveElementInfo input parameter from the DHCPv4ExclusionRangesList. If the ExcludeIpRange field in the RemoveElementInfo parameter is equal to NULL, return ERROR_INVALID_PARAMETER.
If the starting address of the IPv4 multicast exclusion range in the ExcludeIpRange field of RemoveElementInfo is not part of range specified by any DHCPv4ExclusionRange entry in DHCPv4MScope.DHCPv4ExclusionRangesList, then return ERROR_DHCP_ELEMENT_CANT_REMOVE.
If the StartAddress and EndAddress fields of ExcludeIpRange of RemoveElementInfo input parameter do not match the StartAddress and EndAddress of any DHCPv4ExclusionRange entry in DHCPv4ExclusionRangesList, then return ERROR_INVALID_PARAMETER.
If there is error in deleting the DHCPv4ExclusionRange entry from DHCPv4MScope.DHCPv4ExclusionRangesList, then return ERROR_DHCP_ELEMENT_CANT_REMOVE.
If the ElementType is set to any one of the values from DhcpIpRanges, DhcpIpRangesDhcpBootp, DhcpIpRangesDhcpOnly, or DhcpIpRangesBootpOnly (section 2.2.1.1.7), and if the StartAddress and EndAddress fields of IpRange of RemoveElementInfo input parameter do not match the StartAddress and EndAddress of the DHCPv4IpRange.RangeInfo of any entry in the DHCPv4MScope.DHCPv4IPRangesList, return ERROR_DHCP_INVALID_RANGE.
If ElementType is set to any one of the following values DhcpIpRanges, DhcpIpRangesDhcpBootp, or DhcpIpRangesBootpOnly, ForceFlag is set to DhcpNoForce, and if there is any entry in the DHCPv4MClientsList having an IPv4 address from within the IPv4 Range specified by IpRange field of the RemoveElementInfo input parameter, return ERROR_DHCP_ELEMENT_CANT_REMOVE.
Otherwise, delete the DHCPv4IPRange entry corresponding to the IpRange field of the RemoveElementInfo input parameter from the DHCPv4IPRangesList.
Return ERROR_SUCCESS.
Exceptions Thrown: No exceptions SHOULD be thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].