3.1.1.1.1.2.2 GetOverlappingRanges

This procedure can be used to query the list of existing ranges in the table that overlap with the specified start IP address and end IP address.

The following are the input parameters for this procedure.

Param_StartIPAddress: This is of type IPAddress wherein the IP address is represented as an array of bytes specifying the starting IP address of the range for which the potential overlapping ranges have to be listed.

Param_EndIPAddress: This is of type IPAddress wherein the IP address is represented as an array of bytes specifying the ending IP address of the range for which the potential overlapping ranges have to be listed.

Param_ExclusionRanges: This is a list of DhcpExclusionRange specifying the StartAddress and EndAddress of the subset of addresses that have to be excluded from the address range specified by Param_StartIPAddress and Param_EndIPAddress.

Param_RecordIdToExclude: This is a 64-bit unsigned integer that specifies the RecordId of the row that has to be excluded while calculating the overlapping ranges. This is useful when the overlapping ranges for an existing range is computed and the range (for which the overlap is being computed) itself has to be excluded from the list of address ranges.

The following are the output parameters for this procedure.

Result_OverlappingRows: This is the set of rows that are potential overlapping ranges with the input address range specified using the start IP address and end IP address.

The following are the processing steps involved with this procedure:

  1. The address family of the Param_StartIPAddress and Param_EndIPAddress determines the simple table against which the processing steps are done.

  2. Enumerate the list of rows that have either their StartIPAddress or EndIPAddress lying between the specified Param_StartIPAddress and Param_EndIPAddress. If the Param_RecordIdToExclude is specified, exclude the row if it is present.

  3. Compute the ApplicableAddressRangesForGivenRange to be a collection of address ranges (having a start IP address and an end IP address) that have the valid address ranges obtained by removing the Param_ExclusionRanges from the address range specified by Param_StartIPAddress and Param_EndIPAddress. For example, if the Param_StartIPAddress is 10.1.1.0 and Param_EndIPAddress is 10.1.1.255 and  the exclusion ranges are 10.1.1.10-10.1.1.20 and 10.1.1.30-10.1.1.40, the ApplicableAddressRangesForGivenRange will be (10.1.1.0-10.1.1.9, 10.1.1.21-10.1.1.29, 10.1.1.41-10.1.1.255).

  4. For each row of possible overlapping ranges that was computed above, perform the following steps to determine whether a range forms a valid overlap or not.

    1. For the address range specified by StartIPAddress and EndIPAddress of the range and having the exclusion ranges for the range specified using ExclusionRanges field, compute the ApplicableAddressRanges for the row as it was computed for the given range above in step 3.

    2. If the entries in the ApplicableAddressRanges and ApplicableAddressRangesForGivenRange have overlapping ranges (i.e. start IP address and end IP address of the two pairs of entries overlap), then the address range is a valid overlap. Call the GetIPRangeFromTable with the Record Identifier of the address range row as Param_id parameter and the Param_addressfamily being the address family specific to the simple table being currently processed (of the compound table) and add the returned result to the Result_OverlappingRows collection.

  5. Return the Result_OverlappingRows collection.