code wiki / _hdl_build / nx_reach_probe.nx

nx_reach_probe.nx

buildroot/runtime/_hdl_build/nx_reach_probe.nx

5206 B122 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind probe
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_connect.nx nx_dns_resolve_a_record.nx nx_reach_probe.nx

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

main _p sys_write sys_exit rp_num sys_fork rp_work rp_parse_ip sys_mmap nx_dns_resolve_default nx_dns_resolve_with_failov nx_dns_resolve_a_record sys_mmap ↻ nx_dns_build_query nx_dns_put_u16_be nx_dns_encode_name sys_socket sys_set_socket_timeout sys_mmap ↻ sys_setsockopt sys_munmap sys_sendto sys_close sys_recvfrom nx_dns_parse_response_a nx_dns_get_u16_be nx_dns_skip_name rp_len sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_mmap ↻ sys_socket ↻ nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_close ↻ sys_mmap ↻

structs

none

consts

14const RP_MAGIC_1000000: i64 = 1000000
88const RP_DEADLINE_TICKS: i64 = 100 // 100 x 100ms = 10s (the dsv law)

functions

15func _p(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 1: main calls 1: sys_write
16func _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 }
called by 1: main calls 2: sys_mmapsys_write
17func 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
19func rp_num(s: *u8) -> i64
called by 1: main
31func rp_parse_ip(s: *u8) -> i64
called by 1: rp_work calls 1: sys_mmap
58func rp_work(host: *u8, port: i64) -> i64
82func rp_sleep_ms(ms: i64) -> i64
called by 1: main calls 1: sys_mmap
89func main(argc: i64, argv: *i64) -> i64