IPRangeLookup 1.0.3

This library is designed to optimize the lookup of an IP address in a set of IP Ranges. It supports both IPv4 and IPv6 addresses. It provides methods for checking if an IP address is a part of Public IP Ranges for M365 endpoints.

Install-Package IPRangeLookup -Version 1.0.3
dotnet add package IPRangeLookup --version 1.0.3
<PackageReference Include="IPRangeLookup" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IPRangeLookup --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: IPRangeLookup, 1.0.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install IPRangeLookup as a Cake Addin
#addin nuget:?package=IPRangeLookup&version=1.0.3

// Install IPRangeLookup as a Cake Tool
#tool nuget:?package=IPRangeLookup&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Overview

This library is designed to optimize the lookup of an IP address in a set of IP Ranges. It supports both IPv4 and IPv6 addresses. It provides methods for checking if an IP address is a part of Public IP Ranges for M365 endpoints.

Usage Examples

  1. To check if an IP address is present in Public IP Ranges.

Eg: IPSearch ipSearch=new IPSearch();
bool result=ipSearch.Contains("10.0.0.0"); //false

  1. To check if an IP address is present in a list of Subnets (CIDR). 

Eg: List<string> input = new List<string> () {"12.108.10.152/30", "13.108.10.10/29"};
IPSearch ipSearch=new IPSearch(input);
bool result=ipSearch.Contains("12.108.10.153"); //true

  1. To check if an IP address is present in the provided Subnet CIDR list and get the corresponding T value of the range. 

Eg: List<Tuple<string, string>> input = new List<Tuple<string, string>> () { Tuple.Create ("12.108.10.152/30" ,"abc"), Tuple.Create ("13.108.10.10/29" ,"xyz") };
IPSearch<string> ipSearch=new IPSearch<string>(input);
Tuple<bool,string> result=ipSearch.Lookup("12.108.10.153"); //(true,"abc")

Overview

This library is designed to optimize the lookup of an IP address in a set of IP Ranges. It supports both IPv4 and IPv6 addresses. It provides methods for checking if an IP address is a part of Public IP Ranges for M365 endpoints.

Usage Examples

  1. To check if an IP address is present in Public IP Ranges.

Eg: IPSearch ipSearch=new IPSearch();
bool result=ipSearch.Contains("10.0.0.0"); //false

  1. To check if an IP address is present in a list of Subnets (CIDR). 

Eg: List<string> input = new List<string> () {"12.108.10.152/30", "13.108.10.10/29"};
IPSearch ipSearch=new IPSearch(input);
bool result=ipSearch.Contains("12.108.10.153"); //true

  1. To check if an IP address is present in the provided Subnet CIDR list and get the corresponding T value of the range. 

Eg: List<Tuple<string, string>> input = new List<Tuple<string, string>> () { Tuple.Create ("12.108.10.152/30" ,"abc"), Tuple.Create ("13.108.10.10/29" ,"xyz") };
IPSearch<string> ipSearch=new IPSearch<string>(input);
Tuple<bool,string> result=ipSearch.Lookup("12.108.10.153"); //(true,"abc")

Release Notes

Initial Release

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.3 57 4/7/2021
1.0.2 52 3/31/2021