Files
sing-box-extended-mirror/common/tun/gvisor_linux.go
T

17 lines
358 B
Go
Raw Normal View History

2022-07-09 19:18:37 +08:00
//go:build linux
package tun
import (
"gvisor.dev/gvisor/pkg/tcpip/link/fdbased"
"gvisor.dev/gvisor/pkg/tcpip/stack"
)
func NewEndpoint(tunFd uintptr, tunMtu uint32) (stack.LinkEndpoint, error) {
return fdbased.New(&fdbased.Options{
FDs: []int{int(tunFd)},
MTU: tunMtu,
PacketDispatchMode: fdbased.PacketMMap,
})
}