code wiki / (root) / nx_ipp_transport.nx

nx_ipp_transport.nx

buildroot/runtime/nx_ipp_transport.nx

12141 B287 linesdepth 5pulls 7 transitivereach 14 importersview sourcekind librarytopic ipp
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_connect.nx nx_ipp_codec.nx nx_http_dechunk.nx nx_ipp_transport.nx nx_doc_print.nx nx_escl_probe.nx nx_img_print.nx nx_ipp_transport_test.nx nx_job_poll.nx nx_print_send.nx nx_print_validate.nx nx_printer_conform_live.nx nx_printer_dump.nx nx_printer_ports.nx

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

22const NX_MAGIC_2048: i64 = 2048
23const NX_MAGIC_4096: i64 = 4096
24const NX_MAGIC_1024: i64 = 1024
27const NX_IPT_OK: i64 = 1
28const NX_IPT_CONN_FAIL: i64 = 2 // socket/connect failed -> printer down / unreachable
29const NX_IPT_NO_RESP: i64 = 3 // connected but nothing back within timeout -> hung
30const NX_IPT_BAD_HTTP: i64 = 4 // reply had no HTTP header terminator -> garbage / wrong service
31const NX_IPT_DECHUNK_FAIL: i64 = 5 // chunked body malformed
32const NX_IPT_TRUNC: i64 = 6 // body did not fit the caller buffer
33const NX_IPT_VERDICT_N: i64 = 7

functions

35func nx_ipt_verdict_name(v: i64) -> *u8
47func nx_ipt_sockaddr(buf: *u8, a: i64, b: i64, c: i64, d: i64, port: i64) -> i64
57func nx_ipt_puts(buf: *u8, off: i64, s: *u8) -> i64
64func nx_ipt_puti(buf: *u8, off: i64, v: i64) -> i64
called by 3: mainhttp_getmain calls 1: sys_mmap
76func nx_ipt_lc(ch: i64) -> i64
called by 1: nx_ipt_ci_find
82func nx_ipt_ci_find(buf: *u8, n: i64, pat: *u8) -> i64
105func nx_ipt_http_status(buf: *u8, n: i64) -> i64
127func nx_ipt_build_request(req: *u8, a: i64, b: i64, c: i64, d: i64, path: *u8) -> i64
called by 1: main calls 2: sys_mmapnx_ipt_puts
149func nx_ipt_extract_body(resp_buf: *u8, total: i64, body_buf: *u8, body_cap: i64, out2: *i64) -> i64
175func nx_ipt_query_printer(a: i64, b: i64, c: i64, d: i64, port: i64, path: *u8,
227func nx_ipt_send_all(fd: i64, buf: *u8, len: i64) -> i64
245func nx_ipt_post_ipp(a: i64, b: i64, c: i64, d: i64, port: i64, path: *u8,