code wiki / _hdl_build / nx_netscope_capture.nx
nx_netscope_capture.nx
buildroot/runtime/_hdl_build/nx_netscope_capture.nx
about
nx_netscope_capture.nx -- NX-NETSCOPE L-CAPTURE: the SOVEREIGN raw-wire capture front-end (the
"wireshark" tap, in-ecosystem, NO tcpdump). Opens an AF_PACKET raw socket, reads frames, and feeds
each to the EXISTING pure dissector nx_packet_dissect (nx_netscope_dissect.nx). Filters inbound TCP
SYN (no ACK) to a chosen dest port and prints src-ip -> dst-ip:port -- so we can SEE which NAS
interface/IP a public :443 connection actually lands on (answering "where does external ingress go"
with a capture, not a guess). Bounded: per-recv timeout + wall-clock deadline, so it NEVER hangs.
usage: nx_netscope_capture [dport=443] [seconds=90] [maxrows=200]
Needs CAP_NET_RAW (run as root). license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_netscope_dissect.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
| 11 | const NXC_MAGIC_65536: i64 = 65536 |
| 13 | const NXC_AF_PACKET: i64 = 17 |
| 14 | const NXC_SOCK_RAW: i64 = 3 |
| 15 | const NXC_ETH_P_ALL_BE: i64 = 768 // htons(0x0003) = 0x0300 |
functions
| 17 | func c_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 18 | func c_n(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 19 | func c_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 20 | func c_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v } called by 1: main |
| 22 | func c_ip(p: i64) -> i64 |
| 27 | func main(argc: i64, argv: *i64) -> i64 |