forked from SagerNet/sing-tun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredirect.go
36 lines (30 loc) · 831 Bytes
/
redirect.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package tun
import (
"context"
"github.com/sagernet/sing/common/control"
"github.com/sagernet/sing/common/logger"
N "github.com/sagernet/sing/common/network"
"go4.org/netipx"
)
const (
DefaultAutoRedirectInputMark = 0x2023
DefaultAutoRedirectOutputMark = 0x2024
)
type AutoRedirect interface {
Start() error
Close() error
UpdateRouteAddressSet()
}
type AutoRedirectOptions struct {
TunOptions *Options
Context context.Context
Handler N.TCPConnectionHandlerEx
Logger logger.Logger
NetworkMonitor NetworkUpdateMonitor
InterfaceFinder control.InterfaceFinder
TableName string
DisableNFTables bool
CustomRedirectPort func() int
RouteAddressSet *[]*netipx.IPSet
RouteExcludeAddressSet *[]*netipx.IPSet
}