forked from extern/smegmesh
b179cd3cf4
Hashing the interface and using ephmeral ports so that the admin doesn't choose an interface and port combination. An administrator can alteranatively decide to provide port but this isn't critical.
19 lines
431 B
Go
19 lines
431 B
Go
package wg
|
|
|
|
type WgError struct {
|
|
msg string
|
|
}
|
|
|
|
func (m *WgError) Error() string {
|
|
return m.msg
|
|
}
|
|
|
|
type WgInterfaceManipulator interface {
|
|
// CreateInterface creates a WireGuard interface
|
|
CreateInterface(port int) (string, error)
|
|
// AddAddress adds an address to the given interface name
|
|
AddAddress(ifName string, addr string) error
|
|
// RemoveInterface removes the specified interface
|
|
RemoveInterface(ifName string) error
|
|
}
|