3.1.4.5 ValidateIPRange

This section captures the common validation rules for the IPRange data. The rest of the section assumes the IPRange to be validated is passed as a parameter with the name Param_range.

The following validations MUST pass for Param_range to be valid.

  • The Param_range MUST a valid IPv4Range or IPv6Range data.

  • The following fields are mandatory and MUST be specified and valid.

    • PrefixLength MUST NOT be 0.

    • StartIPAddress, EndIPAddress, SubnetId MUST NOT be null.

    • AddressAssignment MUST NOT be None.

    • CustomFieldValues MUST have the mandatory custom field values having the following ParentCustomFieldRecordId.

      • ManagedByCustomFieldRecordId

      • ManagedByEntityCustomFieldRecordId

  • Store the CustomFieldValue having ParentCustomFieldRecordId as ManagedByCustomFieldRecordId to ManagedByCustomFieldValue.

  • Store the CustomFieldValue having ParentCustomFieldRecordId as ManagedByEntityCustomFieldRecordId to ManagedByEntityCustomFieldValue.

  • If ManagedByCustomFieldValue.BuiltInCustomFieldValueId is BuiltInManagedByValues.MSDHCP, the following checks MUST succeed.

    • ScopeRecordId MUST be specified and it MUST be nonzero.

    • DhcpServerName MUST be the same value as ManagedByEntityCustomFieldValue.Value.

    • UtilizationType MUST be IPUtilizationCalculationType.Auto.

  • If ManagedByCustomFieldValue.BuiltInCustomFieldValueId is not BuiltInManagedByValues.MSDHCP, the following checks MUST succeed.

    • DhcpScopeName, DhcpServerGuid and ScopeRecordId MUST NOT be specified.

  • Performing bitwise AND operation between SubnetId and SubnetMask MUST yield the SubnetId itself.

  • StartIPAddress MUST NOT be greater than EndIPAddress.

  • Compute MinimumPossibleIPAddress to be the SubnetId itself.

  • Compute MaximumPossibleIPAddress by performing bitwise OR operation of SubnetId and SubnetMask.

  • StartIPAddress and EndIPAddress MUST be within the range of MinimumPossibleIPAddress and MaximumPossibleIPAddress.

  • If the UtilizationCalculationType is IPUtilizationCalculationType.Static, the UtilizationStatistics MUST be specified.

  • Initialize ComputedAddressCategory to be AddressCategory.None.

  • If the Param_range is IPv4Range, calculate ComputedAddressCategory as given below:

    • If the StartIPAddress and EndIPAddress fall within the public address space as described in [IANA-IPV4] , ComputedAddressCategory is set to AddressCategory.Public.

    • If the StartIPAddress and EndIPAddress fall within the private address space as described in [RFC1918], ComputedAddressCategory is set to AddressCategory.Private.

    • If the Param_range is IPv6Range, calculate ComputedAddressCategory to be AddressCategory.GlobalIPv6Unicast if the range falls within the global unicast range as described in [RFC4291].

  • The ComputedAddressCategory MUST NOT be AddressCategory.None and the ComputedAddressCategory MUST be the same as the AddressCategory in Param_range.