code wiki / _hdl_build / nx_doh_probe.nx
nx_doh_probe.nx
buildroot/runtime/_hdl_build/nx_doh_probe.nx
about
nx_doh_probe.nx -- SOVEREIGN DNS-over-HTTPS probe: the TRUE public A record even when the LAN
transparently intercepts port-53 UDP (split-horizon). Queries dns.google's RFC-8484-style JSON API
(https://dns.google/resolve?name=<host>&type=A) over the sovereign TLS-1.3 client + Mozilla trust
store -- HTTPS the interceptor cannot rewrite -- and prints the "data":"a.b.c.d" answers. This is the
discriminator: if DoH returns a PUBLIC ip but nx_dns_probe (plain UDP) returns a PRIVATE 192.168.x,
the LAN is doing split-horizon and the PUBLIC record is fine; if DoH ALSO returns the private ip,
the authoritative record is genuinely broken (external users can't reach it).
usage: nx_doh_probe [<host> ...] (defaults to the andelinwest/nishifamily edge set)
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 13 | const K_MAGIC_65536: i64 = 65536 |
| 14 | const K_MAGIC_4194304: i64 = 4194304 |
functions
| 16 | func dh_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 17 | func dh_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 18 | func dh_putn(v: i64) -> i64 { let b: *u8=sys_mmap(24); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(24); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 21 | func dh_print_data(body: *u8, n: i64) -> i64 |
| 43 | func dh_one(store: *TrustStore, host: *u8) -> i64 calls 1: sys_mmap |
| 62 | func main(argc: i64, argv: *i64) -> i64 |