3.1.1.1.4.2.4 GetOverlappingBlocks
The GetOverlappingBlocks procedure can be used to determine the list of blocks that overlap with a given block information. The block information for which the overlap is computed is specified using the following information passed as input parameters:
Param_StartIPAddress: This is of type IPAddress specifying the StartIPAddress of the address block for which the overlap is to be calculated.
Param_EndIPAddress: This is of type IPAddress specifying the EndIPAddress of the address block for which the overlap is to be calculated.
Param_PrefixLength: This is an integer specifying the PrefixLength of the address block for which the overlap is to be calculated.
Param_AddressSpaceRecordId: The AddressSpaceRecordId of the IPBlock for which the overlapping blocks are to be computed. If this parameter is not specified while calling this procedure, the default value that is considered is 1, which maps to Default Provider Address Space.
Param_RecordIdToExclude: This specifies the RecordId of the block for which the overlapping blocks are being calculated so that it is filtered from the resulting set.
The result is a collection of IPBlock, which overlaps with the specified block information. This output parameter will be named Result_OverlappingBlocks.
The following are the steps involved. If the address family of the Param_StartIPAddress and Param_EndIPAddress is InterNetwork, the remainder of the processing has to be done against the IPv4-specific table. Otherwise the remainder of the processing is done against the IPv6-specific table:
The set of overlapping address blocks are those entries that do not fall into either of the following categories:
Lying completely outside the specified block:
Both StartIPAddress and EndIPAddress of the block are less than Param_StartIPAddress.
Both StartIPAddress and EndIPAddress of the block are greater than Param_EndIPAddress.
Potential parent/child blocks of the incoming block.
Child Blocks will meet the following conditions:
Param_StartIPAddress is less than or equal to StartIPAddress of the block entry in the table
Param_EndIPAddress is less than or equal to StartIPAddress of the block entry in the table.
Param_AddressSpaceRecordId is equal to AddressSpaceRecordId of the block entry in the table.
Param_PrefixLength is less than or equal to PrefixLength of the entry.
Parent Blocks will meet the following conditions:
Param_StartIPAddress is greater than or equal to StartIPAddress of the entry
Param_EndIPAddress is less than or equal to StartIPAddress of the entry.
Param_AddressSpaceRecordId is equal to AddressSpaceRecordId of the block entry in the table
Param_PrefixLength is greater than or equal to PrefixLength of the entry
If Param_RecordIdToExclude is specified, exclude the row with RecordId equal to Param_RecordIdToExclude.
Return the final collection as Result_OverlappingBlocks.