code wiki / (root) / nx_tracker_live.nx

nx_tracker_live.nx

buildroot/runtime/nx_tracker_live.nx

6395 B97 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tooltopic tracker
docsdependenciesstructsconstsfunctions

about

nx_tracker_live.nx -- LIVE BEP-15 tracker announce (X-TORRENT-LIVE-001 L2): resolve real trackers (nx_dns_a) + UDP connect+announce a real info_hash -> REAL peers. Tries a LIST of public UDP trackers (like a real client) and reports each, succeeding on the first that returns peers. Test target: Big Buck Bunny (the standard legal/well-seeded CC test torrent). GATE = LIVE: any tracker -> >=1 peer. Composes nx_dns_a_resolve + nx_udp_tracker build/parse. license_tier: ORIGINAL module: nishi-core.torrent.tracker_live depends: nishi-core.torrent.dns_a, nishi-core.torrent.udp_tracker

dependencies 2 imports · 0 importers

nx_dns_a.nx nx_udp_tracker.nx nx_tracker_live.nx

imports: nx_dns_a.nxnx_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 tl_w tl_try nx_dns_a_resolve sys_socket sys_set_socket_timeout sys_mmap sys_setsockopt sys_munmap sys_mmap ↻ da_sockaddr da_build_query da_qname sys_sendto sys_close sys_recvfrom da_parse da_u16 da_skip_name sys_socket ↻ sys_set_socket_timeout ↻ tl_sockaddr nx_udp_build_connect _ut_put_u64 _ut_put_u32 sys_sendto ↻ sys_recvfrom ↻ 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 ↻ tl_report tl_w ↻ tl_wn tl_wn ↻

structs

none

consts

11const K_MAGIC_305419896: i64 = 305419896
12const K_MAGIC_1000000000: i64 = 1000000000
13const K_MAGIC_6881: i64 = 6881
14const K_MAGIC_2048: i64 = 2048
15const K_MAGIC_1337: i64 = 1337
16const K_MAGIC_6969: i64 = 6969

functions

18func tl_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 2: tl_reportmain
19func tl_wn(fd: i64, v: i64) -> i64
called by 2: tl_reportmain
24func tl_sockaddr(sa: *u8, port: i64, i0: i64, i1: i64, i2: i64, i3: i64) -> i64
called by 1: tl_try
31func tl_ip(a: i64) -> i64 { return a }
34func tl_try(host: *u8, port: i64, ih: *u8, pid: *u8, ip: *u8, peer0: *i64) -> i64
60func tl_report(host: *u8, ip: *u8, rc: i64, peer0: *i64) -> i64
called by 1: main calls 2: tl_wtl_wn
71func main() -> i64