code wiki / _hdl_build / nx_web_filter.nx

nx_web_filter.nx

buildroot/runtime/_hdl_build/nx_web_filter.nx

7404 B96 linesdepth 3pulls 3 transitivereach 6 importersview sourcekind librarytopic web
docsdependenciesstructsconstsfunctions

about

nx_web_filter.nx -- SOVEREIGN content-filter engine for the Nishi browser (uBlock-class, DATA-DRIVEN). The honest defense for "these sites are full of viruses": block the malvertising / trackers / crypto-miners / popunders that hostile (pirate/adult) sites load, and PASS THROUGH the actual video the user came to watch. It is the DEFENSIVE TWIN of nx_media_signal/nx_extract_heal: same data-driven pattern-table shape, but the verdict is BLOCK/ALLOW instead of media-kind. Network-level request filtering (not DOM cosmetic hiding) is ALSO anti-adblock-resistant by construction -- it leaves no hidden-element DOM fingerprint for the site to detect. Rules are DATA so the blocklist adapts without code edits (same as the self-heal table). ORIGINAL

dependencies 2 imports · 6 importers

nx_syscalls.nx nx_media_signal.nx nx_web_filter.nx nx_clean_serve.nx nx_clean_serve_daemon.nx nx_clean_serve_gate.nx nx_cleanview.nx nx_cleanwatch_serve.nx nx_web_filter_gate.nx

imports: nx_syscalls.nxnx_media_signal.nx

imported by: nx_clean_serve.nxnx_clean_serve_daemon.nxnx_clean_serve_gate.nxnx_cleanview.nxnx_cleanwatch_serve.nxnx_web_filter_gate.nx

structs

none

consts

11const WF_STRIDE: i64 = 4 // per-rule: [kind, pat_ptr, patlen, category]
12const WF_MAX: i64 = 4096
13const WF_BLOCK: i64 = 1
14const WF_ALLOW: i64 = 2 // exception: the CONTENT the user wants -- always passes
16const WF_AD: i64 = 1
17const WF_TRACK: i64 = 2
18const WF_MAL: i64 = 3
19const WF_MINER: i64 = 4
20const WF_POPUP: i64 = 5
21const WF_CONTENT: i64 = 6

functions

23func wf_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: wf_addc
24func wf_new() -> *i64 { let t: *i64 = sys_mmap(8 * (1 + WF_MAX * WF_STRIDE)) as *i64; t[0] = 0; return t }
called by 4: mainmainmainmain calls 1: sys_mmap
25func wf_add(t: *i64, kind: i64, pat: *u8, patlen: i64, cat: i64) -> i64
called by 2: wf_addcwf_add_list
32func wf_addc(t: *i64, kind: i64, pat: *u8, cat: i64) -> i64 { return wf_add(t, kind, pat, wf_slen(pat), cat) }
called by 1: wf_seed calls 2: wf_addwf_slen
35func wf_add_list(t: *i64, cat: i64, s: *u8) -> i64
called by 1: wf_seed calls 1: wf_add
51func wf_seed(t: *i64) -> i64
called by 4: mainmainmainmain calls 2: wf_addcwf_add_list
71func wf_should_block(t: *i64, url: *u8, ul: i64, out_cat: *i64) -> i64
called by 2: cs_verdictmain calls 1: xt_find
88func wf_cat_name(c: i64) -> *u8