nx_connect_gate.nx
buildroot/runtime/nx_connect_gate.nx
about
nx_connect_gate.nx -- proves nx_connect_bounded actually BOUNDS a connect, and that it is a safe
drop-in for the 100 raw sys_connect sites.
THE NON-VACUITY TOOTH is T2: it dials 192.0.2.1 (RFC5737 TEST-NET-1, guaranteed unroutable, so the
SYN is black-holed rather than refused) with a 2s budget. A RAW sys_connect against that address
returns after the kernel's SYN-retry ceiling of ~127 SECONDS. If T2 comes back in ~2s the bound is
real; if it comes back in ~127s the primitive is decorative. The gate MEASURES the elapsed time and
fails on the number -- it does not take the return code's word for it.
expect_exit: 0 license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nxnx_fcntl.nxnx_clock.nxnx_gate_verdict.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
| 16 | const G_PORT_LIVE: i64 = 19781 |
| 17 | const G_PORT_CLOSED: i64 = 19782 |
| 18 | const G_BUDGET_MS: i64 = 2000 |
| 19 | const G_SLACK_MS: i64 = 5000 |
| 20 | const G_NS_PER_MS: i64 = 1000000 |
| 22 | const G_MIN_MS: i64 = 1500 |
functions
| 24 | func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 25 | func g_putn(v: i64) -> i64 |
| 43 | func g_sa(a: i64, b: i64, c: i64, d: i64, port: i64) -> *u8 |
| 58 | func g_tooth(name: *u8, ok: i64) -> i64 |
| 64 | func main(argc: i64, argv: *i64) -> i64 |