nx_stun_client_gate.nx
buildroot/runtime/nx_stun_client_gate.nx
about
nx_stun_client_gate.nx -- proves the sovereign STUN client two ways:
PART A (pure): sc_find_xma walks a real STUN response (RFC 5769 2.2, where XOR-MAPPED-ADDRESS is NOT the
first attribute) and locates it, decoding 192.0.2.1:32853; a response with no XMA returns -1; the
dotted-quad parser accepts valid IPs and rejects malformed ones.
PART B (LIVE, real UDP): a fork loopback -- child = an inline reflexive responder, parent = sc_query --
proves sc_query performs a real Binding request/response round-trip and RECOVERS a reflexive address.
The server side is inlined from nx_stun primitives (not imported) to avoid a diamond import of nx_stun.
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_stun_client.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
| 43 | const CGT_SPORT: i64 = 53230 |
functions
| 12 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 13 | func gn(v: i64) -> i64 |
| 18 | func gck(pass: i64, name: *u8, fails: *i64) -> i64 |
| 22 | func hxv(c: i64) -> i64 called by 1: hexdec |
| 28 | func hexdec(hex: *u8, nbytes: i64, out: *u8) -> i64 { var i: i64=0; while i<nbytes { out[i]=((hxv(hex[i*2] as i64)<<4) | hxv(hex[i*2+1] as i64)) as u8; i=i+1 } return 0 } |
| 31 | func g_respond(buf: *u8, txid: *u8, port: i64, addr: i64) -> i64 |
| 45 | func main() -> i64 |