code wiki / _hdl_build / nx_media_sniff_daemon.nx
nx_media_sniff_daemon.nx
buildroot/runtime/_hdl_build/nx_media_sniff_daemon.nx
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
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
structs
| none |
consts
| 14 | const K_MAGIC_18092: i64 = 18092 |
| 15 | const K_MAGIC_4194304: i64 = 4194304 |
| 16 | const K_MAGIC_1048576: i64 = 1048576 |
| 17 | const K_MAGIC_16384: i64 = 16384 |
| 18 | const K_MAGIC_8192: i64 = 8192 |
| 19 | const K_MAGIC_2560: i64 = 2560 |
functions
| 21 | func dlog(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(2,s,n); return 0 } |
| 22 | func 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 } |
| 23 | func 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 } |
| 24 | func 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 |
| 25 | func 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 |
| 28 | func send_resp(cfd: i64, ctype: *u8, body: *u8, blen: i64) -> i64 |
| 40 | func slen2(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 41 | func 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 |
| 43 | func main(argc: i64, argv: *i64) -> i64 |