Skip to content

Releases: skrede/mdnspp

v0.3.7: Multi-Interface

21 Mar 09:13
4c9ef3c

Choose a tag to compare

New Features

  • NIC Group Orchestration (basic_nic_group)
    New type that manages mDNS instances across multiple network interfaces. Users interact with a single group object instead of manually creating and lifecycling per-interface instances. Supports announcing and monitoring services across all interfaces with unified result streams.
  • NIC Monitor (basic_nic_monitor)
    Platform-specific network interface change detection (Linux netlink, macOS SCDynamicStore, Windows NotifyIpInterfaceChange). Automatically detects interface add/remove events for dynamic multi-NIC operation.
  • Receive TTL Extraction
    IP TTL is now extracted from received packets on all platforms (Linux, macOS, Windows) for both DefaultSocket and AsioSocket, replacing the previously hardcoded value of 255. Uses recvmsg()/WSARecvMsg() with IP_RECVTTL/IPV6_RECVHOPLIMIT ancillary data.
  • recv_metadata struct
    Received packets now carry metadata (TTL, source interface) accessible via callbacks, enabling TTL-based filtering per RFC 6762 and interface-aware processing.

Bug Fixes

  • Fixed encode_dns_name not enforcing RFC 1035 max label length (63 bytes) and max wire-encoded name length (255 bytes), which could produce corrupted compression pointers.

Documentation

  • New docs: nic-group.md, api/nic_group.md, api/nic_group_options.md, api/recv_metadata.md
  • New RFC deep-dives: receive-ttl.md, legacy-unicast.md, negative-responses.md, quqm-routing.md, txt-records.md
  • New examples: NIC group usage (basic, announce+monitor, dynamic), observer TTL inspection, source interface inspection
  • Updated custom-policies and getting-started docs for new types

v0.3.6 Refactoring and increased testing

17 Mar 20:16
d0ea80a

Choose a tag to compare

All protocol timing values are now configurable. Record TTLs (per type: PTR, SRV, TXT, A, AAAA), probe/announce counts and intervals, response delays, goodbye grace periods, and TC continuation pacing can all be set through mdns_options and service_options. No hardcoded protocol constants remain in the library.

New RFC 6762 capabilities:

  • Legacy unicast responses — the server detects queries from non-standard ports and replies directly with TTL-capped records
  • Client-side TC (truncated) query splitting — large known-answer lists are automatically split across multiple packets
  • Simultaneous probe tiebreaking — conflicting probes are resolved by lexicographic comparison per §8.2
  • Receive-side TTL filtering — packets with IP TTL below receive_ttl_minimum are silently dropped (POSIX; real TTL extracted via recvmsg)

InProcPolicy for an in-process bus.

A new in-process multicast bus (mdnspp::inproc) lets you spin up multiple mDNS peers in a single process with a simulated network and controllable clock. Available as an opt-in CMake target independent of the test suite.

Fuzz testing infrastructure.

13 libFuzzer harnesses cover DNS name decompression, record parsing, full frame parsing, and round-trip encode/decode. Enabled with MDNSPP_BUILD_FUZZ_TESTS=ON (Clang only).

Documentation.

Extensive reference pages for every field in mdns_options, service_options, and cache_options. New guides for InProcPolicy, custom policy authoring, and fuzz testing. Updated RFC compliance matrix with section-level links.

Security: DNS wire format validation (fuzz-discovered)

  • encode_dns_name: enforce RFC 1035 §2.3.4 max label length (63 bytes) and
    §3.1 max name length (255 wire bytes) — prevents uint8_t truncation that
    corrupted wire format via compression pointer aliasing
  • read_dns_name: reject reserved label length range (64-191)
  • encode_txt_records: skip entries >255 bytes instead of silent truncation
  • append_dns_rr: guard against empty owner names and RDATA >65535 bytes
  • All packet builders (build_dns_response, build_dns_query, build_probe_query,
    aggregate_response): propagate encoding failures instead of emitting malformed wire

Code quality

  • Function decomposition in basic_service_server, basic_querier,
    basic_service_monitor, default_socket
  • Member variable reordering per convention
  • Include hygiene, header guard fixes, DefaultContext memory ordering
  • move_only_function migration across policy implementations
  • Encoding error propagation with detail::expected

Test reorganization

  • Monolithic test files split into per-class folder structure
    (server/, dns_wire/, monitor/, discovery/, querier/, parse/, cache/, observer/)

CI fixes

  • macOS build fixes
  • Clang build error and crashing unit test fix
  • Unused function warning suppression in test helpers

v0.3.5 RFC compliance, service monitor and record caching

12 Mar 14:59
d4a8db0

Choose a tag to compare

Summary

