code wiki / _hdl_build / nx_video_sniff_fetch.nx

nx_video_sniff_fetch.nx

buildroot/runtime/_hdl_build/nx_video_sniff_fetch.nx

18434 B320 linesdepth 21pulls 172 transitivereach 16 importersview sourcekind librarytopic video
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_hls_resolve.nx nx_video_sniff.nx nx_video_sniff_fetch.nx nx_archive_daemon.nx nx_cleanserve_resolve.nx nx_cleanview.nx nx_click_test.nx nx_jq_locate.nx nx_jq_realpage.nx nx_jq_run.nx nx_jq_test.nx nx_jq_tree.nx nx_media_sniff_daemon.nx

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

12const VSF_MAGIC_65536: i64 = 65536
13const VSF_MAGIC_8192: i64 = 8192
14const VSF_MAGIC_8191: i64 = 8191
15const VSF_MAGIC_4096: i64 = 4096
16const VSF_MAGIC_4095: i64 = 4095
17const VSF_MAGIC_1024: i64 = 1024
18const VSF_MAGIC_2097152: i64 = 2097152
20const VSF_HTMLCAP: i64 = 4194304
21const VSF_EXTCAP: i64 = 4194304
22const VSF_BUNCAP: i64 = 2097152
23const VSF_MAXSRC: i64 = 8

functions

25func vsf_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
29func vsf_sniff_url(url: *u8, ulen: i64, store: *TrustStore, planbuf: *u8, plancap: i64, cpu_secs: i64) -> i64
81func vsf_sniff_url_pre(url: *u8, ulen: i64, store: *TrustStore, preamble: *u8, plen: i64, planbuf: *u8, plancap: i64, cpu_secs: i64) -> i64
137func vn_lc(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c }
called by 1: vn_pfx_ci
138func 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 }
called by 1: vn_url_safe calls 1: vn_lc
139func vn_url_safe(url: *u8, ulen: i64) -> i64
calls 1: vn_pfx_ci
157func 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 }
158func vn_at(buf: *u8, pos: i64, n: i64, lit: *u8, litlen: i64) -> i64
167func vn_scan_media(body: *u8, bn: i64, best: *u8, brankp: *i64, bkindp: *i64) -> i64
196func 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
274func vsf_sniff_url_net(url: *u8, ulen: i64, store: *TrustStore, preamble: *u8, plen: i64, planbuf: *u8, plancap: i64, max_rounds: i64) -> i64