code wiki / (root) / nx_stun_gate.nx

nx_stun_gate.nx

buildroot/runtime/nx_stun_gate.nx

6206 B122 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic stun
docsdependenciesstructsconstsfunctions

about

nx_stun_gate.nx -- KAT the sovereign STUN codec BYTE-EXACT against the IETF's own RFC 5769 test vectors. If GREEN, our NishiLang STUN implementation interoperates with the real protocol from the first byte up: T1 CRC-32 check value: crc32("123456789") == 0xCBF43926 (proves our CRC-32 vs the standard check) T2 XOR-MAPPED-ADDRESS DECODE of the RFC 5769 2.2 sample response -> IPv4 192.0.2.1 : 32853 T3 XOR-MAPPED-ADDRESS ENCODE of 192.0.2.1:32853 -> the exact 8 attribute bytes in the sample T4 FINGERPRINT: CRC-32(first 72 bytes) XOR 0x5354554E == the sample's 0xB5BE215B T5 MESSAGE-INTEGRITY: HMAC-SHA1(password, first 48 bytes w/ len field 0x0034) == the sample's 20 bytes T6 header build+parse round-trip for a Binding Request license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_stun.nx nx_stun_gate.nx

imports: nx_syscalls.nxnx_stun.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 gw sys_write hexdec hxv st_type st_get16 st_magic st_get32 st_len st_get16 ↻ gck gw ↻ nx_crc32 gx gw ↻ sys_mmap ↻ sys_write ↻ st_xma_family st_xma_port st_get16 ↻ st_xma_addr st_get32 ↻ gn sys_mmap ↻ sys_write ↻ st_xma_encode st_put16 st_put32 beq st_fingerprint nx_crc32 ↻ st_get32 ↻ st_put16 ↻ st_message_integrity hmac_sha1 sys_mmap ↻ sha1 sys_mmap ↻

structs

none

consts

none

functions

13func gw(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 3: gxgckmain calls 1: sys_write
14func gn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
19func gx(v: i64) -> i64
called by 1: main calls 3: gwsys_mmapsys_write
23func gck(pass: i64, name: *u8, fails: *i64) -> i64
called by 1: main calls 1: gw
27func hxv(c: i64) -> i64
called by 1: hexdec
33func hexdec(hex: *u8, nbytes: i64, out: *u8) -> i64
called by 1: main calls 1: hxv
38func 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 }
called by 1: main
40func main() -> i64