nx_port_audit.nx
buildroot/runtime/nx_port_audit.nx
about
nx_port_audit.nx -- SOVEREIGN LISTENING_VS_CLAIMED audit (the capability nx_daemon_health_audit lists
as MISSING). Parses /proc/net/tcp (no ss/netstat/shell) for sockets in LISTEN state (st=0A), extracts
their local ports, and checks each KNOWN Nishi daemon port: is something ACTUALLY listening, or does the
daemon merely CLAIM up (pidfile UP, port unbound -- the exact torrent :8097 restart-wedge symptom)?
Run: nx_port_audit. license_tier: ORIGINAL
module: nishi-core.perception.port_audit capability: PERCEPTION (daemon health)
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
| 8 | const PA_MAGIC_1048576: i64 = 1048576 |
| 9 | const PA_MAGIC_8097: i64 = 8097 |
| 10 | const PA_MAGIC_18090: i64 = 18090 |
| 11 | const PA_MAGIC_7702: i64 = 7702 |
| 12 | const PA_MAGIC_8446: i64 = 8446 |
| 13 | const PA_MAGIC_8447: i64 = 8447 |
| 14 | const PA_MAGIC_8443: i64 = 8443 |
| 15 | const PA_MAGIC_8080: i64 = 8080 |
| 17 | const PA_CAP: i64 = 1024 |
| 71 | const PA_CONF: *u8 = "knowledge/status/portmap.conf" |
| 72 | const PA_CONFCAP: i64 = 65536 |
| 73 | const PA_HASH: i64 = 35 |
| 74 | const PA_TABC: i64 = 9 |
| 75 | const PA_LF: i64 = 10 |
functions
| 19 | func pa_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 20 | func pa_n(v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(28); var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 21 | func pa_hv(c: i64) -> i64 { if c>=48 { if c<=57 { return c-48 } } if c>=65 { if c<=70 { return c-55 } } if c>=97 { if c<=102 { return c-87 } } return 0-1 } called by 1: pa_scan_file |
| 25 | func pa_scan_file(path: *u8, out: *i64, start: i64, cap: i64) -> i64 |
| 58 | func pa_check(ports: *i64, np: i64, port: i64, name: *u8) -> i64 |
| 77 | func pa_eol(buf: *u8, from: i64, total: i64) -> i64 called by 1: pa_audit_conf |
| 82 | func pa_tabpos(buf: *u8, from: i64, eol: i64) -> i64 called by 1: pa_audit_conf |
| 89 | func pa_audit_conf(ports: *i64, np: i64, down_out: *i64) -> i64 |
| 121 | func main() -> i64 |