code wiki / _hdl_build / nx_aw_sftp.nx

nx_aw_sftp.nx

buildroot/runtime/_hdl_build/nx_aw_sftp.nx

10509 B194 linesdepth 10pulls 22 transitivereach 0 importersview sourcekind tooltopic aw
docsdependenciesstructsconstsfunctions

about

nx_aw_sftp.nx -- the SOVEREIGN file WRITE rung (operator: "nishi ecosystem from the hardware rung up, each rung; build if we are missing capabilities"). nx_aw_push/nx_put stream bytes over our own SSH but land them with a remote `cat > file && mv` shell -- a coreutils dependency on the deploy path. This organ closes that rung properly: it writes the file over the SSH **sftp subsystem** (SSH_FXP_OPEN/WRITE/CLOSE), so NOTHING on the remote side is a shell -- the sftp-server is a protocol endpoint, not /bin/sh. No cat/mv/tee/dd, no nascmd/.src/.dst spec files, argv-driven. Built on nx_ssh_lib's channel primitives (ssh_enc_send/recv, ssh_put_*). Deploy-time only: a failed write leaves the running site untouched, so it cannot add flakiness. nx_aw_sftp <local-src-path> <remote-dest-path> license_tier: ORIGINAL (vault+SSH spine from nx_aw_send; the sftp layer is new)

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_ssh_lib.nx nx_aw_sftp.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 ft_slen sys_mmap ft_run sys_fork sys_mmap ↻ sys_execve sys_exit sys_wait4 sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ft_napms sys_mmap ↻ ft_unlink 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

structs

none

consts

12const FT_MAGIC_1000000: i64 = 1000000
13const FT_MAGIC_65536: i64 = 65536
14const FT_MAGIC_1048576: i64 = 1048576
15const FT_MAGIC_16384: i64 = 16384
17const FT_SECRET_OUT: *u8 = "/tmp/nxsecret.out" as *u8
18const FT_VAULT_NV: *u8 = "/home/elderwesto/.nishi/secrets/nas.nv" as *u8

functions

20func ft_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
21func 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 }
called by 1: main calls 2: sys_mmapsys_write
22func ft_run(path: *u8, a1: *u8, a2: *u8) -> i64
41func 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 }
called by 1: main calls 1: sys_mmap
44func sftp_send(st: *SshState, rcid: i64, pkt: *u8, plen: i64) -> i64
52func sftp_reply(st: *SshState, rep: *u8) -> i64
called by 1: main calls 1: ssh_enc_recv
63func sftp_chan_ok(st: *SshState, rep: *u8) -> i64
called by 1: main calls 1: ssh_enc_recv
75func main(argc: i64, argv: *i64) -> i64