code wiki / (root) / nx_ipfilter.nx

nx_ipfilter.nx

buildroot/runtime/nx_ipfilter.nx

2581 B42 linesdepth 2pulls 2 transitivereach 15 importersview sourcekind librarytopic ipfilter
docsdependenciesstructsconstsfunctions

about

nx_ipfilter.nx -- SOVEREIGN IP blocklist (BitTorrent ip-filter): reject known-bad / anti-P2P-monitor IP ranges before we connect to them (worker) or accept them (seeder). Real privacy while WAN-seeding. Binary blocklist format (ipfilter.bin): 8 bytes/entry = [start u32 LE][end u32 LE], inclusive IPv4 range. Linear scan per check -- home-scale connection rate makes even 100k ranges <1ms + it's done once per peer. Load ONCE (parent), children inherit the array via fork COW. license_tier: ORIGINAL depends: nx_syscalls

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_ipfilter.nx nx_ipfilter_fetch.nx nx_torrent_get.nx nx_torrent_seed.nx

imports: nx_syscalls.nx

imported by: nx_ipfilter_fetch.nxnx_torrent_get.nxnx_torrent_seed.nx

structs

none

consts

none

functions

9func ipf_ip(a: i64, b: i64, c: i64, d: i64) -> i64 { return ((a&0xff)<<24)|((b&0xff)<<16)|((c&0xff)<<8)|(d&0xff) }
11func ipf_u32le(buf: *u8, off: i64) -> i64 { return (buf[off] as i64)|((buf[off+1] as i64)<<8)|((buf[off+2] as i64)<<16)|((buf[off+3] as i64)<<24) }
called by 1: ipf_load
13func ipf_put_u32le(buf: *u8, off: i64, v: i64) -> i64 { buf[off]=(v&0xff) as u8; buf[off+1]=((v>>8)&0xff) as u8; buf[off+2]=((v>>16)&0xff) as u8; buf[off+3]=((v>>24)&0xff) as u8; return off+4 }
called by 1: main
17func ipf_load(path: *u8, arr: *i64, maxpairs: i64) -> i64
30func ipf_blocked(arr: *i64, count: i64, ip: i64) -> i64
37func ipf_blocked_ip(path: *u8, ip: i64, maxpairs: i64) -> i64