interface.go 967 B

12345678910111213141516171819202122232425262728293031323334
  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. ReadWIFIState() adapter.WIFIState
  20. process.Searcher
  21. SendNotification(notification *Notification) error
  22. }
  23. type Notification struct {
  24. Identifier string
  25. TypeName string
  26. TypeID int32
  27. Title string
  28. Subtitle string
  29. Body string
  30. OpenURL string
  31. }