code wiki / _hdl_build / nx_hr_visitor_log.nx
nx_hr_visitor_log.nx
buildroot/runtime/_hdl_build/nx_hr_visitor_log.nx
about
nx_hr_visitor_log.nx -- NISHI HR, rung C: drive the front desk from REAL request logs. Parses a daemon access
log (one request per line: `ip <TAB> path <TAB> user-agent`), aggregates per-IP request counts over the window,
classifies each distinct visitor via hv_classify (rate + bot-UA + lists), writes a verdict report, and
AUTO-BLOCKLISTS the ones it BLOCKs (so the next request is dropped at the door). This turns the visitor policy
from a static list into BEHAVIOR-driven enforcement. Composes nx_hr_visitor. (Per-path anomaly + log rotation
+ dedup of the auto-blocklist = later rungs; this is the core behavior sweep.) license_tier: ORIGINAL
dependencies 3 imports · 1 importers
imports: nx_hr_visitor.nxnx_hr.nxnx_syscalls.nx
imported by: nx_hr_visitor_log_gate.nx
structs
| none |
consts
| 10 | const K_MAGIC_1048576: i64 = 1048576 |
functions
| 13 | func hvl_count_ip(buf: *u8, n: i64, ip: *u8, iplen: i64) -> i64 |
| 19 | func hvl_is_first(buf: *u8, before: i64, ip: *u8, iplen: i64) -> i64 |
| 25 | func hvl_ua_of_line(buf: *u8, ls: i64, le: i64, out: *u8, cap: i64) -> i64 |
| 32 | func hvl_append_block(block_path: *u8, ip: *u8, iplen: i64) -> i64 |
| 41 | func hvl_sweep(log_path: *u8, window_sec: i64, block_path: *u8, welcome_path: *u8, report_path: *u8) -> i64 |