code wiki / (root) / nx_doctor.nx

nx_doctor.nx

buildroot/runtime/nx_doctor.nx

7670 B195 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind tooltopic doctor
docsdependenciesstructsconstsfunctions

about

nx_doctor.nx -- the bits-up AUTO-FIX tool a regular user runs. Probes the things that break (services, sites, web layer, DNS), classifies each as LOCAL (auto-fixable right here) or REMOTE (report -> the network self-heals), AUTO-FIXES the local ones, and prints a plain-language verdict anyone can read. Fixes it performs locally: restart a dead service (fork+exec); flush the stale Windows DNS cache (ipconfig.exe /flushdns via WSL interop) -- the real cause of "site doesn't load in my browser but the server is fine". Capstone of NX-NETSCOPE (diagnose) + self-heal (decide/act) + the easy-for-anyone verdict. Sovereign: raw syscalls, zero deps. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_connect.nx nx_doctor.nx

imports: nx_syscalls.nxnx_connect.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_write dr_tcp_ok sys_socket dr_timeout sys_mmap sys_setsockopt sys_mmap ↻ dr_sockaddr nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_close dr_sym sys_write ↻ dr_restart_search sys_fork sys_mmap ↻ sys_execve sys_exit sys_sleep_ms sys_mmap ↻ sys_munmap dr_http_status sys_socket ↻ dr_timeout ↻ sys_mmap ↻ dr_sockaddr ↻ nx_connect_bounded ↻ sys_close ↻ sys_write ↻ sys_read dr_putn sys_write ↻ sys_mmap ↻ dr_flush_windows_dns sys_fork ↻ sys_mmap ↻

structs

none

consts

18const DR_MAGIC_8787: i64 = 8787
19const DR_MAGIC_1500: i64 = 1500
21const DR_OK: i64 = 0
22const DR_LOCAL: i64 = 1
23const DR_REMOTE: i64 = 2

functions

25func dr_putn(n: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
35func dr_sym(state: i64) -> i64
called by 1: main calls 1: sys_write
43func dr_sockaddr(sa: *u8, ip_packed: i64, port: i64) -> i64
56func dr_timeout(fd: i64, opt: i64) -> i64 { // opt 20=RCVTIMEO 21=SNDTIMEO, 1s
66func dr_tcp_ok(ip_packed: i64, port: i64) -> i64
80func dr_http_status(ip_packed: i64, port: i64, host: *u8, hlen: i64) -> i64
121func dr_flush_windows_dns() -> i64
138func main() -> i64