code wiki / _hdl_build / nx_connect_call.nx

nx_connect_call.nx

buildroot/runtime/_hdl_build/nx_connect_call.nx

7230 B149 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic connect
docsdependenciesstructsconstsfunctions

about

nx_connect_call.nx -- FUNCTIONALITY rung: call SESSION SIGNALING (the control plane of voice/ video calls) + group call rooms. This is the gateable LOGIC of calling -- the media plane (audio/video codec + transport) is a separate substrate and stays ABSENT in the census until built. 1:1 call state machine (valid transitions ONLY): IDLE -> RINGING -> CONNECTED -> ENDED, with RINGING -> REJECTED (callee) / CANCELLED (caller) / and illegal jumps refused. Actor rules: only the callee accepts/rejects; only the caller cancels; either ends a connected call. SAFETY by construction: you cannot cold-call a non-contact and cannot call a BLOCKED user (anti-harassment). Group rooms: host create / join / leave / host-only end. 7 checks incl. negative controls. 100% sovereign. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_connect_call.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap call_initiate call_accept call_end call_reject call_cancel room_create room_join room_find room_leave room_find ↻ room_end sw sys_write sn sys_mmap ↻ sys_write ↻ tcheck sw ↻ sys_exit

structs

none

consts

13const C_IDLE: i64 = 0
14const C_RINGING: i64 = 1
15const C_CONNECTED:i64 = 2
16const C_ENDED: i64 = 3
17const C_REJECTED: i64 = 4
18const C_CANCELLED:i64 = 5

functions

21func sw(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 2: tcheckmain calls 1: sys_write
22func sn(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 1: main calls 2: sys_mmapsys_write
25func call_initiate(c: *i64, caller: i64, callee: i64, rel: i64, blocked: i64) -> i64
called by 1: main
32func call_accept(c: *i64, actor: i64) -> i64
called by 1: main
37func call_reject(c: *i64, actor: i64) -> i64
called by 1: main
42func call_cancel(c: *i64, actor: i64) -> i64
called by 1: main
47func call_end(c: *i64, actor: i64) -> i64
called by 1: main
54func room_create(r: *i64, mem: *i64, host: i64) -> i64 { r[0]=host; r[1]=1; mem[0]=host; return 0 }
called by 1: main
55func room_find(r: *i64, mem: *i64, uid: i64) -> i64 { var i: i64=0; while i<r[1] { if mem[i]==uid { return i } i=i+1 } return 0-1 }
called by 2: room_joinroom_leave
56func room_join(r: *i64, mem: *i64, uid: i64) -> i64 { if room_find(r,mem,uid)>=0 { return 1 } let c: i64=r[1]; mem[c]=uid; r[1]=c+1; return 1 }
called by 1: main calls 1: room_find
57func room_leave(r: *i64, mem: *i64, uid: i64) -> i64 { let idx: i64=room_find(r,mem,uid); if idx<0 { return 0 } let c: i64=r[1]; mem[idx]=mem[c-1]; r[1]=c-1; return 1 }
called by 1: main calls 1: room_find
58func room_end(r: *i64, mem: *i64, actor: i64) -> i64 { if actor!=r[0] { return 0 } r[1]=0; return 1 }
called by 1: main
60func tcheck(pass: i64, label: *u8, fails: *i64) -> i64
called by 1: main calls 1: sw
66func main() -> i64