code wiki / (root) / nx_edge_repoint.nx

nx_edge_repoint.nx

buildroot/runtime/nx_edge_repoint.nx

6327 B54 linesdepth 10pulls 22 transitivereach 0 importersview sourcekind tooltopic edge
docsdependenciesstructsconstsfunctions

about

nx_edge_repoint.nx -- SOVEREIGN edge repoint: make the sovereign edge (sites.elf :8443) win WAN :443. Fixes the D008 :443 co-squat by adding a PORT-TRANSLATING DNAT on the home GL.iNet: wan:443/tcp -> 192.168.8.227:8443, so WAN clients reach sites.elf directly instead of DSM's nginx (which 301->502s /search). Drives the router over OUR OWN sovereign SSH (nx_ssh_lib); reads the router password by ABSOLUTE path so it runs correctly from any tools-daemon CWD. Reversible by construction: `off` deletes the added redirect. list -> show firewall redirects (inspect the current :443 path BEFORE changing anything) on -> add nishimap443: wan:443/tcp -> 192.168.8.227:8443 DNAT; commit; reload off -> delete nishimap443; commit; reload (revert to the prior WAN :443 path) Map is HARDCODED (443->8443) so the tool cannot be repurposed. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_ssh_lib.nx nx_edge_repoint.nx

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

main ssh_puts sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_exit ssh_open_session sys_socket sys_mmap ↻ ssh_sockaddr nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll ssh_kex sys_write ↻ sys_mmap ↻ ssh_read_line sys_read ↻ ssh_read_packet sys_mmap ↻ ssh_read_full sys_read ↻ ssh_u32be ssh_put_bytes ssh_put_byte ssh_put_bytes ↻ ssh_put_str ssh_put_u32 ssh_put_bytes ↻ ssh_put_u32 ↻ ssh_send_packet sys_mmap ↻ ssh_put_u32 ↻

structs

none

consts

12const ER_MAGIC_8192: i64 = 8192
14const ER_PW: *u8 = "/volume1/ai/torrent/data/router.pw" as *u8
15const ER_ROUTER: i64 = (192 << 24) | (168 << 16) | (8 << 8) | 1 // 192.168.8.1 (GL.iNet LAN)

functions

17func er_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 }
called by 1: main
18func er_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
20func main(argc: i64, argv: *i64) -> i64