netbird/iface/iface_unix.go
2021-06-06 23:59:19 +02:00

18 lines
289 B
Go

// +build linux darwin
package iface
import (
"golang.zx2c4.com/wireguard/ipc"
"net"
)
// getUAPI returns a Listener
func getUAPI(iface string) (net.Listener, error) {
tunSock, err := ipc.UAPIOpen(iface)
if err != nil {
return nil, err
}
return ipc.UAPIListen(iface, tunSock)
}