github.com/sagernet/sing-box@v1.9.0-rc.20/experimental/libbox/platform/interface.go (about)

     1  package platform
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/sagernet/sing-box/adapter"
     7  	"github.com/sagernet/sing-box/common/process"
     8  	"github.com/sagernet/sing-box/option"
     9  	"github.com/sagernet/sing-tun"
    10  	"github.com/sagernet/sing/common/control"
    11  	"github.com/sagernet/sing/common/logger"
    12  )
    13  
    14  type Interface interface {
    15  	Initialize(ctx context.Context, router adapter.Router) error
    16  	UsePlatformAutoDetectInterfaceControl() bool
    17  	AutoDetectInterfaceControl() control.Func
    18  	OpenTun(options *tun.Options, platformOptions option.TunPlatformOptions) (tun.Tun, error)
    19  	UsePlatformDefaultInterfaceMonitor() bool
    20  	CreateDefaultInterfaceMonitor(logger logger.Logger) tun.DefaultInterfaceMonitor
    21  	UsePlatformInterfaceGetter() bool
    22  	Interfaces() ([]control.Interface, error)
    23  	UnderNetworkExtension() bool
    24  	IncludeAllNetworks() bool
    25  	ClearDNSCache()
    26  	ReadWIFIState() adapter.WIFIState
    27  	process.Searcher
    28  }