mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-02 18:14:01 +00:00
776728fb30
update gvisor Chore: use "-m mark --mark" instead of "-m owner --uid-owner"
35 lines
581 B
Go
35 lines
581 B
Go
package dialer
|
|
|
|
import "go.uber.org/atomic"
|
|
|
|
var (
|
|
DefaultOptions []Option
|
|
DefaultInterface = atomic.NewString("")
|
|
DefaultRoutingMark = atomic.NewInt32(0)
|
|
)
|
|
|
|
type option struct {
|
|
interfaceName string
|
|
addrReuse bool
|
|
routingMark int
|
|
}
|
|
|
|
type Option func(opt *option)
|
|
|
|
func WithInterface(name string) Option {
|
|
return func(opt *option) {
|
|
opt.interfaceName = name
|
|
}
|
|
}
|
|
|
|
func WithAddrReuse(reuse bool) Option {
|
|
return func(opt *option) {
|
|
opt.addrReuse = reuse
|
|
}
|
|
}
|
|
|
|
func WithRoutingMark(mark int) Option {
|
|
return func(opt *option) {
|
|
opt.routingMark = mark
|
|
}
|
|
}
|