nx_ipp_transport.nx
buildroot/runtime/nx_ipp_transport.nx
about
nx_ipp_transport.nx -- sovereign IPP-over-HTTP transport (R2): talk to ANY real IPP printer.
IPP operations ride on HTTP POST with Content-Type: application/ipp to the printer's IPP endpoint
(cleartext on TCP 631). This builds a Get-Printer-Attributes request with the R0 codec, POSTs it over
a raw sovereign TCP socket (reusing the nx_health_probe connect+timeout pattern), reads the reply with
a BOUNDED timeout (graceful #14 -- never hangs), strips the HTTP framing, de-chunks if needed
(nx_http_dechunk), and hands the IPP response body back for nx_printer_health to diagnose.
NEVER-BRICK (#26): this only issues a READ-ONLY Get-Printer-Attributes query. It writes no job, no
setting, no firmware. Safe by construction.
no_silent_failure: every failure path returns a distinct sealed verdict (conn fail / no response /
bad http / dechunk fail / truncated) -- a dead or misbehaving printer is reported, never hidden.
Sovereign: own TCP + own HTTP framing; nx_cc -> nxasm, no curl/wget/gcc.
genealogy_id: project-printer-management-ipp-sclass-2026-06-20
license_tier: ORIGINAL
dependencies 4 imports · 14 importers
diagram shows first 10 each side; +0 more imports, +4 more importers in the complete lists below.
imports: nx_syscalls.nxnx_connect.nxnx_ipp_codec.nxnx_http_dechunk.nx
imported by: nx_doc_print.nxnx_escl_probe.nxnx_img_print.nxnx_ipp_transport_test.nxnx_job_poll.nxnx_print_send.nxnx_print_validate.nxnx_printer_conform_live.nxnx_printer_dump.nxnx_printer_ports.nxnx_printer_query.nxnx_printer_web_probe.nxnx_printers_page.nxnx_toner_continue.nx
structs
| none |
consts
| 22 | const NX_MAGIC_2048: i64 = 2048 |
| 23 | const NX_MAGIC_4096: i64 = 4096 |
| 24 | const NX_MAGIC_1024: i64 = 1024 |
| 27 | const NX_IPT_OK: i64 = 1 |
| 28 | const NX_IPT_CONN_FAIL: i64 = 2 // socket/connect failed -> printer down / unreachable |
| 29 | const NX_IPT_NO_RESP: i64 = 3 // connected but nothing back within timeout -> hung |
| 30 | const NX_IPT_BAD_HTTP: i64 = 4 // reply had no HTTP header terminator -> garbage / wrong service |
| 31 | const NX_IPT_DECHUNK_FAIL: i64 = 5 // chunked body malformed |
| 32 | const NX_IPT_TRUNC: i64 = 6 // body did not fit the caller buffer |
| 33 | const NX_IPT_VERDICT_N: i64 = 7 |
functions
| 35 | func nx_ipt_verdict_name(v: i64) -> *u8 |
| 47 | func nx_ipt_sockaddr(buf: *u8, a: i64, b: i64, c: i64, d: i64, port: i64) -> i64 |
| 57 | func nx_ipt_puts(buf: *u8, off: i64, s: *u8) -> i64 |
| 64 | func nx_ipt_puti(buf: *u8, off: i64, v: i64) -> i64 |
| 76 | func nx_ipt_lc(ch: i64) -> i64 called by 1: nx_ipt_ci_find |
| 82 | func nx_ipt_ci_find(buf: *u8, n: i64, pat: *u8) -> i64 |
| 105 | func nx_ipt_http_status(buf: *u8, n: i64) -> i64 |
| 127 | func nx_ipt_build_request(req: *u8, a: i64, b: i64, c: i64, d: i64, path: *u8) -> i64 |
| 149 | func nx_ipt_extract_body(resp_buf: *u8, total: i64, body_buf: *u8, body_cap: i64, out2: *i64) -> i64 |
| 175 | func nx_ipt_query_printer(a: i64, b: i64, c: i64, d: i64, port: i64, path: *u8, |
| 227 | func nx_ipt_send_all(fd: i64, buf: *u8, len: i64) -> i64 |
| 245 | func nx_ipt_post_ipp(a: i64, b: i64, c: i64, d: i64, port: i64, path: *u8, |