Releases: lduchosal/ipnetwork
ParseRange & TryParseRange
ParseRange and TryParseRange
A C# utility for converting IP address ranges into optimal CIDR blocks, supporting both IPv4 and IPv6 addresses.
Both IPv4 and IPv6 ranges are supported
The algorithm generates the minimal set of CIDR blocks that exactly cover the specified range
Input format must be "startIP - endIP" with a single hyphen separator
Whitespace around IP addresses is automatically trimmed
Mixed IPv4/IPv6 ranges are not supported (both addresses must be the same family)
IPv4 Example
string ipv4Range = "192.168.1.45 - 192.168.1.65";
var ipv4Blocks = IPNetwork2.ParseRange(ipv4Range);
Console.WriteLine($"CIDR blocks for {ipv4Range}:");
foreach (var block in ipv4Blocks)
{
Console.WriteLine($" {block}");
}Output
CIDR blocks for 192.168.1.45 - 192.168.1.65:
192.168.1.45/32
192.168.1.46/31
192.168.1.48/28
192.168.1.64/31
IPv6 Example
string ipv6Range = "2001:db8::1000 - 2001:db8::1fff";
var ipv6Blocks = IPNetwork2.ParseRange(ipv6Range);
Console.WriteLine($"CIDR blocks for {ipv6Range}:");
foreach (var block in ipv6Blocks)
{
Console.WriteLine($" {block}");
}Ouput
CIDR blocks for 2001:db8::1000 - 2001:db8::1fff:
2001:db8::1000/116
IPNetwork Library v3.3 - Major Cleanup & Breaking Changes
Release Notes - Version 3.3
🚨 Breaking Changes
IPNetwork comparison and sort order: The comparison and sorting behavior has been updated to reflect expected standards. If your code relies on the previous sorting behavior, please review and update accordingly.
✨ New Features & Improvements
Enhanced enum support: Improved enum implementations throughout the library
TryParse functionality: Added or improved TryParse methods for better error handling
Static ListIPAddress method: New static method for listing IP addresses
Exception handling: Enhanced exception handling and error reporting
🔧 Bug Fixes
Fixed obsolete enum definitions
Corrected network sorting algorithms
Improved member comparison functionality
🧹 Code Quality
Major codebase cleanup and refactoring
Improved code organization and maintainability
Migration Guide: Review any code that depends on IPNetwork sorting or comparison operations, as the behavior has been updated to match expected industry standards.
Operator Support & Smart Network Features
This release introduces significant enhancements to IP network operations and parsing capabilities:
🧮 Mathematical Operations
Addition & Subtraction Operators: Added support for + and - operators for IP network calculations, enabling intuitive arithmetic operations on network ranges
Subtract Functionality: Enhanced network subtraction capabilities for more complex IP range manipulations
🌐 Network Intelligence Features
Network-Aware CIDR Guessing: Intelligent CIDR block detection and suggestion system that understands network topology and provides smart recommendations
Enhanced Parsing & Sanitization: Improved TryParse functionality with built-in input sanitization, making IP network parsing more robust and error-resistant
📈 Key Improvements
More intuitive API for network arithmetic operations
Smarter network range detection and processing
Better input validation and error handling
Enhanced developer experience with cleaner parsing methods
These features collectively improve the library's usability for network administrators, developers, and anyone working with IP address ranges and CIDR blocks. The mathematical operators make network calculations more intuitive, while the intelligent parsing features reduce errors and improve reliability.
Total Changes: +158 additions, -33 deletions across multiple pull requests
This release maintains backward compatibility while adding powerful new functionality for modern IP network management workflows.
bug fixes and new Parse functionnality
100% code coverage
TRAVISCI fixes
Added ClassLess parse for IPNetworks
Added some documentation to ClassLess Parse
AppVeyor
Bump dependencies version
Fixed issues …
Improved documentation
NetFramework TestUnits
Travis alternative
improve code coverage
improved documentation syntax highlighting
move to version 2+ that might not crash on build
netcore not signed on linux
remove code coverage stats
sign bienaries
update dependencies and improve code coverage
dotnetcore 2.0
imported fix and upgraded to dotnet core 2
Dotnetcore, dotnetframework & signed assemblies
Add net40, net45, net46 & signed assemblies to the dotnetcore version.
dotnetcore
v2.1.0 travis fix