mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-25 17:43:38 +01:00
18 lines
289 B
Go
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)
|
|
}
|