Add ARP scanner status API endpoint and rename scanner module

Renames scanner.rs to arp_scanner.rs to future-proof for additional scanner
types. Renames the [timings] config section to [arp_scanner] and simplifies
field names (arp_sender_timeout -> sender_timeout, arp_scan_duration ->
scan_duration). Introduces arp_scanner_status module to track whether the
scan is actively running or sleeping, and exposes this via a new
GET /api/arp_scanner/status endpoint returning is_running,
running_for_seconds, and next_run_in_seconds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-28 17:57:26 -04:00
co-authored by Claude Sonnet 4.6
parent 97e4bb1000
commit 020c7d2c49
8 changed files with 193 additions and 15 deletions
+4 -4
View File
@@ -22,10 +22,10 @@ pub struct Log {
}
#[derive(Debug, Deserialize, Clone)]
pub struct Timings {
pub struct ArpScanner {
pub wait_between_scans: DurationString,
pub arp_sender_timeout: DurationString,
pub arp_scan_duration: DurationString,
pub sender_timeout: DurationString,
pub scan_duration: DurationString,
}
#[derive(Debug, Deserialize, Clone)]
@@ -66,7 +66,7 @@ pub struct Settings {
pub database: Database,
pub networking: Networking,
pub log: Log,
pub timings: Timings,
pub arp_scanner: ArpScanner,
pub notifications: Notifications,
pub web_server: WebServer,
#[serde(default)]