code wiki / _hdl_build / nx_hr_visitor_log.nx

nx_hr_visitor_log.nx

buildroot/runtime/_hdl_build/nx_hr_visitor_log.nx

3831 B66 linesdepth 12pulls 19 transitivereach 1 importersview sourcekind librarytopic hr
docsdependenciesstructsconstsfunctions

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

nx_hr_visitor.nx nx_hr.nx nx_syscalls.nx nx_hr_visitor_log.nx nx_hr_visitor_log_gate.nx

imports: nx_hr_visitor.nxnx_hr.nxnx_syscalls.nx

imported by: nx_hr_visitor_log_gate.nx

structs

none

consts

10const K_MAGIC_1048576: i64 = 1048576

functions

13func hvl_count_ip(buf: *u8, n: i64, ip: *u8, iplen: i64) -> i64
19func hvl_is_first(buf: *u8, before: i64, ip: *u8, iplen: i64) -> i64
25func hvl_ua_of_line(buf: *u8, ls: i64, le: i64, out: *u8, cap: i64) -> i64
called by 1: hvl_sweep calls 1: hr_field_end
32func hvl_append_block(block_path: *u8, ip: *u8, iplen: i64) -> i64
41func hvl_sweep(log_path: *u8, window_sec: i64, block_path: *u8, welcome_path: *u8, report_path: *u8) -> i64