sing-box/transport/wireguard/device.go
2023-03-22 01:36:17 +08:00

24 lines
461 B
Go

package wireguard
import (
"net/netip"
"github.com/sagernet/sing-tun"
N "github.com/sagernet/sing/common/network"
wgTun "github.com/sagernet/wireguard-go/tun"
)
type Device interface {
wgTun.Device
N.Dialer
Start() error
Inet4Address() netip.Addr
Inet6Address() netip.Addr
// NewEndpoint() (stack.LinkEndpoint, error)
}
type NatDevice interface {
Device
CreateDestination(session tun.RouteSession, conn tun.RouteContext) tun.DirectDestination
}