Skip to content

swift-cidr 0.4.0

Latest

Choose a tag to compare

@camunro camunro released this 21 Jul 04:33
0.4.0
86dc61f

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 the ASN shorthand and backed by AF.ASN.Storage.
  • Parses and formats the RFC 5396 bare asplain decimal representation.
  • Provides numeric Codable, Hashable, Comparable, and Sendable behavior.
  • Reassigns ASN from the address-family marker alias to the AutonomousSystemNumber value; AF.ASN remains 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.sh passed with 149 tests across 19 suites.
  • Release builds passed for CIDR, CIDRPOSIX, and CIDRNIO.
  • 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.0 tag 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.