code wiki / (root) / nx_dht_ping.nx

nx_dht_ping.nx

buildroot/runtime/nx_dht_ping.nx

3145 B52 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic dht
docsdependenciesstructsconstsfunctions

about

nx_dht_ping.nx -- LIVE DHT reachability probe (X-TORRENT-LIVE-002 R4b). Resolves real BEP-5 bootstrap nodes and KRPC-pings them over UDP:6881; GREEN if any returns a valid response dict. This is the EMPIRICAL test of whether the DHT is reachable from here, or whether the ISP/network blocks UDP:6881 (the same class of blocking that already kills UDP tracker ports :1337/:6969). Composes nx_dht (KRPC build/parse) + nx_dns_a (resolve) + raw UDP syscalls. NO external resolver. license_tier: ORIGINAL layer: peer-discovery probe module: nishi-core.torrent.dht_ping depends: nishi-core.torrent.dht, nishi-core.dns_a

dependencies 2 imports · 0 importers

nx_dht.nx nx_dns_a.nx nx_dht_ping.nx

imports: nx_dht.nxnx_dns_a.nx

imported by: nobody (leaf or entry point)

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

main dp_p2 dp_strlen dp_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 dp_p2 ↻ sys_socket ↻ sys_set_socket_timeout ↻ dp_sockaddr dht_build_ping dht_put dht_putraw sys_sendto ↻ sys_recvfrom ↻ nx_bc_dict_get sys_mmap ↻ nx_bc_str _bc_is_digit _bc_bytes_eq nx_bc_skip _bc_is_digit ↻

structs

none

consts

11const K_MAGIC_6881: i64 = 6881
12const K_MAGIC_2048: i64 = 2048

functions

14func dp_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: dp_p2
15func dp_p2(s: *u8) -> i64 { sys_write(1, s, dp_strlen(s)); return 0 }
called by 2: dp_trymain calls 1: dp_strlen
17func dp_sockaddr(out: *u8, port: i64, a: i64, b: i64, c: i64, d: i64) -> i64
called by 1: dp_try
26func dp_try(host: *u8, nid: *u8) -> i64
43func main() -> i64
calls 2: dp_p2dp_try