interface.go 998 B

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