mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-14 01:08:46 +02:00
Split create Interface based on OS
This commit is contained in:
@ -4,9 +4,15 @@ package iface
|
||||
|
||||
import (
|
||||
"golang.zx2c4.com/wireguard/ipc"
|
||||
"golang.zx2c4.com/wireguard/tun"
|
||||
"net"
|
||||
)
|
||||
|
||||
// createIface creates a tun device
|
||||
func createIface(iface string, defaultMTU int) (tun.Device, error) {
|
||||
return tun.CreateTUN(iface, defaultMTU)
|
||||
}
|
||||
|
||||
// getUAPI returns a Listener
|
||||
func getUAPI(iface string) (net.Listener, error) {
|
||||
tunSock, err := ipc.UAPIOpen(iface)
|
||||
|
Reference in New Issue
Block a user