code wiki / _hdl_build / nx_conn_cap.nx
nx_conn_cap.nx
buildroot/runtime/_hdl_build/nx_conn_cap.nx
about
nx_conn_cap.nx -- per-IP concurrent-connection cap, the access-wall DDoS L3-connection / slowloris defense
(RFC 7230 timeouts complement). A bounded in-memory table the enforcement daemon owns: cc_acquire(ip) at
accept (reject when an IP already holds >= cap, OR when the table is saturated = FAIL-CLOSED under a flood),
cc_release(ip) on close. Pure logic, nx_syscalls -- pairs with nx_rate_limit (request brute-force, L4) +
nx_access_wall (the rate_ok / conn-ok signals feed the PDP). license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_conn_cap_gate.nx
structs
| none |
consts
| 8 | const CC_CAP_DEFAULT: i64 = 16 // default max concurrent connections per IP |
functions
| 11 | func cc_find(ips: *i64, n: i64, ip: i64) -> i64 |
| 20 | func cc_acquire(ips: *i64, cnts: *i64, nbox: *i64, slots: i64, ip: i64, cap: i64) -> i64 |
| 35 | func cc_release(ips: *i64, cnts: *i64, nbox: *i64, ip: i64) -> i64 |
| 49 | func cc_count(ips: *i64, cnts: *i64, nbox: *i64, ip: i64) -> i64 |