netbird/iface/iface_android.go
Zoltan Papp 891ba277b1
Mobile (#735)
Initial modification to support mobile client

Export necessary interfaces for Android framework
2023-03-17 10:37:27 +01:00

23 lines
457 B
Go

package iface
import "sync"
// NewWGIFace Creates a new Wireguard interface instance
func NewWGIFace(ifaceName string, address string, mtu int, tunAdapter TunAdapter) (*WGIface, error) {
wgIface := &WGIface{
mu: sync.Mutex{},
}
wgAddress, err := parseWGAddress(address)
if err != nil {
return wgIface, err
}
tun := newTunDevice(wgAddress, mtu, tunAdapter)
wgIface.tun = tun
wgIface.configurer = newWGConfigurer(tun)
return wgIface, nil
}