4.6 Adding an IPv4 Multicast Range to a Multicast Scope

This example illustrates how an IPv4 multicast range is added to a DHCPv4 multicast scope on the DHCP server.

The client calls the RPC method R_DhcpAddMScopeElement (section 3.2.4.5) with the following parameters:

  • The endpoint of the DHCP server as the server IP address. This parameter is optional and can be passed as a pointer to a null Unicode string.

  • The name of the multicast scope is set as the subnet reference. An example of an MScopeName parameter is a pointer to a WCHAR initialized with "IPv4 Multicast Scope Example".

  • A pointer of type LPDHCP_SUBNET_ELEMENT_DATA_V4 (section 2.2.1.2.35) to a data structure in which the member ElementType is set to the value DhcpIpRanges, and the member Element is set as the union member IpRange to the value that the client sets as the IPv4 multicast range for that multicast scope.

The call to this RPC method will return either ERROR_SUCCESS or an error code between 20000 and 20099.