nx_dns_a.nx
buildroot/runtime/nx_dns_a.nx
about
nx_dns_a.nx -- minimal DNS A-record resolver on the nx_syscalls layer (X-TORRENT-LIVE-001 L1):
resolve a tracker hostname -> IPv4 so we can reach a LIVE tracker. The existing
nx_dns_resolve_a_record rides nx_syscalls_x86_64 (layer conflict with the torrent organs), so this
is a self-contained UDP A-query to a public resolver (8.8.8.8:53): build the query, send/recv over
the proven sovereign UDP plumbing, parse the first A answer (handles name-compression pointers).
GATE = LIVE (needs internet, like the H2 arc): resolve a real host -> a valid public IPv4.
Reusable fn nx_dns_a_resolve(host, out_ip4). license_tier: ORIGINAL
module: nishi-core.torrent.dns_a
depends: nishi-core.sys.syscalls
dependencies 2 imports · 6 importers
imports: nx_syscalls.nxnx_itoa_lib.nx
imported by: nx_dht_announce.nxnx_dht_get_peers.nxnx_dht_ping.nxnx_http_tracker.nxnx_peer_connect_live.nxnx_tracker_live.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const K_MAGIC_4660: i64 = 4660 |
| 14 | const K_MAGIC_2048: i64 = 2048 |
functions
| 16 | func da_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 } |
| 21 | func da_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 22 | func da_u16(buf: *u8, o: i64) -> i64 { return ((buf[o] as i64) << 8) | (buf[o+1] as i64) } called by 1: da_parse |
| 25 | func da_qname(host: *u8, out: *u8, off: i64) -> i64 called by 1: da_build_query |
| 42 | func da_build_query(host: *u8, qid: i64, out: *u8) -> i64 |
| 56 | func da_skip_name(buf: *u8, off: i64, n: i64) -> i64 called by 1: da_parse |
| 68 | func da_parse(buf: *u8, n: i64, out_ip: *u8) -> i64 |
| 91 | func da_sockaddr(sa: *u8, port: i64, i0: i64, i1: i64, i2: i64, i3: i64) -> i64 called by 1: nx_dns_a_resolve |
| 100 | func nx_dns_a_resolve(host: *u8, out_ip: *u8) -> i64 |
| 113 | func main() -> i64 |