code wiki / _hdl_build / nx_aw_fetch.nx
nx_aw_fetch.nx
buildroot/runtime/_hdl_build/nx_aw_fetch.nx
about
nx_aw_fetch.nx -- CAP-AW-FETCH: sovereign SFTP GET (pull) -- the READ rung, mirror of nx_aw_sftp's WRITE rung.
Pulls a remote NAS file (owned by elderwesto, reachable over SSH even when the home SMB share mounts empty locally)
down to a LOCAL path via the SSH sftp subsystem (FXP_OPEN read / FXP_READ / FXP_CLOSE) -- NOTHING on the remote is a
shell (sftp-server is a protocol endpoint). Closes the DR gap: archive the auth crown jewels (opaque_store etc.)
the local mount can't reach. Read-only on the NAS (never writes it). argv: [1]=remote-src [2]=local-dest.
license_tier: ORIGINAL (vault+SSH+sftp spine from nx_aw_sftp; the READ path is new)
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
| 9 | const FT_MAGIC_1000000: i64 = 1000000 |
| 10 | const FT_MAGIC_65536: i64 = 65536 |
| 11 | const FT_MAGIC_1048576: i64 = 1048576 |
| 12 | const FT_MAGIC_16384: i64 = 16384 |
| 14 | const FT_SECRET_OUT: *u8 = "/tmp/nxsecret.out" as *u8 |
| 15 | const FT_VAULT_NV: *u8 = "/home/elderwesto/.nishi/secrets/nas.nv" as *u8 |
functions
| 17 | func ft_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 18 | func ft_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); 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}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 19 | func ft_run(path: *u8, a1: *u8, a2: *u8) -> i64 |
| 37 | func ft_unlink(path: *u8) -> i64 { __syscall(263, AT_FDCWD, path, 0, 0, 0, 0) return 0 } called by 1: main |
| 38 | func ft_napms(ms: i64) -> i64 { let ts: *i64 = sys_mmap(16) as *i64; ts[0] = 0; ts[1] = ms * FT_MAGIC_1000000; __syscall(35, ts as i64, 0, 0, 0, 0, 0); return 0 } |
| 40 | func sftp_send(st: *SshState, rcid: i64, pkt: *u8, plen: i64) -> i64 |
| 47 | func sftp_reply(st: *SshState, rep: *u8) -> i64 |
| 57 | func sftp_chan_ok(st: *SshState, rep: *u8) -> i64 |
| 69 | func main(argc: i64, argv: *i64) -> i64 |