2.2.1.2.38 DHCP_SUBNET_ELEMENT_DATA_V5

The DHCP_SUBNET_ELEMENT_DATA_V5 structure defines the element IPv4 reservation, IPv4 exclusion range, or IPv4 range for the subnet. This structure is an extension of the DHCP_SUBNET_ELEMENT_DATA_V4 (section 2.2.1.2.35) structure and is used in the R_DhcpAddSubnetElementV5 (section 3.2.4.38) method.

 #define ELEMENT_MASK(E) ((((E) <= DhcpIpRangesBootpOnly) \
     && (DhcpIpRangesDhcpOnly <= (E)))?(0):(E))
 typedef struct _DHCP_SUBNET_ELEMENT_DATA_V5 {
     DHCP_SUBNET_ELEMENT_TYPE ElementType;
     [switch_is(ELEMENT_MASK(ElementType)), switch_type(DHCP_SUBNET_ELEMENT_TYPE)]
     union _DHCP_SUBNET_ELEMENT_UNION_V5 {
         [case(DhcpIpRanges)] DHCP_BOOTP_IP_RANGE *IpRange;
         [case(DhcpSecondaryHosts)] DHCP_HOST_INFO *SecondaryHost;
         [case(DhcpReservedIps)] DHCP_IP_RESERVATION_V4 *ReservedIp;
         [case(DhcpExcludedIpRanges)] DHCP_IP_RANGE *ExcludeIpRange;
         [case(DhcpIpUsedClusters)] DHCP_IP_CLUSTER *IpUsedCluster;
     } Element;
 } DHCP_SUBNET_ELEMENT_DATA_V5, *LPDHCP_SUBNET_ELEMENT_DATA_V5;

ElementType: This is of type DHCP_SUBNET_ELEMENT_TYPE (section 2.2.1.1.7) enumeration, defining the set of possible IPv4 subnet element types. This value defines which of the values is chosen from the subsequent union, the Element member.

Element: Element is a union of different types of IPv4 subnet elements. The value of the union is dependent on the previous field, the ElementType member.

ELEMENT_MASK: A macro that causes Element to assume the type DHCP_IP_RANGE* for the ElementType values DhcpIpRangesDhcpOnly, DhcpIpRangesDhcpBootp, and DhcpIpRangesBootpOnly.

IpRange: This is of type DHCP_BOOTP_IP_RANGE (section 2.2.1.2.37) structure, containing the IPv4 range for the IPv4 subnet. This contains the range for the following valid enumeration values.

DHCP_SUBNET_ELEMENT_TYPE

Meaning

DhcpIpRanges

0

The configuration parameter is the IP range of a DHCPv4 scope configured on the DHCPv4 server.

DhcpIpRangesDhcpOnly

5

The configuration parameter is an IP range of a DHCPv4 scope configured on the DHCPv4 server that MUST be used only for assignment of addresses to DHCPv4 clients on the subnet. The IP addresses from this range MUST NOT be assigned to BOOTP clients ([RFC2132]).

DhcpIpRangesDhcpBootp

6

The configuration parameter is an IP range of a DHCPv4 scope configured on the DHCPv4 server that can be used for assignment of addresses to both DHCPv4 and BOOTP.

DhcpIpRangesBootpOnly

7

The configuration parameter is an IP range of a DHCPv4 scope configured on the DHCPv4 server that MUST be used only for assignment of IPv4 addresses to BOOTP clients.

SecondaryHost: This is of type DHCP_HOST_INFO (section 2.2.1.2.7) structure and is not used. If the ElementType value mandates that the SecondaryHost element is to be used in any method, the method will return ERROR_CALL_NOT_IMPLEMENTED or ERROR_NOT_SUPPORTED, as specified in the processing rules of methods that use the DHCP_SUBNET_ELEMENT_DATA_V5 structure.

ReservedIp: This is of type DHCP_IP_RESERVATION_V4 (section 2.2.1.2.32) structure, containing the IPv4 reservation.

ExcludeIpRange: This is of type DHCP_IP_RANGE, containing the IPv4 exclusion range.

IpUsedCluster: This is of type DHCP_IP_CLUSTER (section 2.2.1.2.88) structure and is not used. If the ElementType member mandates this element to be used in any method, the method will return ERROR_INVALID_PARAMETER.