code wiki / (root) / nx_udp_tracker_announce.nx

nx_udp_tracker_announce.nx

buildroot/runtime/nx_udp_tracker_announce.nx

6124 B117 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic udp
docsdependenciesstructsconstsfunctions

about

nx_udp_tracker_announce.nx -- BEP-15 UDP tracker ANNOUNCE round-trip (X-TORRENT-LIVE-001 R2b-ii): the live peer-discovery step. Wires nx_udp_tracker's KAT'd build/parse to a real UDP socket (the nx_syscalls-layer plumbing proven by nx_udp_loopback): connect -> conn_id -> announce(info_hash) -> compact peer list. Import nx_udp_tracker ONLY (it pulls nx_syscalls transitively -> sys_* + AF_INET/SOCK_DGRAM + the _ut_* byte helpers; avoids the double-import rc=6 and the wrong-layer nx_udp.nx). GATE = SOVEREIGN LOOPBACK: fork a mock UDP tracker (bind-before-fork; echoes the request txid, replies connect->conn_id, announce->one synthetic compact peer 1.2.3.4:5678); the client announces and must parse that exact peer. No external network; deterministic; no-hang (socket timeouts). license_tier: ORIGINAL module: nishi-core.torrent.udp_tracker_announce depends: nishi-core.torrent.udp_tracker

dependencies 1 imports · 0 importers

nx_udp_tracker.nx nx_udp_tracker_announce.nx

imports: nx_udp_tracker.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ta_sockaddr sys_socket sys_set_socket_timeout sys_mmap sys_setsockopt sys_munmap sys_bind ta_w sys_fork sys_recvfrom _ut_get_u32 _ut_put_u32 _ut_put_u64 sys_sendto nx_udp_build_connect _ut_put_u64 ↻ _ut_put_u32 ↻ nx_udp_parse_connect_resp _ut_get_u32 ↻ _ut_get_u64 nx_udp_build_announce _ut_put_u64 ↻ _ut_put_u32 ↻ _ut_put_u16 nx_udp_parse_announce_resp _ut_get_u32 ↻ sys_wait4 ta_wn

structs

none

consts

14const K_MAGIC_53219: i64 = 53219
15const K_MAGIC_305419896: i64 = 305419896
16const K_MAGIC_11259375: i64 = 11259375
17const K_MAGIC_1800: i64 = 1800
18const K_MAGIC_5678: i64 = 5678
19const K_MAGIC_1000000: i64 = 1000000
20const K_MAGIC_6881: i64 = 6881
21const K_MAGIC_16909060: i64 = 16909060

functions

23func ta_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
24func ta_wn(fd: i64, v: i64) -> i64
called by 1: main
29func ta_sockaddr(sa: *u8, port: i64, i0: i64, i1: i64, i2: i64, i3: i64) -> i64
called by 1: main
37func main() -> i64