2.2.1.2.33 DHCP_SUBNET_ELEMENT_DATA

The DHCP_SUBNET_ELEMENT_DATA structure defines the elements of an IPv4 reservation, IPv4 exclusion range, or IPv4 range for the subnet. This structure is used in methods R_DhcpAddSubnetElement (section 3.1.4.5) and R_DhcpRemoveSubnetElement (section 3.1.4.7).

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

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

Element: Element is a union of 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_IP_RANGE (section 2.2.1.2.31), 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 DHCP server.

DhcpIpRangesDhcpOnly

5

The configuration parameter is an IP range of a DHCPv4 scope configured on the DHCP server that MUST be used only for assignment of addresses to DHCP 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 DHCP server that can be used for assignment of addresses to both DHCP and BOOTP.

DhcpIpRangesBootpOnly

7

The configuration parameter is an IP range of a DHCPv4 scope configured on the DHCP 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) and is not used. If the ElementType value mandates that the SecondaryHost element is to be used in any method, that 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 structure.

ReservedIp: This is of type DHCP_IP_RESERVATION (section 2.2.1.2.10), 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) and is not used. If the ElementType member mandates this element to be used in any method, the method will return ERROR_INVALID_PARAMETER.