code wiki / _hdl_build / nx_video_sniff_fetch.nx
nx_video_sniff_fetch.nx
buildroot/runtime/_hdl_build/nx_video_sniff_fetch.nx
about
nx_video_sniff_fetch.nx -- the TLS-aware "sniff a URL" core, SHARED by the CLI and the API daemon (DRY;
consolidates the fetch+extract+guarded-sniff flow). Given a page URL + a loaded trust store: fetch the
page over sovereign TLS-1.3, fetch its external <script src> bundles (bounded), and run the whole thing
through the GUARDED sniff -> a "ROUTE=<r> URL=<u>" plan (VSK_* kind). No network happens in the guarded
child (page + bundles are fetched HERE; the child only runs the JS via pending-capture). license_tier: ORIGINAL
dependencies 6 imports · 15 importers
diagram shows first 10 each side; +0 more imports, +5 more importers in the complete lists below.
imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nxnx_hls_resolve.nxnx_video_sniff.nx
imported by: nx_archive_daemon.nxnx_cleanserve_resolve.nxnx_cleanview.nxnx_click_test.nxnx_jq_locate.nxnx_jq_realpage.nxnx_jq_run.nxnx_jq_test.nxnx_jq_tree.nxnx_media_sniff_daemon.nxnx_pre_test.nxnx_sniff_net_cli.nxnx_video_sniff_cli.nxnx_vk_js.nxnx_wdoc_test.nx
structs
| none |
consts
| 12 | const VSF_MAGIC_65536: i64 = 65536 |
| 13 | const VSF_MAGIC_8192: i64 = 8192 |
| 14 | const VSF_MAGIC_8191: i64 = 8191 |
| 15 | const VSF_MAGIC_4096: i64 = 4096 |
| 16 | const VSF_MAGIC_4095: i64 = 4095 |
| 17 | const VSF_MAGIC_1024: i64 = 1024 |
| 18 | const VSF_MAGIC_2097152: i64 = 2097152 |
| 20 | const VSF_HTMLCAP: i64 = 4194304 |
| 21 | const VSF_EXTCAP: i64 = 4194304 |
| 22 | const VSF_BUNCAP: i64 = 2097152 |
| 23 | const VSF_MAXSRC: i64 = 8 |
functions
| 25 | func vsf_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 29 | func vsf_sniff_url(url: *u8, ulen: i64, store: *TrustStore, planbuf: *u8, plancap: i64, cpu_secs: i64) -> i64 called by 2: mainmain calls 5: sys_mmapvs_putsvs_extract_script_srcsnx_hls_resolve_urivs_sniff_page_bundled |
| 81 | func vsf_sniff_url_pre(url: *u8, ulen: i64, store: *TrustStore, preamble: *u8, plen: i64, planbuf: *u8, plancap: i64, cpu_secs: i64) -> i64 called by 1: ad_home calls 5: sys_mmapvs_putsvs_extract_script_srcsnx_hls_resolve_urivs_sniff_page_bundled_pre |
| 137 | func vn_lc(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c } called by 1: vn_pfx_ci |
| 138 | func vn_pfx_ci(s: *u8, sl: i64, p: *u8) -> i64 { var i: i64=0; while p[i]!=(0 as u8) { if i>=sl { return 0 } if vn_lc(s[i]&0xff)!=vn_lc(p[i]&0xff) { return 0 } i=i+1 } return 1 } |
| 139 | func vn_url_safe(url: *u8, ulen: i64) -> i64 calls 1: vn_pfx_ci |
| 157 | func vn_term(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==10 { return 1 } if c==13 { return 1 } if c==0 { return 1 } if c==92 { return 1 } return 0 } |
| 158 | func vn_at(buf: *u8, pos: i64, n: i64, lit: *u8, litlen: i64) -> i64 |
| 167 | func vn_scan_media(body: *u8, bn: i64, best: *u8, brankp: *i64, bkindp: *i64) -> i64 |
| 196 | func vs_sniff_net_bundled(preamble: *u8, plen: i64, html: *u8, hlen: i64, extjs: *u8, extlen: i64, store: *TrustStore, planbuf: *u8, plancap: i64, max_rounds: i64) -> i64 |
| 274 | func vsf_sniff_url_net(url: *u8, ulen: i64, store: *TrustStore, preamble: *u8, plen: i64, planbuf: *u8, plancap: i64, max_rounds: i64) -> i64 |