interface.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package platform
  2. import (
  3. "github.com/sagernet/sing-box/adapter"
  4. "github.com/sagernet/sing-box/common/process"
  5. "github.com/sagernet/sing-box/option"
  6. "github.com/sagernet/sing-tun"
  7. "github.com/sagernet/sing/common/logger"
  8. )
  9. type Interface interface {
  10. Initialize(networkManager adapter.NetworkManager) error
  11. UsePlatformAutoDetectInterfaceControl() bool
  12. AutoDetectInterfaceControl(fd int) error
  13. OpenTun(options *tun.Options, platformOptions option.TunPlatformOptions) (tun.Tun, error)
  14. CreateDefaultInterfaceMonitor(logger logger.Logger) tun.DefaultInterfaceMonitor
  15. Interfaces() ([]adapter.NetworkInterface, error)
  16. UnderNetworkExtension() bool
  17. IncludeAllNetworks() bool
  18. ClearDNSCache()
  19. UsePlatformWIFIMonitor() bool
  20. ReadWIFIState() adapter.WIFIState
  21. SystemCertificates() []string
  22. process.Searcher
  23. SendNotification(notification *Notification) error
  24. }
  25. type Notification struct {
  26. Identifier string
  27. TypeName string
  28. TypeID int32
  29. Title string
  30. Subtitle string
  31. Body string
  32. OpenURL string
  33. }