nx_external_path_audit.nx
buildroot/runtime/nx_external_path_audit.nx
about
nx_external_path_audit.nx -- NR-1.5 of NISHI_ROUTER_CONTROL_ROADMAP.
Bits-up health check for the public WAN path. Runs on the NAS (or
any host with internet egress); periodically tries to TCP-connect
from this host's OUTBOUND interface to its OWN public IP on :443.
Logs OK / TIMEOUT / REFUSED per check + writes a verdict file the
operator (or other Nishi substrate) can grep.
Today's outage (2026-05-21) revealed the operator had ZERO bits-up
signal that the router was dropping inbound :443. Friend reports
via Waterfox console blowups are NOT a substrate signal. This is.
V1 simplicity:
- Hardcoded public IP (75.28.18.94) + port (443). NR-1.5b adds DNS-
resolved lookup so it auto-tracks WAN IP changes.
- Loops forever (5 sec interval). No daemon-level scheduling -- just
run under nx_supervisor_run.
- Writes one line per probe to /tmp/nx_external_path.log (path
configurable via env in V2).
V2 sub-stones:
- NR-1.5b: resolve target via our sovereign DNS, not hardcoded IP
- NR-1.5c: emit signals through D5 nx_metrics (instead of /tmp log)
- NR-1.5d: per-port audit (probe :443 AND :80 AND :8443 etc)
- NR-1.5e: tail-and-alert mode (push alert when verdict changes)
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 33 | const NX_EPA_TARGET_IP_A: i64 = 75 |
| 34 | const NX_EPA_TARGET_IP_B: i64 = 28 |
| 35 | const NX_EPA_TARGET_IP_C: i64 = 18 |
| 36 | const NX_EPA_TARGET_IP_D: i64 = 94 |
| 37 | const NX_EPA_TARGET_PORT: i64 = 443 |
| 39 | const NX_EPA_INTERVAL_SEC: i64 = 5 |
| 40 | const NX_EPA_CONNECT_TIMEOUT_SEC: i64 = 3 |
| 42 | const NX_EPA_VERDICT_OK: i64 = 0 |
| 43 | const NX_EPA_VERDICT_TIMEOUT: i64 = 1 |
| 44 | const NX_EPA_VERDICT_REFUSED: i64 = 2 |
| 45 | const NX_EPA_VERDICT_ERROR: i64 = 3 |
| 47 | const AF_INET_CONST: i64 = 2 |
| 48 | const SOCK_STREAM_CONST: i64 = 1 |
functions
| 52 | func _epa_strlen(s: *u8) -> i64 |
| 58 | func _epa_w(fd: i64, s: *u8) -> i64 |
| 63 | func _epa_wi(fd: i64, n: i64) -> i64 |
| 88 | func _epa_build_sockaddr(out: *u8, ip_a: i64, ip_b: i64, ip_c: i64, ip_d: i64, called by 1: nx_epa_probe_once |
| 107 | func nx_epa_probe_once() -> i64 called by 1: nx_external_path_audit_run calls 5: sys_socketsys_mmap_epa_build_sockaddrsys_connectsys_close |
| 129 | func _epa_verdict_name(v: i64) -> *u8 called by 1: nx_external_path_audit_run |
| 137 | func _epa_sleep(secs: i64) -> i64 |
| 146 | func nx_external_path_audit_run() -> i64 |
| 186 | func main() -> i64 calls 1: nx_external_path_audit_run |