2022-10-25 04:55:00 +00:00
|
|
|
package platform
|
|
|
|
|
|
|
|
import (
|
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"
|
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 {
|
2024-11-10 04:11:21 +00:00
|
|
|
Initialize(networkManager adapter.NetworkManager) error
|
2023-04-21 09:04:55 +00:00
|
|
|
UsePlatformAutoDetectInterfaceControl() bool
|
2024-11-06 04:51:53 +00:00
|
|
|
AutoDetectInterfaceControl(fd int) error
|
2023-04-17 11:05:02 +00:00
|
|
|
OpenTun(options *tun.Options, platformOptions option.TunPlatformOptions) (tun.Tun, error)
|
2023-07-23 06:42:19 +00:00
|
|
|
CreateDefaultInterfaceMonitor(logger logger.Logger) tun.DefaultInterfaceMonitor
|
2024-11-11 08:23:45 +00:00
|
|
|
Interfaces() ([]adapter.NetworkInterface, error)
|
2023-06-07 13:01:29 +00:00
|
|
|
UnderNetworkExtension() bool
|
2024-05-07 12:34:24 +00:00
|
|
|
IncludeAllNetworks() bool
|
2023-08-24 13:52:38 +00:00
|
|
|
ClearDNSCache()
|
2023-11-24 12:58:07 +00:00
|
|
|
ReadWIFIState() adapter.WIFIState
|
2022-10-25 04:55:00 +00:00
|
|
|
process.Searcher
|
2024-11-06 04:51:53 +00:00
|
|
|
SendNotification(notification *Notification) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type Notification struct {
|
|
|
|
Identifier string
|
|
|
|
TypeName string
|
|
|
|
TypeID int32
|
|
|
|
Title string
|
|
|
|
Subtitle string
|
|
|
|
Body string
|
|
|
|
OpenURL string
|
2022-10-25 04:55:00 +00:00
|
|
|
}
|