[client] Add embeddable library (#3239)

This commit is contained in:
Viktor Liu
2025-02-20 13:22:03 +01:00
committed by GitHub
parent 39986b0e97
commit 631ef4ed28
22 changed files with 648 additions and 51 deletions
+9
View File
@@ -9,6 +9,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/pion/transport/v3"
log "github.com/sirupsen/logrus"
"golang.zx2c4.com/wireguard/tun/netstack"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
wgdevice "golang.zx2c4.com/wireguard/device"
@@ -241,3 +242,11 @@ func (w *WGIface) waitUntilRemoved() error {
}
}
}
// GetNet returns the netstack.Net for the netstack device
func (w *WGIface) GetNet() *netstack.Net {
w.mu.Lock()
defer w.mu.Unlock()
return w.tun.GetNet()
}