code wiki / _hdl_build / nx_doh_probe.nx

nx_doh_probe.nx

buildroot/runtime/_hdl_build/nx_doh_probe.nx

3881 B77 linesdepth 21pulls 146 transitivereach 0 importersview sourcekind probe
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_doh_probe.nx

imports: nx_syscalls.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nx

imported by: nobody (leaf or entry point)

structs

none

consts

13const K_MAGIC_65536: i64 = 65536
14const K_MAGIC_4194304: i64 = 4194304

functions

16func 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 }
called by 1: dh_print_data calls 1: sys_write
17func dh_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
18func 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 }
21func dh_print_data(body: *u8, n: i64) -> i64
43func dh_one(store: *TrustStore, host: *u8) -> i64
calls 1: sys_mmap
62func main(argc: i64, argv: *i64) -> i64