code wiki / _hdl_build / nx_dgram_media_gate.nx
nx_dgram_media_gate.nx
buildroot/runtime/_hdl_build/nx_dgram_media_gate.nx
about
nx_dgram_media_gate.nx -- proves the SOVEREIGN datagram media wire (nx_dgram_media, task #15 R1) under
the conditions UDP actually delivers: LOSS, REORDER, DUPLICATION -- the in-process netem-class proof,
fully sovereign. Frames must reassemble BIT-EXACT; gaps must surface as NACKs; the NACK wire must round-
trip; retransmits must complete the set with NO double-delivery; hostile packets must be refused without
corrupting state. Deterministic PRNG (seeded LCG -- reproducible, no Math.random). 0=GREEN / 1=RED.
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_dgram_media.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
| 9 | 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 } |
| 10 | func g_n(v: i64) -> i64 |
| 14 | func chk(cond: i64, name: *u8, pp: *i64, tp: *i64) -> i64 |
| 18 | func beq(a: *u8, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 } |
| 19 | func fill(dst: *u8, n: i64, key: i64) -> i64 { var i: i64=0; while i<n { dst[i]=(((i*31)+(key*77)+((i>>5)*13))&255) as u8; i=i+1 } return 0 } called by 1: main |
| 22 | func rnd(state: *i64) -> i64 { state[0] = (state[0] * 1103515245 + 12345) & 0x7fffffff; return (state[0] >> 16) & 0x7fff } called by 1: channel |
| 26 | func channel(stream: *u8, npkts: i64, loss_pct: i64, dup3: i64, swap2: i64, st: *i64, |
| 73 | func main() -> i64 |