code wiki / (root) / nx_tracker_url.nx

nx_tracker_url.nx

buildroot/runtime/nx_tracker_url.nx

5941 B125 linesdepth 2pulls 2 transitivereach 7 importersview sourcekind librarytopic tracker
docsdependenciesstructsconstsfunctions

about

nx_tracker_url.nx -- parse a BitTorrent tracker URL (from nx_magnet's tr= list) into scheme/host/port/path, the input the announce round-trip needs (resolve host -> IP, dial host:port). Pure/deterministic/sovereign. scheme: udp=1 (BEP-15), http=2, https=3, else 0=reject. Default port by scheme when absent (http=80, https=443, udp=6969); default path "/announce". Self-gating (main = baked KAT). license_tier: ORIGINAL module: nishi-core.torrent.tracker_url depends: nishi-core.sys.syscalls capability: TORRENT_TRACKER_URL_PARSE

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_tracker_url.nx nx_http_tracker.nx

imports: nx_syscalls.nx

imported by: nx_http_tracker.nx

structs

none

consts

11const K_MAGIC_6969: i64 = 6969
12const K_MAGIC_1337: i64 = 1337

functions

14func tu_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: tu_parse calls 1: sys_write
15func tu_wn(fd: i64, v: i64) -> i64
called by 1: tu_parse calls 2: sys_mmapsys_write
20func tu_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: tu_startstu_parse
22func tu_starts(buf: *u8, a: i64, n: i64, lit: *u8) -> i64
called by 1: tu_parse calls 1: tu_len
30func tu_streq(s: *u8, lit: *u8) -> i64
called by 1: tu_parse
38func tu_parse(url: *u8, port_out: *i64, host: *u8, path: *u8) -> i64
82func main() -> i64