nx_mdns.nx
buildroot/runtime/nx_mdns.nx
about
nx_mdns.nx -- sovereign mDNS / DNS-SD service discovery for IPP printers (RFC 6762 + RFC 6763): the R3
"find ANY printer on the LAN" rung. REUSES the proven RFC-1035 substrate nx_dns.nx (bounded, compression-
safe name handling -- the hard part, with a 128-hop anti-cycle guard) and adds the DNS-SD layer: from a
`_ipp._tcp` response, extract a printer's SRV port, A-record IPv4, and the TXT "rp" (resource path) --
exactly the (ip, port, rp) tuple nx_printer_query needs to then talk IPP. PURE parser (no syscalls; the
caller owns every buffer) -> never-brick #26 + architecture-neutral, and no_silent_failure (a malformed
message yields a sealed MALFORMED verdict, never a false success).
LIVE NOTE (honest): mDNS is multicast (224.0.0.251:5353); WSL's NAT does NOT forward multicast to the
192.168.8 LAN, so LIVE discovery needs mirrored networking / a Windows-native radio runner. The parser +
the query builder are gateable OFFLINE now (this file); the live send/recv composes nx_udp later.
genealogy_id: project-printer-management-ipp-sclass-2026-06-20 ; license_tier: ORIGINAL
reuses: nx_dns.nx (international-research-sources/ietf/rfc_1035 + rfc_6763 DNS-SD)
dependencies 1 imports · 1 importers
imports: nx_dns.nx
imported by: nx_mdns_test.nx
structs
| none |
consts
| 18 | const NX_DNSSD_TYPE_SRV: i64 = 33 // RFC 2782 SRV (not in nx_dns.nx's type table) |
| 20 | const NX_MDNS_OK: i64 = 1 |
| 21 | const NX_MDNS_NOT_FOUND: i64 = 2 |
| 22 | const NX_MDNS_MALFORMED: i64 = 3 |
functions
| 24 | func nx_mdns_verdict_is_valid(v: i64) -> i64 called by 1: main |
| 33 | func nx_mdns_find_rr(buf: *u8, n: i64, want_type: i64, out_rdoff: *i64, out_rdlen: *i64) -> i64 |
| 72 | func nx_mdns_srv_port(buf: *u8, rdoff: i64, rdlen: i64, out_port: *i64) -> i64 |
| 79 | func nx_mdns_a_ip(buf: *u8, rdoff: i64, rdlen: i64, out4: *i64) -> i64 called by 1: nx_mdns_extract_printer |
| 89 | func nx_mdns_txt_get(buf: *u8, rdoff: i64, rdlen: i64, key: *u8, klen: i64, out: *u8, cap: i64, out_len: *i64) -> i64 called by 1: nx_mdns_extract_printer |
| 124 | func nx_mdns_extract_printer(buf: *u8, n: i64, out5: *i64, rp_out: *u8, rp_cap: i64, rp_len: *i64, scratch2: *i64) -> i64 |
| 141 | func nx_mdns_build_ipp_query(out: *u8, out_cap: i64, tx_id: i64) -> i64 |