nx_peer_metadata.nx
buildroot/runtime/nx_peer_metadata.nx
about
nx_peer_metadata.nx -- BEP-9 ut_metadata FETCH + sha1-verify the info-dict (X-TORRENT-LIVE-001
R3b): COMPLETES the engine. A magnet has no .torrent, so the client fetches the info-dict from a
peer over BEP-10/BEP-9: ext handshake -> learn ut_metadata id + metadata_size -> request each
metadata piece -> peer replies a bencoded header + RAW info-dict bytes -> assemble -> the BEP-9
integrity check sha1(info-dict)==info_hash -> nx_bc_dict_get the piece map (name/piece length/
length). Reuses nx_peerwire + nx_bencode + nx_sha1. GATE = SOVEREIGN LOOPBACK: a synthetic
info-dict whose sha1 IS the handshake info_hash; the mock serves it; the client fetches,
assembles, verifies, and parses. license_tier: ORIGINAL
module: nishi-core.torrent.peer_metadata
depends: nishi-core.torrent.peerwire, nishi-core.torrent.bencode, nishi-core.crypto.sha1
dependencies 4 imports · 0 importers
imports: nx_peerwire.nxnx_connect.nxnx_bencode.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
| 16 | const PW_MAGIC_65536: i64 = 65536 |
| 17 | const PW_MAGIC_53461: i64 = 53461 |
| 18 | const PW_MAGIC_1024: i64 = 1024 |
| 19 | const PW_MAGIC_2048: i64 = 2048 |
| 21 | const PW_EXTENDED: i64 = 20 |
functions
| 23 | func md_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } called by 1: main |
| 24 | func md_wn(fd: i64, v: i64) -> i64 called by 1: main |
| 29 | func md_bstr(buf: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8) { buf[off+i]=s[i]; i=i+1 } return off+i } called by 1: main |
| 30 | func md_bint(buf: *u8, off: i64, v: i64) -> i64 called by 1: main |
| 34 | func md_sockaddr(sa: *u8, port: i64, i0: i64, i1: i64, i2: i64, i3: i64) -> i64 called by 1: main |
| 41 | func md_read_n(fd: i64, buf: *u8, n: i64) -> i64 |
| 46 | func md_write_n(fd: i64, buf: *u8, n: i64) -> i64 called by 1: main |
| 51 | func md_read_msg(fd: i64, mb: *u8, cap: i64) -> i64 |
| 60 | func md_build_ext(ext_id: i64, data: *u8, dlen: i64, out: *u8) -> i64 |
| 67 | func main() -> i64 |