create default peers for newly created interfaces (#666)

This commit is contained in:
Christoph Haas
2026-04-16 20:52:06 +02:00
parent 51e4c0ebf1
commit 274affb17e
15 changed files with 284 additions and 66 deletions

View File

@@ -240,6 +240,18 @@ func (i *Interface) GetRoutingTable() int {
}
}
// CreateDefaultPeers determines whether default peers should be created for this interface.
func (i *Interface) CreateDefaultPeers() bool {
if !i.CreateDefaultPeer {
return false // only create default peers if the interface flag is set
}
if i.Type != InterfaceTypeServer {
return false // only create default peers for server interfaces
}
return true
}
type PhysicalInterface struct {
Identifier InterfaceIdentifier // device name, for example: wg0
KeyPair // private/public Key of the server interface