Add configuration system and ARP-based device discovery

Implement comprehensive configuration management with CLI flags for WiFi interface, device discovery method, and file paths. Add ARP table parsing as an alternative to DHCP leases for more reliable device detection. Improve WiFi scanning to handle concurrent scan requests gracefully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2025-12-28 18:51:15 +07:00
commit 2b3a5b89f8
8 changed files with 156 additions and 28 deletions

View file

@ -9,7 +9,11 @@ import (
)
type Config struct {
Bind string
Bind string
WifiInterface string
UseARPDiscovery bool
DHCPLeasesPath string
ARPTablePath string
}
// ConsolidateConfig fills an Options struct by reading configuration from
@ -19,7 +23,11 @@ type Config struct {
func ConsolidateConfig() (opts *Config, err error) {
// Define defaults options
opts = &Config{
Bind: ":8080",
Bind: ":8080",
WifiInterface: "wlan0",
UseARPDiscovery: true,
DHCPLeasesPath: "/var/lib/dhcp/dhcpd.leases",
ARPTablePath: "/proc/net/arp",
}
declareFlags(opts)