BREAKING: Interface name is now specified by configuration file
All checks were successful
continuous-integration/drone/push Build is passing

The syntax for the hypd server command has changed.  Now instead of specifying an interface name as an argument to the server command, you instead specify a configuration file path.

Example:
./hypd server hypdconfig.json
This commit is contained in:
2024-04-17 19:41:24 -06:00
parent e95b4972da
commit 1ffadf5c86
5 changed files with 38 additions and 23 deletions

View File

@ -49,11 +49,11 @@ var (
// PacketServer is the main function when operating in server mode
// it sets up the pcap on the capture device and starts a goroutine
// to rotate the knock sequence
func PacketServer(captureDevice string, config *configuration.HypdConfiguration) error {
func PacketServer(config *configuration.HypdConfiguration) error {
iface, err := net.InterfaceByName(captureDevice)
iface, err := net.InterfaceByName(config.NetworkInterface)
if err != nil {
log.Fatalf("lookup network iface %q: %v", captureDevice, err)
log.Fatalf("lookup network iface %q: %v", config.NetworkInterface, err)
}
secretBytes, err := os.ReadFile("hyp.secret")