[client] Remove the replace directives from the embedded client (#8280)

This commit is contained in:
Viktor Liu
2026-10-22 17:39:22 +09:00
committed by GitHub
parent f886f4b06c
commit abf50e3ad4
91 changed files with 418 additions and 343 deletions
+27
View File
@@ -0,0 +1,27 @@
package wgbackend
import "github.com/netbirdio/wireguard-go/conn"
type (
BatchReader = conn.BatchReader
Bind = conn.Bind
Endpoint = conn.Endpoint
ReceiveFunc = conn.ReceiveFunc
StdNetBind = conn.StdNetBind
StdNetEndpoint = conn.StdNetEndpoint
)
const (
IdealBatchSize = conn.IdealBatchSize
UdpSegmentMaxDatagrams = conn.UdpSegmentMaxDatagrams
)
var (
ControlFns = conn.ControlFns
GetGSOSize = conn.GetGSOSize
GetSrcFromControl = conn.GetSrcFromControl
NewDefaultBind = conn.NewDefaultBind
NewStdNetBind = conn.NewStdNetBind
NewStdNetBindWithReceiverCreator = conn.NewStdNetBindWithReceiverCreator
SplitCoalescedMessages = conn.SplitCoalescedMessages
)
+24
View File
@@ -0,0 +1,24 @@
package wgbackend
import "github.com/netbirdio/wireguard-go/device"
type (
Device = device.Device
NoisePresharedKey = device.NoisePresharedKey
NoisePrivateKey = device.NoisePrivateKey
NoisePublicKey = device.NoisePublicKey
Peer = device.Peer
PeerConfig = device.PeerConfig
)
const (
LogLevelSilent = device.LogLevelSilent
LogLevelVerbose = device.LogLevelVerbose
)
var (
NewDevice = device.NewDevice
NewLogger = device.NewLogger
SetMaxBatchSizeOverride = device.SetMaxBatchSizeOverride
SetPreallocatedBuffersPerPool = device.SetPreallocatedBuffersPerPool
)
+5
View File
@@ -0,0 +1,5 @@
// Package wgbackend is the single place in the client's hand-written code that names
// the WireGuard implementation. Other packages import it instead of the wireguard-go
// packages, so swapping the implementation only touches the aliases here and the
// generated mocks.
package wgbackend
+10
View File
@@ -0,0 +1,10 @@
//go:build linux || darwin || freebsd || openbsd
package wgbackend
import "github.com/netbirdio/wireguard-go/ipc"
var (
UAPIListen = ipc.UAPIListen
UAPIOpen = ipc.UAPIOpen
)
+5
View File
@@ -0,0 +1,5 @@
package wgbackend
import "github.com/netbirdio/wireguard-go/ipc"
var UAPIListen = ipc.UAPIListen
+19
View File
@@ -0,0 +1,19 @@
package wgbackend
import (
"github.com/netbirdio/wireguard-go/tun"
"github.com/netbirdio/wireguard-go/tun/netstack"
)
type (
// TUN is the packet device the WireGuard device reads from and writes to.
TUN = tun.Device
// TUNEvent is a status change reported by a TUN.
TUNEvent = tun.Event
// NetstackNet is the userspace network stack a netstack TUN is attached to.
NetstackNet = netstack.Net
)
const TUNEventDown = tun.EventDown
var CreateNetTUN = netstack.CreateNetTUN
+5
View File
@@ -0,0 +1,5 @@
package wgbackend
import "github.com/netbirdio/wireguard-go/tun"
var CreateUnmonitoredTUNFromFD = tun.CreateUnmonitoredTUNFromFD
+10
View File
@@ -0,0 +1,10 @@
//go:build linux || darwin || freebsd || openbsd
package wgbackend
import "github.com/netbirdio/wireguard-go/tun"
var (
CreateTUN = tun.CreateTUN
CreateTUNFromFile = tun.CreateTUNFromFile
)
+7
View File
@@ -0,0 +1,7 @@
package wgbackend
import "github.com/netbirdio/wireguard-go/tun"
type NativeTUN = tun.NativeTun
var CreateTUNWithRequestedGUID = tun.CreateTUNWithRequestedGUID