Summary
swift-cidr 0.4.0 adds AutonomousSystemNumber, a canonical value-semantic representation of the complete four-octet AS-number space.
Highlights
- Adds
AutonomousSystemNumber, also available through theASNshorthand and backed byAF.ASN.Storage. - Parses and formats the RFC 5396 bare
asplaindecimal representation. - Provides numeric
Codable,Hashable,Comparable, andSendablebehavior. - Reassigns
ASNfrom the address-family marker alias to theAutonomousSystemNumbervalue;AF.ASNremains the explicit marker type. - Keeps RPSL
AS-prefixed text, registry status, and routing-policy validation outside the numeric core value.
Compatibility
This release contains one source-breaking API correction: the public ASN alias now names AutonomousSystemNumber instead of AF.ASN. Code that used ASN as an address-family marker must use the explicit AF.ASN spelling.
Marker-oriented calls migrate as follows:
ASN.self -> AF.ASN.self
ASN.parseAddress(text) -> AF.ASN.parseAddress(text)
ASN.formatAddress(rawValue) -> AF.ASN.formatAddress(rawValue)
New value-oriented code can construct ASN(rawValue) or parse ASN(text). Apart from the alias reassignment, this release does not change the existing IP, prefix, network, endpoint, multicast, POSIX, or SwiftNIO APIs. No platform or Swift tools version increase is required.
Validation
- macOS:
./scripts/test.shpassed with 149 tests across 19 suites. - Release builds passed for
CIDR,CIDRPOSIX, andCIDRNIO. - Linux x86_64 under Swift 6.3.1 passed 149 tests across 19 suites.
- Linux profiling, standard, CPU, and NIO benchmark targets built successfully.
- All five new ASN benchmark thresholds passed.
- The annotated
0.4.0tag is SSH-signed and verified.
The package-wide local benchmark sweep also exercised the new cases successfully but reported unrelated, pre-existing host-sensitive wall-clock deviations. No unrelated thresholds were changed.