Releases: VladimirShaleev/ipaddress
v1.2.1
Fixed
- Fixed C++ modules compatibility with GCC 15.2 (Issue #11).
- Fixed template specialization
exportsyntax for C++ modules to comply with latest standards;
Full Changelog: v1.2.0...v1.2.1
v1.2.0
What's Changed
-
Added
ipv6_mapped()toipv4_addressandip_address:std::cout << ipv4_address::parse("192.168.1.1").ipv6_mapped() << std::endl; // Output ::ffff:c0a8:101
-
Added
summarize_address_range(). Summarizes a given range of IP addresses into the smallest set of contiguous network blocks:for (const auto& net : summarize_address_range( ipv4_address::parse("192.168.1.0"), ipv4_address::parse("192.168.1.255"))) { std::cout << net << std::endl; } // Output 192.168.1.0/24
For details, please refer to the documentation
-
Added
collapse_addresses(). Collapses a collection of IP networks into the smallest set of contiguous networks:std::vector<ip_network> nets = { ip_network::parse("192.0.2.0/25"), ip_network::parse("192.0.3.0/25"), ip_network::parse("192.0.2.128/25") }; for (const auto& net : collapse_addresses(nets.begin(), nets.end())) { std::cout << net << std::endl; } // Output: // 192.0.2.0/24 // 192.0.3.0/25For details, please refer to the documentation
Fixed
- Refined
is_private()logic to align with current IANA standards:- Adjusted private IP detection based on IANA special-purpose registries:
192.0.0.0/24is now classified as private, except192.0.0.9/32and192.0.0.10/32.- Included
64:ff9b:1::/48(NAT64) and2002::/16(6to4) as private ranges. - Excluded public subnets within
2001::/23(IETF Protocol Assignments).
- Aligns with IANA special-purpose registries.
- Backward-compatible; no breaking changes for valid use cases.
- Adjusted private IP detection based on IANA special-purpose registries:
- Relaxed scope ID validation when
IPADDRESS_NO_IPV6_SCOPEis set: parsing no longer raises an error for addresses with a scope ID whenIPADDRESS_NO_IPV6_SCOPEis set; instead, correctness is verified, but the scope ID is omitted from the final IP address.
Full Changelog: v1.1.0...v1.2.0
v1.1.0
What's Changed
Implemented Unicode support
Unicode support now includes parsing and conversion of IP addresses across various encodings (UTF-8, UTF-16, UTF-32, and wide characters).
Enhanced error messaging for invalid IP address characters, including Unicode symbols. Now, if an incoming string contains invalid IP address characters, the error message will provide a clearer description of the error cause:
try
{
ipaddress::ipv4_address::parse(u"127.猫.\U00010348.1");
}
catch (const std::exception &exc)
{
std::cout << exc.what() << std::endl;
// Output: unexpected next unicode symbol {U+732b} in string 127.{U+732b}.{U+10348}.1
}Support for C++20 modules.
#include <iostream>
import ipaddress;
int main() {
auto ip = ipaddress::ipv4_address::parse<"127.0.0.1">();
std::cout << ip << std::endl;
return 0;
}Note
The C++ module is disabled by default and is not currently available through package managers. For detailed instructions on how to use the module, please consult the documentation.
Fixed
- Resolved constant expression issues within certain toolchains that were causing breakdowns in the constant expression evaluator for code editor hints (such as IntelliSense, etc.);
- Whitespace characters in the scope id are now considered invalid by default.
Full Changelog: v1.0.1...v1.1.0
v1.0.1
Fixed
- The CMake IPADDRESS_NO_IPV6_SCOPE property had no effect;
- Fixed overwriting of CMake properties in the ipaddress-config;
- Fixed compilation error when scope id is disabled (IPADDRESS_NO_IPV6_SCOPE) in set_scope_id() member functions.
Full Changelog: v1.0.0...v1.0.1
v1.0.0
The first release
This release includes implementations for working with ipv4 and ipv6 addresses and networks, through such classes as:
ipv4_address,ipv6_addressandip_address;ipv4_network,ipv6_networkandip_network.
Despite the fact that this library is similar in functionality to boost asio for working with ip-addresses, it provides more features for working with networks. These are such functions as:
- enumerating addresses in a network;
- get supernet and subnets;
- excluding one network from another network.
The performance of parsing ipv4 and pv6 addresses exceeds the boost implementation on macOS and Windows platforms.
On Linux systems, parsing ipv4 is usually faster than in boost. But unfortunately in this release, the speed of parsing ipv6 loses to the boost implementation on Linux systems.