Create wifi backend abstraction
This commit is contained in:
parent
f4481bca62
commit
79c28da9c5
7 changed files with 401 additions and 174 deletions
|
|
@ -11,6 +11,7 @@ import (
|
|||
type Config struct {
|
||||
Bind string
|
||||
WifiInterface string
|
||||
WifiBackend string
|
||||
UseARPDiscovery bool
|
||||
DHCPLeasesPath string
|
||||
ARPTablePath string
|
||||
|
|
@ -75,6 +76,11 @@ func ConsolidateConfig() (opts *Config, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// Validate configuration
|
||||
if opts.WifiBackend != "iwd" && opts.WifiBackend != "wpasupplicant" {
|
||||
log.Fatalf("wifi-backend must be set to 'iwd' or 'wpasupplicant' (got: '%s')", opts.WifiBackend)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue