mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-14 00:51:12 +03:00
17 lines
358 B
Go
17 lines
358 B
Go
//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,
|
|
})
|
|
}
|