mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-29 20:11:28 +00:00
43 lines
921 B
Go
43 lines
921 B
Go
package adapter
|
|
|
|
import (
|
|
"github.com/sagernet/sing-tun"
|
|
"github.com/sagernet/sing/common/control"
|
|
)
|
|
|
|
type NetworkManager interface {
|
|
Lifecycle
|
|
InterfaceFinder() control.InterfaceFinder
|
|
UpdateInterfaces() error
|
|
DefaultNetworkInterface() *NetworkInterface
|
|
NetworkInterfaces() []NetworkInterface
|
|
DefaultInterface() string
|
|
AutoDetectInterface() bool
|
|
AutoDetectInterfaceFunc() control.Func
|
|
DefaultMark() uint32
|
|
RegisterAutoRedirectOutputMark(mark uint32) error
|
|
AutoRedirectOutputMark() uint32
|
|
NetworkMonitor() tun.NetworkUpdateMonitor
|
|
InterfaceMonitor() tun.DefaultInterfaceMonitor
|
|
PackageManager() tun.PackageManager
|
|
WIFIState() WIFIState
|
|
ResetNetwork()
|
|
}
|
|
|
|
type InterfaceUpdateListener interface {
|
|
InterfaceUpdated()
|
|
}
|
|
|
|
type WIFIState struct {
|
|
SSID string
|
|
BSSID string
|
|
}
|
|
|
|
type NetworkInterface struct {
|
|
control.Interface
|
|
Type string
|
|
DNSServers []string
|
|
Expensive bool
|
|
Constrained bool
|
|
}
|