Open this page in the API Guide

NetworkHelper.IPRangeToCidr Method

Converts an IP address range to CIDR notation.

Namespace:  Dundas.BI.Utility
Assembly:  Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (25.1.0.1000)
Syntax
public static IReadOnlyCollection<(IPAddress StartIP, byte NumBits)> IPRangeToCidr(
	IPAddress startIP,
	IPAddress endIP
)

Parameters

startIP
Type: System.Net.IPAddress
The starting value of the IP address range.
endIP
Type: System.Net.IPAddress
The ending value of the IP address range.

Return Value

Type: IReadOnlyCollection<ValueTuple<IPAddress, Byte>>
A collection of IP addresses and the corresponding number of bits to consider, collectively representing the specified IP address range.
Exceptions
ExceptionCondition
ArgumentNullExceptionEither of the provided IP addresses is null.
ArgumentExceptionThe address family of startIP does not match that of endIP.
See Also