Skip to content

Commit 11ba253

Browse files
committed
Merge branch 'main' into feature/detect-mac-wakeup
2 parents 14fe7c2 + af95aab commit 11ba253

29 files changed

+1693
-75
lines changed

client/iface/device.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ type WGTunDevice interface {
2323
FilteredDevice() *device.FilteredDevice
2424
Device() *wgdevice.Device
2525
GetNet() *netstack.Net
26+
GetICEBind() device.EndpointManager
2627
}

client/iface/device/device_android.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ func (t *WGTunDevice) GetNet() *netstack.Net {
150150
return nil
151151
}
152152

153+
// GetICEBind returns the ICEBind instance
154+
func (t *WGTunDevice) GetICEBind() EndpointManager {
155+
return t.iceBind
156+
}
157+
153158
func routesToString(routes []string) string {
154159
return strings.Join(routes, ";")
155160
}

client/iface/device/device_darwin.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,8 @@ func (t *TunDevice) assignAddr() error {
154154
func (t *TunDevice) GetNet() *netstack.Net {
155155
return nil
156156
}
157+
158+
// GetICEBind returns the ICEBind instance
159+
func (t *TunDevice) GetICEBind() EndpointManager {
160+
return t.iceBind
161+
}

client/iface/device/device_ios.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,8 @@ func (t *TunDevice) FilteredDevice() *FilteredDevice {
144144
func (t *TunDevice) GetNet() *netstack.Net {
145145
return nil
146146
}
147+
148+
// GetICEBind returns the ICEBind instance
149+
func (t *TunDevice) GetICEBind() EndpointManager {
150+
return t.iceBind
151+
}

client/iface/device/device_kernel_unix.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,8 @@ func (t *TunKernelDevice) assignAddr() error {
179179
func (t *TunKernelDevice) GetNet() *netstack.Net {
180180
return nil
181181
}
182+
183+
// GetICEBind returns nil for kernel mode devices
184+
func (t *TunKernelDevice) GetICEBind() EndpointManager {
185+
return nil
186+
}

client/iface/device/device_netstack.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type Bind interface {
2121
conn.Bind
2222
GetICEMux() (*udpmux.UniversalUDPMuxDefault, error)
2323
ActivityRecorder() *bind.ActivityRecorder
24+
EndpointManager
2425
}
2526

2627
type TunNetstackDevice struct {
@@ -155,3 +156,8 @@ func (t *TunNetstackDevice) Device() *device.Device {
155156
func (t *TunNetstackDevice) GetNet() *netstack.Net {
156157
return t.net
157158
}
159+
160+
// GetICEBind returns the bind instance
161+
func (t *TunNetstackDevice) GetICEBind() EndpointManager {
162+
return t.bind
163+
}

client/iface/device/device_usp_unix.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,8 @@ func (t *USPDevice) assignAddr() error {
146146
func (t *USPDevice) GetNet() *netstack.Net {
147147
return nil
148148
}
149+
150+
// GetICEBind returns the ICEBind instance
151+
func (t *USPDevice) GetICEBind() EndpointManager {
152+
return t.iceBind
153+
}

client/iface/device/device_windows.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,8 @@ func (t *TunDevice) assignAddr() error {
185185
func (t *TunDevice) GetNet() *netstack.Net {
186186
return nil
187187
}
188+
189+
// GetICEBind returns the ICEBind instance
190+
func (t *TunDevice) GetICEBind() EndpointManager {
191+
return t.iceBind
192+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package device
2+
3+
import (
4+
"net"
5+
"net/netip"
6+
)
7+
8+
// EndpointManager manages fake IP to connection mappings for userspace bind implementations.
9+
// Implemented by bind.ICEBind and bind.RelayBindJS.
10+
type EndpointManager interface {
11+
SetEndpoint(fakeIP netip.Addr, conn net.Conn)
12+
RemoveEndpoint(fakeIP netip.Addr)
13+
}

client/iface/device_android.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ type WGTunDevice interface {
2121
FilteredDevice() *device.FilteredDevice
2222
Device() *wgdevice.Device
2323
GetNet() *netstack.Net
24+
GetICEBind() device.EndpointManager
2425
}

0 commit comments

Comments
 (0)