code wiki / _hdl_build / nx_lan_signup_gate.nx

nx_lan_signup_gate.nx

buildroot/runtime/_hdl_build/nx_lan_signup_gate.nx

6329 B76 linesdepth 13pulls 24 transitivereach 0 importersview sourcekind gate/prooftopic lan
docsdependenciesstructsconstsfunctions

about

nx_lan_signup_gate.nx -- referee for the BY-CONSTRUCTION signup gate (nx_lan_signup). PROVES: * ls_ip_is_lan classifies RFC1918 + loopback as LAN and every near-miss (11.x, 172.15/172.32, 192.169, TEST-NET 203.0.113.x, 8.8.8.8) as WAN ; * ls_signup_allowed = ALLOW only when LAN AND invited, with the decisive leak-checks: - an INVITED handle from a WAN address is DENIED (the "only on LAN" guarantee -- a flag can't open it) ; - a LAN stranger (un-invited handle) is DENIED (the "only the family" guarantee) ; - a handle already CLAIMED (active) is DENIED from the LAN (re-registration blocked) ; - loopback (the publisher's own proxy) is allowed for an invited handle. GREEN iff every row matches. Durable -> knowledge/status/lan_signup_gate.log.

dependencies 4 imports · 0 importers

nx_lan_signup.nx nx_g_puts_lib.nx nx_hr_admin.nx nx_syscalls.nx nx_lan_signup_gate.nx

imports: nx_lan_signup.nxnx_g_puts_lib.nxnx_hr_admin.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main g_puts sys_write sys_mmap g_ip4 chk g_puts ↻ g_num sys_mmap ↻ sys_write ↻ ls_ip_is_lan g_mkpfx sys_mmap ↻ sys_now_ms sys_mmap ↻ sys_clock_gettime_mono hra_invite hrs_invite hrs_cred_id sys_mmap ↻ nx_ncs_derive_user_id_hash sys_mmap ↻ hrs_hexenc hrs_put_indexed hrs_seg_committed sys_mmap ↻ ss_manifest ss_manifest_file hrs_itoa sys_mmap ↻ hrs_streq hrs_status_code sys_mmap ↻ hrs_get ss_open sys_mmap ↻ ss_hget canon_decode hrs_field hrs_streq ↻

structs

none

consts

none

functions

15func g_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); 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; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 2: chkmain calls 2: sys_mmapsys_write
16func g_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main calls 1: sys_write
17func g_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); 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; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
18func gtrunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd>=0 { sys_close(fd) } return 0 }
19func g_mkpfx(base: *u8, ms: i64, out: *u8) -> i64 { var o: i64=0; while base[o]!=(0 as u8){out[o]=base[o];o=o+1} let t: *u8=sys_mmap(28); var m: i64=ms; 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 z: i64=k-1; while z>=0{out[o]=t[z];o=o+1;z=z-1} out[o]=0 as u8; return o }
called by 1: main calls 1: sys_mmap
20func g_ip4(out: *u8, a: i64, b: i64, c: i64, d: i64) -> i64 { out[0]=a as u8; out[1]=b as u8; out[2]=c as u8; out[3]=d as u8; return 0 }
called by 1: main
21func chk(got: i64, want: i64, label: *u8) -> i64
called by 1: main calls 2: g_putsg_num
27func main() -> i64