nx_router_ctl.nx
buildroot/runtime/nx_router_ctl.nx
about
nx_router_ctl.nx -- SOVEREIGN router control (operator: "you have api access, get it going, towards apis";
roadmap NR-7). Drives the home GL.iNet GL-BE9300 (OpenWrt) via its uci config API over OUR OWN sovereign SSH
(nx_ssh_lib -- curve25519 KEX, chacha/aes, exec channel), NOT WSL bash. Verbs:
fwadd [port] [destip] -> idempotent DNAT redirect wan:port -> destip:port (TCP+UDP); opens the seeder to WAN
fwlist -> show our Nishi firewall redirects
wan -> WAN interface IP (are we actually reachable?)
Password from data/router.pw (0600; vault-migratable). Router LAN IP 192.168.8.1. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_ssh_lib.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
| 10 | const RC_MAGIC_6881: i64 = 6881 |
| 11 | const RC_MAGIC_8192: i64 = 8192 |
| 13 | const RC_PW: *u8 = "data/router.pw" as *u8 |
| 14 | const RC_ROUTER: i64 = (192 << 24) | (168 << 16) | (8 << 8) | 1 // 192.168.8.1 (GL.iNet LAN) |
functions
| 16 | func rc_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 17 | func rc_app(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8) { dst[o]=s[i]; o=o+1; i=i+1 } return o } |
| 18 | func rc_appn(dst: *u8, o: i64, v: i64) -> i64 { if v==0 { dst[o]=48 as u8; return o+1 } var m: i64=v; let t: *u8=sys_mmap(28); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } while k>0 { k=k-1; dst[o]=t[k]; o=o+1 } return o } |
| 19 | func rc_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8) { if a[i]!=b[i] { return 0 } i=i+1 } if b[i]!=(0 as u8) { return 0 } return 1 } called by 1: main |
| 22 | func rc_redir(buf: *u8, o: i64, sect: *u8, proto: *u8, port: i64, destip: *u8) -> i64 |
| 36 | func main(argc: i64, argv: *i64) -> i64 |