code wiki / _hdl_build / nx_reach_probe.nx
nx_reach_probe.nx
buildroot/runtime/_hdl_build/nx_reach_probe.nx
about
nx_reach_probe.nx -- REMOTE REACHABILITY probe: is <host>:<port> reachable from here, bits-up?
The triage organ's eye on the NAS/live-site world (everything else it watches is local).
usage: nx_reach_probe <host-or-dotted-ip> <port>
- dotted-quad parsed directly; hostnames via the team's OWN resolver (failover CF->G->Q9)
- TCP connect through the team's syscall wrappers; NO curl, NO sh
- SELF-BOUNDED: the network work runs in a watchdogged child; parent kills it at 10s
(the dsv <10s law -- a dead host must yield DOWN, never a 2-minute stall in a triage beat)
exit: 0 REACHABLE / 1 DNS-FAIL / 2 CONNECT-FAIL / 3 TIMEOUT / 4 usage
Composes nx_dns_resolve_a_record (failover resolver) + nx_http_client sockaddr layout.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nxnx_dns_resolve_a_record.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
| 14 | const RP_MAGIC_1000000: i64 = 1000000 |
| 88 | const RP_DEADLINE_TICKS: i64 = 100 // 100 x 100ms = 10s (the dsv law) |
functions
| 15 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 16 | func _pn(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;k=1}; while m>0{t[k]=48+(m%10);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 } |
| 17 | func rp_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: rp_work |
| 19 | func rp_num(s: *u8) -> i64 called by 1: main |
| 31 | func rp_parse_ip(s: *u8) -> i64 |
| 58 | func rp_work(host: *u8, port: i64) -> i64 called by 1: main calls 8: rp_parse_ipnx_dns_resolve_defaultrp_lensys_now_realtime_secsys_mmapsys_socket+2 |
| 82 | func rp_sleep_ms(ms: i64) -> i64 |
| 89 | func main(argc: i64, argv: *i64) -> i64 |