code wiki / _hdl_build / nx_media_sniff_daemon.nx

nx_media_sniff_daemon.nx

buildroot/runtime/_hdl_build/nx_media_sniff_daemon.nx

6801 B106 linesdepth 22pulls 176 transitivereach 0 importersview sourcekind servicetopic media
docsdependenciesstructsconstsfunctions

about

nx_media_sniff_daemon.nx -- the API ENDPOINT: an HTTP server exposing the video sniffer. GET /sniff?url=<percent-encoded page url> -> 200 {"found":..,"route":..,"url":..} GET / -> 200 nx_media_sniff_daemon ok (health) Reuses nx_http_server (listen/accept/read/send) + the shared vsf_sniff_url (fetch page + bundles over sovereign TLS + guarded sniff). Loopback bind by default (front it with the OPAQUE gateway to go public). Run: nx_media_sniff_daemon [port] (from nxc2 root -- certdata path is relative). license_tier: ORIGINAL

dependencies 7 imports · 0 importers

nx_syscalls.nx nx_http_server.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_video_sniff.nx nx_video_sniff_fetch.nx nx_extract_heal.nx nx_media_sniff_daemon.nx

imports: nx_syscalls.nxnx_http_server.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_video_sniff.nxnx_video_sniff_fetch.nxnx_extract_heal.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main datoi nx_trust_store_load_from_c sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻ x509_read_alg_id sys_mmap ↻

structs

none

consts

14const K_MAGIC_18092: i64 = 18092
15const K_MAGIC_4194304: i64 = 4194304
16const K_MAGIC_1048576: i64 = 1048576
17const K_MAGIC_16384: i64 = 16384
18const K_MAGIC_8192: i64 = 8192
19const K_MAGIC_2560: i64 = 2560

functions

21func dlog(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(2,s,n); return 0 }
called by 1: main calls 1: sys_write
22func dput(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 }
called by 2: send_respmain
23func dputn(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 2: send_respmain calls 1: sys_mmap
24func 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: main
25func 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 }
called by 1: main
28func send_resp(cfd: i64, ctype: *u8, body: *u8, blen: i64) -> i64
40func slen2(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
41func dcontains(hay: *u8, hl: i64, needle: *u8) -> i64 { var nl: i64=0; while needle[nl]!=(0 as u8){nl=nl+1} if nl==0 { return 1 } 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 }
called by 1: main
43func main(argc: i64, argv: *i64) -> i64