Improve darwin tun performance
This commit is contained in:
parent
8763c24e49
commit
a0881ada32
16 changed files with 1894 additions and 159 deletions
7
tun.go
7
tun.go
|
|
@ -8,6 +8,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/sagernet/sing/common/buf"
|
||||
"github.com/sagernet/sing/common/control"
|
||||
F "github.com/sagernet/sing/common/format"
|
||||
"github.com/sagernet/sing/common/logger"
|
||||
|
|
@ -45,6 +46,12 @@ type LinuxTUN interface {
|
|||
TXChecksumOffload() bool
|
||||
}
|
||||
|
||||
type DarwinTUN interface {
|
||||
Tun
|
||||
BatchRead() ([]*buf.Buffer, error)
|
||||
BatchWrite(buffers []*buf.Buffer) error
|
||||
}
|
||||
|
||||
const (
|
||||
DefaultIPRoute2TableIndex = 2022
|
||||
DefaultIPRoute2RuleIndex = 9000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue