sing-box/route/iface.go

23 lines
519 B
Go
Raw Normal View History

2022-07-17 11:16:13 +08:00
package route
import "github.com/sagernet/sing/common/x/list"
type (
NetworkUpdateCallback = func() error
DefaultInterfaceUpdateCallback = func()
)
type NetworkUpdateMonitor interface {
Start() error
Close() error
RegisterCallback(callback NetworkUpdateCallback) *list.Element[NetworkUpdateCallback]
UnregisterCallback(element *list.Element[NetworkUpdateCallback])
}
type DefaultInterfaceMonitor interface {
Start() error
Close() error
DefaultInterfaceName() string
DefaultInterfaceIndex() int
}