nx_torrent_leech_probe.nx
buildroot/runtime/nx_torrent_leech_probe.nx
about
nx_torrent_leech_probe.nx -- pull a WHOLE file off a BitTorrent seeder + verify every piece.
Two jobs, one organ:
(GATE, no args) = the INTEGRATION proof: originate a torrent (nx_torrent_mkinfo) -> seed it
(nx_torrent_seed.ts_serve_peer) -> leech the FULL file back -> verify EACH piece's
SHA-1 against the info-dict's ADVERTISED hashes (what a real client checks) -> assert
the reassembled file's info_hash == the original's. Proves originate->seed->leech->verify.
(LIVE) <ip> <port> <ih_hex40> <plen> <total> <outfile>
= connect a REAL remote seeder (e.g. the NAS), download the file, write it, and print
the reassembled file's info_hash (compare to the seed's -> byte-perfect P2P transfer).
license_tier: ORIGINAL module: nishi-core.torrent.leech_probe
depends: nishi-core.torrent.seed, nishi-core.torrent.mkinfo, nishi-core.torrent.peerwire, nishi-core.crypto.sha1
dependencies 5 imports · 0 importers
imports: nx_torrent_seed.nxnx_connect.nxnx_torrent_mkinfo.nxnx_peerwire.nxnx_sha1.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
| 19 | const LP_MAGIC_65536: i64 = 65536 |
| 20 | const LP_MAGIC_4096: i64 = 4096 |
| 21 | const LP_MAGIC_53611: i64 = 53611 |
| 23 | const LP_BLK: i64 = 16384 |
functions
| 25 | func lp_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 26 | func lp_wn(v: i64) -> i64 |
| 36 | func lp_leech(ctx: *MseCtx, cfd: i64, ih: *u8, my_pid: *u8, plen: i64, total: i64, npc: i64, outbuf: *u8, expect_pieces: *u8, got_all: *i64) -> i64 |
| 97 | func lp_sockaddr_ip(sa: *u8, port: i64, ipstr: *u8) -> i64 |
| 106 | func lp_live(ipstr: *u8, port: i64, ihhex: *u8, plen: i64, total: i64, outfile: *u8, mse: i64) -> i64 |
| 142 | func lp_gate() -> i64 |
| 190 | func main(argc: i64, argv: *i64) -> i64 |