code wiki / _hdl_build / nx_uiq_wire_lib.nx

nx_uiq_wire_lib.nx

buildroot/runtime/_hdl_build/nx_uiq_wire_lib.nx

9342 B188 linesdepth 3pulls 3 transitivereach 2 importersview sourcekind librarytopic uiq
docsdependenciesstructsconstsfunctions

about

nx_uiq_wire_lib.nx -- FROM THE FIRST BYTE UP: the wire/response layer of experiential testing. Every other uiq organ starts at the HTML source or the rendered pixels; this one starts at BYTE 0 of the HTTP response -- the status line + headers the edge emits BEFORE any body. Audits the SOTA security/quality header posture (OWASP Secure Headers / web.dev): Content-Type(+charset), X-Content-Type-Options:nosniff, X-Frame-Options|CSP frame-ancestors (clickjacking), Content-Security-Policy (the defense-in-depth that neutralises stored injection BEFORE escaping), Referrer-Policy, Strict-Transport-Security (HSTS). Parses a captured raw response (status line + headers up to the blank line); the fetch is the already-sovereign nx_https_get (compose, don't rebuild). HONEST ENVELOPE (in output): header PRESENCE + a coarse CSP-strength read; it does NOT execute the CSP or prove the policy is tight -- presence is the floor, not proof. license_tier: ORIGINAL genealogy: experiential wire layer

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_itoa_lib.nx nx_uiq_wire_lib.nx nx_uiq_wire.nx nx_uiq_wire_gate.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nx_uiq_wire.nxnx_uiq_wire_gate.nx

structs

none

consts

13const UW_MAGIC_1024: i64 = 1024
14const UW_MAGIC_8192: i64 = 8192
15const UW_MAGIC_8191: i64 = 8191
16const UW_MAGIC_4096: i64 = 4096
17const UW_MAGIC_4095: i64 = 4095
19const UW_SEC_TOTAL: i64 = 5 // the 5 scored security headers

functions

21func uw_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
26func uw_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
27func uw_cat(d: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; var o: i64=off; while s[i]!=(0 as u8){d[o]=s[i]; o=o+1; i=i+1} return o }
called by 1: uw_emit
28func uw_catn(d: *u8, off: i64, v: i64) -> i64
called by 1: uw_emit calls 1: sys_mmap
33func uw_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
34func uw_lc(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c }
37func uw_hdr_end(buf: *u8, n: i64) -> i64
called by 1: uw_audit
46func uw_has(buf: *u8, hn: i64, name: *u8) -> i64
called by 1: uw_audit calls 2: uw_lenuw_lc
64func uw_val_has(buf: *u8, hn: i64, name: *u8, needle: *u8) -> i64
called by 1: uw_audit calls 2: uw_lenuw_lc
92func uw_status(buf: *u8, n: i64) -> i64
called by 1: uw_audit
99func uw_audit(buf: *u8, n: i64, out: *i64) -> i64
114func uw_slurp(path: *u8, buf: *u8, cap: i64) -> i64
124func uw_emit(label: *u8, out: *i64) -> i64
called by 1: main calls 4: sys_mmapuw_catuw_catnsys_write
152func uw_write_kat(path: *u8, body: *u8) -> i64
160func uw_selftest() -> i64