nx_mdns_test.nx
buildroot/runtime/nx_mdns_test.nx
about
nx_mdns_test.nx -- offline gate for the mDNS / DNS-SD printer-discovery parser (nx_mdns).
Hand-builds a realistic mDNS `_ipp._tcp` response -- PTR + SRV + TXT + A, with NAME-COMPRESSION POINTERS
on the SRV/TXT/A owner names (exactly what real printers emit) -- then proves nx_mdns extracts the printer
tuple. Unique exit codes per invariant:
1-10 extract port=631 (SRV) + IPv4 192.168.8.127 (A) + TXT rp=ipp/print, through compression pointers
20-24 query builder emits a well-formed _ipp._tcp.local PTR question
30-31 truncated response -> sealed MALFORMED (NEVER a silent success)
40 absent record type -> NOT_FOUND (no false hit)
expect_exit: 0 ; license_tier: ORIGINAL ; genealogy_id: project-printer-management-ipp-sclass-2026-06-20
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_dns.nxnx_mdns.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 16 | func t_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 18 | func ap_u16(b: *u8, o: i64, v: i64) -> i64 { return nx_dns_put_u16_be(b, o, v) } |
| 19 | func ap_byte(b: *u8, o: i64, v: i64) -> i64 { b[o] = v as u8; return o + 1 } called by 1: main |
| 20 | func ap_label(b: *u8, o: i64, s: *u8, slen: i64) -> i64 called by 1: main |
| 26 | func ap_raw(b: *u8, o: i64, s: *u8, slen: i64) -> i64 called by 1: main |
| 32 | func main() -> i64 |