nx_tracker_url.nx
buildroot/runtime/nx_tracker_url.nx
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
imports: nx_syscalls.nx
imported by: nx_http_tracker.nx
structs
| none |
consts
| 11 | const K_MAGIC_6969: i64 = 6969 |
| 12 | const K_MAGIC_1337: i64 = 1337 |
functions
| 14 | func 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 } |
| 15 | func tu_wn(fd: i64, v: i64) -> i64 |
| 20 | func tu_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 22 | func tu_starts(buf: *u8, a: i64, n: i64, lit: *u8) -> i64 |
| 30 | func tu_streq(s: *u8, lit: *u8) -> i64 called by 1: tu_parse |
| 38 | func tu_parse(url: *u8, port_out: *i64, host: *u8, path: *u8) -> i64 |
| 82 | func main() -> i64 |