Skip to content

PingKit 0.5.0

Choose a tag to compare

@gewill gewill released this 14 Jul 04:20
· 20 commits to main since this release

PingKit 0.5.0 adds dual-stack IPv6 ping and a formal pingkit CLI, and
folds in the previously unreleased 0.4.0 work (outgoing TTL + .sent
events). This is a breaking minor: see below before upgrading.

Highlights

IPv6 ping (dual-stack)

  • Full ICMPv6 echo over unprivileged datagram sockets, with hop-limit
    ancillary data and source address via recvmsg.
  • PingConfiguration.AddressFamily.automatic (follows the system's
    getaddrinfo ordering, so hostnames resolve over DNS64/NAT64), .ipv4,
    or .ipv6. IPv6 literals and scoped link-local addresses are supported.
  • ICMPv6 Destination Unreachable, Time Exceeded, Packet Too Big, and
    Parameter Problem map to typed PingResponse events.
  • On Darwin the socket sets ICMP6_FILTER so it only wakes for the
    message types ping consumes (not NDP/RA multicast).
  • Tracer remains IPv4-only in this release.

Outgoing TTL / hop limit (was 0.4.0)

  • PingConfiguration.timeToLive (1...255; nil keeps the system default),
    applied as IPv4 TTL or IPv6 unicast hop limit.
  • CLI -m sets the outgoing TTL in ping mode.

.sent probe events (was 0.4.0)

  • PingResponse.sent(sequence:) fires as each echo request leaves the
    socket, before that sequence's terminal event — so a UI can insert a
    pending row per probe and update it in place.

Formal CLI

  • swift-argument-parser-based pingkit command with ping / trace
    subcommands, typed validation, and generated help. -4 / -6 force the
    address family. The dependency links only into the CLI target; the
    PingKit library stays zero-dependency.

Breaking changes

  • PingReply.from is now IPAddress (was IPv4Endpoint).
  • PingResponse gains .sent, .packetTooBig, and .parameterProblem
    cases — exhaustive switches must handle them.
  • The executable product is named pingkit-cli (the command is still
    pingkit); the old ping-cli product is removed.

Notes

  • unreachable(code:) codes are numbered differently by IPv4 vs IPv6;
    interpret code according to the address family the run resolved to.
  • Verified on macOS, iOS Simulator (including ICMPv6 loopback integration
    tests), and Linux Swift 6.0 / 6.1.