sing-box/adapter/network.go

43 lines
921 B
Go
Raw Normal View History

2024-11-10 12:11:21 +08:00
package adapter
import (
"github.com/sagernet/sing-tun"
"github.com/sagernet/sing/common/control"
)
type NetworkManager interface {
Lifecycle
2024-11-10 12:11:21 +08:00
InterfaceFinder() control.InterfaceFinder
UpdateInterfaces() error
2024-11-11 16:23:45 +08:00
DefaultNetworkInterface() *NetworkInterface
NetworkInterfaces() []NetworkInterface
2024-11-10 12:11:21 +08:00
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()
}
2024-11-11 16:23:45 +08:00
type InterfaceUpdateListener interface {
InterfaceUpdated()
}
type WIFIState struct {
SSID string
BSSID string
}
type NetworkInterface struct {
control.Interface
Type string
DNSServers []string
Expensive bool
Constrained bool
}