code wiki / _hdl_build / nx_ssh_putpage.nx

nx_ssh_putpage.nx

buildroot/runtime/_hdl_build/nx_ssh_putpage.nx

5494 B95 linesdepth 10pulls 22 transitivereach 0 importersview sourcekind tooltopic ssh
docsdependenciesstructsconstsfunctions

about

nx_ssh_putpage.nx -- sovereign page push: stream a LOCAL file (/tmp/nxput.src) to a remote doc-root path over the team's own SSH, using CHUNKED channel data (not an in-command base64, which overflows the exec buffer). Reuses the proven flow-control (ssh_drain) + poll-bounded close-wait from nx_hostdeploy. Backs up the prior file, streams, then verifies size + live title on :8443. Target path is read from /tmp/nxput.dst. Password from /tmp/nxpw (staged + deleted by caller). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_ssh_lib.nx nx_ssh_putpage.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 sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ssh_puts sys_write putn sys_mmap ↻ sys_write ↻ 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

structs

none

consts

8const K_MAGIC_65536: i64 = 65536
9const K_MAGIC_1048576: i64 = 1048576
10const K_MAGIC_16384: i64 = 16384
11const K_MAGIC_1024: i64 = 1024

functions

13func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=0 as u8 { n=n+1 } return n }
called by 1: main
14func putn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; 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{b[i]=t[k-1-i];i=i+1}; sys_write(2,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
17func ssh_drain(st: *SshState) -> i64
26func ssh_put_file(st: *SshState, wcmd: *u8, wcmdlen: i64, data: *u8, datalen: i64) -> i64
66func main() -> i64