mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-07-28 09:41:51 +03:00
Add ping support for WireGuard endpoint
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
"github.com/sagernet/sing-tun"
|
||||
"github.com/sagernet/sing/common/logger"
|
||||
N "github.com/sagernet/sing/common/network"
|
||||
@@ -17,6 +18,8 @@ type Device interface {
|
||||
N.Dialer
|
||||
Start() error
|
||||
SetDevice(device *device.Device)
|
||||
Inet4Address() netip.Addr
|
||||
Inet6Address() netip.Addr
|
||||
}
|
||||
|
||||
type DeviceOptions struct {
|
||||
@@ -41,3 +44,8 @@ func NewDevice(options DeviceOptions) (Device, error) {
|
||||
return newSystemStackDevice(options)
|
||||
}
|
||||
}
|
||||
|
||||
type NatDevice interface {
|
||||
Device
|
||||
CreateDestination(metadata adapter.InboundContext, routeContext tun.DirectRouteContext) (tun.DirectRouteDestination, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user