code wiki / _hdl_build / nx_cleanwatch_serve.nx

nx_cleanwatch_serve.nx

buildroot/runtime/_hdl_build/nx_cleanwatch_serve.nx

14079 B189 linesdepth 21pulls 173 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_cleanwatch_serve.nx -- HANDS-ON, REAL: the operator enters ANY site; we fetch it over our own sovereign TLS, harvest its ACTUAL resource URLs, and run nx_web_filter over them -- showing the real ad/tracker/miner/popunder requests THAT page makes that we'd block. Real evidence on real sites, not a canned list. Bind 0.0.0.0 -> WSL2 forwards Windows localhost (same path as nx_browser_view_serve). Run from nxc2 root (certdata is relative). Honest scope: static fetch shows resources in the delivered HTML; URLs the page builds via JS at runtime need the JS-exec sniffer layer (noted in the report). Run: nx_cleanwatch_serve [port] license_tier: ORIGINAL

dependencies 8 imports · 0 importers

nx_syscalls.nx nx_http_server.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_media_signal.nx nx_web_filter.nx nx_video_sniff.nx nx_cleanwatch_serve.nx

imports: nx_syscalls.nxnx_http_server.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nxnx_media_signal.nxnx_web_filter.nxnx_video_sniff.nx

imported by: nobody (leaf or entry point)

structs

none

consts

15const K_MAGIC_1048576: i64 = 1048576
16const K_MAGIC_4194304: i64 = 4194304
17const K_MAGIC_262144: i64 = 262144
18const K_MAGIC_4096: i64 = 4096
19const K_MAGIC_4095: i64 = 4095
20const K_MAGIC_8100: i64 = 8100
21const K_MAGIC_16384: i64 = 16384
22const K_MAGIC_65536: i64 = 65536

functions

24func cw_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
25func cw_put(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off]=s[i];off=off+1;i=i+1} return off }
26func cw_putn(dst: *u8, off: i64, v: i64) -> i64 { var m: i64=v; if m==0 { dst[off]=48 as u8; return off+1 } let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } var j: i64=0; while j<k { dst[off]=t[k-1-j]; off=off+1; j=j+1 } return off }
called by 1: send_html calls 1: sys_mmap
27func cw_datoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while (s[i]&0xff)>=48 { if (s[i]&0xff)>57 { i=i } else { v=v*10+((s[i]&0xff)-48); i=i+1 } if (s[i]&0xff)<48 { i=i } } return v }
28func cw_hexval(c: i64) -> i64 { if c>=48 { if c<=57 { return c-48 } } if c>=97 { if c<=102 { return c-87 } } if c>=65 { if c<=70 { return c-55 } } return 0 }
called by 1: cw_query_url
29func cw_dstarts(p: *u8, plen: i64, pre: *u8) -> i64 { var i: i64=0; while pre[i]!=(0 as u8) { if i>=plen { return 0 } if (p[i]&0xff)!=(pre[i]&0xff) { return 0 } i=i+1 } return 1 }
called by 1: cw_home
31func cw_esc(dst: *u8, off: i64, s: *u8, sl: i64) -> i64
calls 1: cw_put
39func cw_query_url(q: *u8, qlen: i64, out: *u8, cap: i64) -> i64
called by 1: cw_home calls 1: cw_hexval
50func cw_delim(c: i64) -> i64 { if c==34{return 1} if c==39{return 1} if c==32{return 1} if c==60{return 1} if c==62{return 1} if c==41{return 1} if c==125{return 1} if c==93{return 1} if c==92{return 1} if c==10{return 1} if c==9{return 1} if c==13{return 1} return 0 }
51func cw_contains(hay: *u8, hl: i64, needle: *u8, nl: i64) -> i64 { if nl==0 {return 1} if nl>hl {return 0} var i: i64=0; let last: i64=hl-nl; while i<=last { var j: i64=0; var m: i64=1; while j<nl { if (hay[i+j]&0xff)!=(needle[j]&0xff){m=0;j=nl} else {j=j+1} } if m==1 {return 1} i=i+1 } return 0 }
53func send_html(cfd: i64, body: *u8, blen: i64) -> i64
60func cw_head(page: *u8, o: i64) -> i64
called by 1: cw_home calls 1: cw_put
64func cw_home(page: *u8) -> i64
73func cw_analyze(cfd: i64, t: *i64, store: *TrustStore, url: *u8, ulen: i64) -> i64
154func main(argc: i64, argv: *i64) -> i64