Skip to content

Releases: lduchosal/ipnetwork

IPNetwork2 v4.0.2

08 Mar 14:44

Choose a tag to compare

IPNetwork2 v4.0.2

Changes since 4.0.1

  • Removed obsolete static methods that had instance equivalents: Contains, Overlap, Print, Subnet, TrySubnet, Supernet, TrySupernet, IsIANAReserved(IPNetwork2)
  • Removed FilterEnum enum and ListIPAddress(FilterEnum) overload — use Filter and ListIPAddress(Filter) instead
  • Fixed Dependabot configuration (directory //src)
  • Removed unused files (.vscode/, qodana.yaml)
  • Added .DS_Store and .vscode/ to .gitignore

Full changelog since 3.x

See v4.0.1 release notes for the complete list of breaking changes and improvements in the 4.0 series.


❤️ Support the project

IPNetwork2 is free and open source. If it saves you time or you use it in production, consider supporting its development:

Thank you!

IPNetwork2 v4.0.1

07 Mar 20:45
ec127fb

Choose a tag to compare

IPNetwork2 v4.0.1

Breaking Changes

Target Framework

  • Dropped netstandard2.0 and System.Memory dependency
  • Supported targets: net8.0, net9.0, net10.0, netstandard2.1

Nullable Reference Types

  • Enabled <Nullable>enable</Nullable> with TreatWarningsAsErrors
  • All public API methods now have proper nullability annotations (?, [NotNullWhen(true)])
  • Consumers may see new compiler warnings if passing nullable types without null checks

Removed Obsolete Methods

  • Removed deprecated static methods that have instance equivalents: Contains, Overlap, Subnet, TrySubnet, Supernet, TrySupernet, Print, IsIANAReserved(IPNetwork2)
  • Removed FilterEnum enum and ListIPAddress(FilterEnum) overload
  • Use the instance methods instead

IANA Reserved Blocks (#376)

  • IsIANAReserved() now returns true for many more addresses — applications relying on the previous (incomplete) behavior may be affected
  • Added 11 IPv4 reserved blocks: This network (0.0.0.0/8), Loopback (127.0.0.0/8), Link-local (169.254.0.0/16), IETF Protocol (192.0.0.0/24), TEST-NET-1/2/3, Benchmarking (198.18.0.0/15), Multicast (224.0.0.0/4), Reserved (240.0.0.0/4), Broadcast (255.255.255.255/32)
  • Added 9 IPv6 reserved blocks: Unspecified (::/128), Loopback (::1/128), IPv4-mapped (::ffff:0:0/96), IPv4/IPv6 translation (64:ff9b::/96), TEREDO (2001::/32), Documentation (2001:db8::/32), Unique local (fc00::/7), Link-local (fe80::/10), Multicast (ff00::/8)
  • IsIANAReserved() now supports IPv6 addresses and networks natively

Improvements

Code Quality

  • Enabled EnforceCodeStyleInBuild and WarningLevel 5
  • Fixed CA2208: descriptive messages for all ArgumentException instances
  • Fixed IDE0041: pattern matching is null instead of ReferenceEquals
  • Fixed IDE0056: index-from-end operator [^1]
  • Fixed CA1847: string.Contains(char) instead of string.Contains(string)
  • Fixed CA1850: static SHA256.HashData on .NET 5+ targets
  • Fixed SA1507: removed multiple consecutive blank lines
  • Refactored InternalToNetmask and InternalSubnet from void to bool with [NotNullWhen(true)] — eliminated null-forgiving operators

Tests

  • Fixed MSTEST0051: Assert.ThrowsExactly lambdas now contain single statements
  • Fixed S2699: added missing assertions to 11 test methods
  • Removed obsolete #pragma warning disable 0618 pragmas
  • Added 72 new tests for IANA reserved blocks
  • 1298 tests, all passing

Misc

  • Fixed typo: sanitanizesanitize
  • Added .DS_Store to .gitignore

❤️ Support the project

IPNetwork2 is free and open source. If it saves you time or you use it in production, consider supporting its development:

Thank you!

IPNetwork2 v4.0.0

07 Mar 20:51
f6b1469

Choose a tag to compare

⚠️ Recommended upgrade: please use v4.0.1

Version 4.0.0 mistakenly kept the obsolete static methods (Contains, Overlap, Print, Subnet, Supernet, etc.) instead of removing them. Version 4.0.1 properly removes these methods.

If you are migrating from 3.x, go directly to 4.0.1.

3.5.3

06 Mar 22:39

Choose a tag to compare

Full Changelog: 3.5.2...3.5.3

3.5.2

06 Mar 21:59

Choose a tag to compare

Full Changelog: 3.5.1...3.5.2

3.5.1

06 Mar 21:42

Choose a tag to compare

Full Changelog: 3.5...3.5.1

3.5

06 Mar 21:07

Choose a tag to compare

3.5

What's Changed

Full Changelog: 3.4...3.5

ParseRange & TryParseRange

17 Aug 15:11
e4829c1

Choose a tag to compare

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

17 Aug 09:32
0d02478

Choose a tag to compare

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

⚠️ Important: This release contains breaking changes, particularly around IPNetwork comparison and sorting. Please test thoroughly before upgrading production systems.
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

15 Aug 12:34
ac2717f

Choose a tag to compare

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.