3.1.4.7 SetIPRangeMapping

This section captures the common processing rules for performing the following common activities for an address range.

  • Recalculate the IsOverlapping setting for the specified range and the ranges that overlap with the specified range.

  • Identify the block that has to be mapped to the range.

  • Mapp the appropriate set of rows in the ADM_IPAddressTable to the specified range.

In the following processing steps, currentRange indicates the address range for which the above activities are to be performed.

  1. Get the list of overlapping address ranges with the StartIPAddress, EndIPAddress, ExclusionRanges by invoking the procedure GetOverlappingRanges of the ADM_IPRangeTable. This is done by setting the following input parameters:

    • Param_StartIPAddress is assigned the value currentRange.range.StartIPAddress.

    • Param_EndIPAddress is assigned the value currentRange.range.EndIPAddress.

    • Param_ExclusionRanges is set to the currentRange.range.ExclusionRanges.

    • Param_RecordIdToExclude is set to currentRange.RecordId.

  2. Assign the Result_OverlappingRows returned to PossibleOverlappingRanges.

  3. Initialize a computed field CanIPRangeMapToBlock to true.

  4. For each IPRange row in the PossibleOverlappingRanges, perform the possible checks.

    1. If the ManagedByValue and ManagedByEntityValue of the IPRange row being processed is the same as the ManagedByValue and ManagedByEntityValue computed for the currentRange and the ManagedByValue is not BuiltInManagedByValues.MSDHCP, the overlap is not allowed for the range. The server MUST return an appropriate SOAP fault to the client.

    2. If the ManagedByValue is BuiltInManagedByValues.MSDHCP, the overlapping range is from the same DHCP server instance. So delete the specific overlapping range from the ADM_IPRangeTable.

    3. If neither of the above is the case, if the IPRange row has a valid IPBlockId that is nonzero, an existing overlapping range is already mapped to a block. So no new ranges can map onto a block. Set the CanIPRangeMapToBlock to false.

  5. If CanIPRangeMapToBlock is true, get the address block mapping for the range by the following steps.

    1. Call the MapIPRangeToBlock procedure of the IP address range able with the following parameters.

      1. Param_range is assigned the value of currentRange

  6. If the currentRange.RecordId is 0, add the currentRange to the ADM_IPRangeTable and set the currentRange.RecordId to the value of record identifier.

  7. If the currentRange.RecordId is not 0, update the existing row in the ADM_IPAddressTable specified with the values from the currentRange.ModifiedProperties. 

  8. If the PossibleOverlappingRanges is a nonempty set of rows, update the IsOverlapping flag of those rows in ADM_IPRangeTable to true.

  9. Call the AdjustIPAddressRangeMapping procedure of ADM_IPAddressTable with the following values to map the addresses as applicable to the new address range added.

    1. Assign the value of currentRange.RecordId to Param_rangeId.

    2. Assign the value of currentRange.StartIPAddress to Param_StartIPAddress.

    3. Assign the value of currentRange.EndIPAddress to Param_EndIPAddress.

    4. Assign the value of ManagedByValue of the currentRange to the Param_ManagedByValue parameter.

    5. Assign the value of the ManagedByEntityValue of the currentRange to the Param_ManagedByEntityValue parameter.