3.1.4.4 ValidateIPBlock

The ValidateIPBlock event describes the common validation rules for an IPBlock, which can be either IPv4Block or IPv6Block. This will be used in IPBlock operations such as UpdateBlock, SaveBlock to validate the client specified IPBlock data. In the following descriptions, Param_IPBlock indicates the IPBlock to validate:

  1. If the Param_IPBlock is IPv4Block, Param_IPBlock.PrefixLength MUST be at least 1 and no more than 30. If the Param_IPBlock is IPv6Block, Param_IPBlock.PrefixLength MUST be at least 1 and no more than 127.

  2. The following mandatory fields MUST be specified:

    1. NetworkId

    2. StartIPAddress

    3. EndIPAddress

  3. Performing bitwise AND operation between NetworkId and SubnetMask MUST yield the NetworkId itself.

  4. StartIPAddress MUST be lesser than or equal to EndIPAddress.

  5. Compute MinimumPossibleIPAddress to be the NetworkId itself.

  6. Compute MaximumPossibleIPAddress by performing bitwise OR operation of NetworkId and SubnetMask.

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

  8. Initialize ComputedAddressCategory to be AddressCategory.None.

  9. If the Param_IPBlock is IPv4Block, calculate ComputedAddressCategory as follows:

    1. If the StartIPAddress and EndIPAddress completely lies within the public address space as specified in [IANA-IPV4], ComputedAddressCategory is set to AddressCategory.Public.

    2. If the StartIPAddress and EndIPAddress completely lie within the private address space as specified in [RFC1918], ComputedAddressCategory is set to AddressCategory.Private.

  10. If the Param_IPBlock is IPv6Block, calculate ComputedAddressCategory to be AddressCategory.GlobalIPv6Unicast if the range falls within the global unicast range as specified in [RFC4291].

  11. The ComputedAddressCategory MUST NOT be AddressCategory.None and the ComputedAddressCategory MUST be the same as the AddressCategory in range.