Introduces a 5th public type (basic_service_monitor), a standalone TTL-aware record cache, configurable multicast namespaces, and additional RFC 6762 compliance features for mDNS.

New Features

basic_service_monitor<P> — Continuous, scoped service tracking with watch/unwatch, lifecycle callbacks (added/updated/removed), and an internal record_cache. The 5th and final basic_* type, completing the public API surface.

record_cache — Standalone, pure-logic TTL-aware record store with expiry, goodbye processing (TTL=0), cache-flush bit handling (RFC 6762 §10.2), and snapshot queries. Usable independently or wired to an observer for promiscuous caching.

Configurable multicast group & port — socket_options now accepts a custom multicast endpoint, enabling isolated discovery namespaces separate from standard mDNS traffic (224.0.0.251:5353). Validated for both IPv4 and IPv6 ranges.

dns_name type — Dedicated domain name type replacing raw std::string/std::string_view for DNS names, providing normalization and FQDN handling throughout the library.

RFC 6762 Compliance

  • §5.2 Query backoff — Exponential re-query with TTL-aware refresh for continuous queries
  • §7.4 Duplicate answer suppression — Monitors multicast traffic during response delay to avoid redundant answers
  • §5.4 TC bit handling — Wait-and-concatenate accumulator for truncated responses
  • §10.2 Cache flush — cache_flush flag on records, with flush processing in record_cache

Infrastructure

  • IPv6 auto-detection — Automatic IPv4/IPv6 selection based on multicast group address
  • macOS compatibility — Refactored for compilers lagging behind on C++23 specification support
  • Documentation overhaul — New API reference pages for service_monitor, record_cache, cache_entry, cache_options, monitor_options, mdns_options, callback_types; new guides for custom policies, record cache, service monitor, mdns options; updated RFC compliance docs
  • Examples reorganized — Per-type subdirectories under examples/ with new examples for service_monitor (4) and record_cache (2)
  • New test suites — dns_name, record_cache, service_monitor, query_backoff, duplicate_answer_suppression, tc_accumulator, ttl_refresh

Refactor & further RFC compliance

10 Mar 18:54
7d14bcb

Choose a tag to compare

Stability & Reliability

  • Fixed race conditions in service shutdown, ensuring clean stop/start lifecycle across all mDNS types
  • Fixed error reporting for non-blocking send operations — failures are now surfaced through an on_error callback instead of being silently dropped
  • Fixed a compiler crash (MSVC internal error) when using service aggregation

Internal Architecture

  • Decomposed the service server into smaller, independently testable components — query matching, known-answer suppression, probing/announcing, and response aggregation are now isolated modules
  • Unified constructor patterns: all public types now share a consistent two-constructor design (throwing and non-throwing variants)

Documentation

  • Full documentation refresh — all guides, examples, and API reference updated to reflect the current API

Initial release: v0.3.1

06 Mar 11:46
f421ca0

Choose a tag to compare

v0.3.0

First public release of mdnspp as a standalone C++23 mDNS/DNS-SD library.

Highlights

  • Standalone implementation -- no external dependencies for the default policy; the original mdns C-library dependency has been removed entirely
  • Policy-based architecture -- swap socket, timer, and executor implementations at compile time (DefaultPolicy for native sockets, AsioPolicy for ASIO completion token support, MockPolicy for testing)
  • ASIO completion tokens -- callbacks, futures, coroutines (use_awaitable), and deferred operations
  • Cross-platform -- Linux, macOS, and Windows with CI coverage across GCC 13/14, Clang 18/19, MSVC 17+, and Xcode 15.4+
  • QU bit support (RFC 6762 section 5.4) -- queriers and service discovery can request unicast responses by setting unicast = true on async_query, async_discover, and async_browse; service servers detect the QU bit and route responses accordingly

API

  • observer -- passively listen to all mDNS multicast traffic
  • querier -- send mDNS queries and collec2t matching records with a configurable silence timeout
  • service_discovery -- discover services by type (async_discover for raw records, async_browse for aggregated resolved_service values)
  • service_server -- announce a service and respond to matching queries with RFC 6762-compliant random delay

Breaking changes from earlier development versions

  • Minimum Clang version bumped from 17 to 18+ due to template deduction failures in Clang 17's <tuple> implementation when used with templated operator<< overloads
  • operator<< overloads for record types, endpoint, dns_type, and dns_class are now function templates (std::basic_ostream<CharT, Traits>&) instead of inline functions taking std::ostream&; public headers use <iosfwd> instead of <ostream>
  • The move_only_function fallback (for compilers without std::move_only_function) is now a proper type-erased wrapper instead of an alias for std::function

Build requirements

  • CMake 3.25+
  • C++23 compiler: GCC 13+, Clang 18+, MSVC 17+ (/std:c++latest), or Xcode 15.4+