code wiki / _hdl_build / nx_lan_signup_socket_gate.nx
nx_lan_signup_socket_gate.nx
buildroot/runtime/_hdl_build/nx_lan_signup_socket_gate.nx
about
nx_lan_signup_socket_gate.nx -- proves the LAN-signup daemon's REAL router (lsd_route) end-to-end over a loopback
socket with a live OPAQUE context. Forks a server child that runs the EXACT daemon path (accept_with_addr ->
ls_ip4_from_sockaddr -> lsd_route) and a sovereign client that connects from loopback. Asserts:
(1) an INVITED handle from the LAN peer -> 200 + recovery mnemonic (full OPAQUE register + hra_claim over the wire);
(2) a NON-invited handle -> 403 (the invite gate runs on a real socket);
(3) GET /hr with NO session -> the owner-only stub, leaking NO roster (the /hr console is owner-gated by default-deny).
This closes "compiles" -> "works" for the new accept_with_addr plumbing AND the live /hr gating. license_tier: ORIGINAL expect_exit: 0
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nxnx_lan_signup_routes.nxnx_opaque_login.nxnx_lan_signup.nxnx_hr_admin.nxnx_runpath.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 g_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 17 | func g_n(v: i64) -> i64 { var m: i64=v; if m<0{g_w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 18 | func g_row(id: *u8, ok: i64, pass: *i64) -> i64 { g_w(" " as *u8); g_w(id); g_w(": " as *u8); if ok==1 { g_w("OK\n" as *u8); pass[0]=pass[0]+1 } else { g_w("FAIL\n" as *u8) } return 0 } |
| 19 | func sgt_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o } |
| 20 | func sgt_itoa(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var o: i64=off; var q: i64=k-1; while q>=0{dst[o]=t[q];o=o+1;q=q-1} return o } |
| 21 | func sgt_find(buf: *u8, n: i64, needle: *u8, nl: i64) -> i64 { if nl==0 {return 0} var i: i64=0; while i+nl<=n { var j: i64=0; var ok: i64=1; while j<nl { if buf[i+j]!=needle[j]{ok=0;j=nl} else {j=j+1} } if ok==1 {return i} i=i+1 } return 0-1 } |
| 22 | func sgt_has(buf: *u8, n: i64, needle: *u8) -> i64 { var nl: i64=0; while needle[nl]!=(0 as u8){nl=nl+1} if sgt_find(buf,n,needle,nl)>=0 {return 1} return 0 } |
| 23 | func sgt_nap(ms: i64) -> i64 { let ts: *i64 = sys_mmap(16) as *i64; ts[0]=0; ts[1]=ms*1000000; __syscall(35, ts as i64, 0, 0, 0, 0, 0); return 0 } |
| 24 | func sgt_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: build_post |
| 27 | func build_post(path: *u8, body: *u8, out: *u8) -> i64 |
| 38 | func cg_send(port: i64, raw: *u8, rawlen: i64, resp: *u8, cap: i64) -> i64 |
| 64 | func serve_one(ctx: *NxAuthContext, lfd: i64, hr: *u8) -> i64 called by 1: main calls 9: sys_mmapsys_accept_with_addrsys_set_socket_timeoutls_ip4_from_sockaddrsys_readsgt_find+3 |
| 81 | func main() -> i64 |