auto-redirect: Add route address set support for nftables

This commit is contained in:
世界 2024-06-12 02:37:51 +08:00
parent 85fe25a592
commit 85f5f2dd58
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
14 changed files with 1255 additions and 426 deletions

10
tun.go
View file

@ -41,6 +41,11 @@ type LinuxTUN interface {
TXChecksumOffload() bool
}
const (
DefaultIPRoute2TableIndex = 2022
DefaultIPRoute2RuleIndex = 9000
)
type Options struct {
Name string
Inet4Address []netip.Prefix
@ -49,7 +54,11 @@ type Options struct {
GSO bool
AutoRoute bool
DNSServers []netip.Addr
IPRoute2TableIndex int
IPRoute2RuleIndex int
AutoRedirectMarkMode bool
AutoRedirectInputMark uint32
AutoRedirectOutputMark uint32
StrictRoute bool
Inet4RouteAddress []netip.Prefix
Inet6RouteAddress []netip.Prefix
@ -63,7 +72,6 @@ type Options struct {
IncludePackage []string
ExcludePackage []string
InterfaceMonitor DefaultInterfaceMonitor
TableIndex int
FileDescriptor int
Logger logger.Logger