sing-box/experimental/libbox/platform/interface.go

29 lines
885 B
Go
Raw Normal View History

2022-10-25 04:55:00 +00:00
package platform
import (
2023-04-18 06:04:09 +00:00
"context"
2022-10-25 04:55:00 +00:00
2023-04-18 06:04:09 +00:00
"github.com/sagernet/sing-box/adapter"
2022-10-25 04:55:00 +00:00
"github.com/sagernet/sing-box/common/process"
2023-02-28 11:02:27 +00:00
"github.com/sagernet/sing-box/option"
2022-10-25 04:55:00 +00:00
"github.com/sagernet/sing-tun"
"github.com/sagernet/sing/common/control"
2023-07-23 06:42:19 +00:00
"github.com/sagernet/sing/common/logger"
2022-10-25 04:55:00 +00:00
)
type Interface interface {
2023-04-18 06:04:09 +00:00
Initialize(ctx context.Context, router adapter.Router) error
UsePlatformAutoDetectInterfaceControl() bool
2022-10-25 04:55:00 +00:00
AutoDetectInterfaceControl() control.Func
OpenTun(options *tun.Options, platformOptions option.TunPlatformOptions) (tun.Tun, error)
2023-04-18 06:04:09 +00:00
UsePlatformDefaultInterfaceMonitor() bool
2023-07-23 06:42:19 +00:00
CreateDefaultInterfaceMonitor(logger logger.Logger) tun.DefaultInterfaceMonitor
2023-04-18 06:04:09 +00:00
UsePlatformInterfaceGetter() bool
2024-04-12 01:24:49 +00:00
Interfaces() ([]control.Interface, error)
UnderNetworkExtension() bool
2024-05-07 12:34:24 +00:00
IncludeAllNetworks() bool
ClearDNSCache()
ReadWIFIState() adapter.WIFIState
2022-10-25 04:55:00 +00:00
process.Searcher
}