Add multi network dialing

This commit is contained in:
世界
2024-11-12 19:37:10 +08:00
parent 05bda2ef0b
commit da4e199bd5
24 changed files with 988 additions and 335 deletions

View File

@@ -1,6 +1,9 @@
package adapter
import (
"time"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-tun"
"github.com/sagernet/sing/common/control"
)
@@ -11,10 +14,10 @@ type NetworkManager interface {
UpdateInterfaces() error
DefaultNetworkInterface() *NetworkInterface
NetworkInterfaces() []NetworkInterface
DefaultInterface() string
AutoDetectInterface() bool
AutoDetectInterfaceFunc() control.Func
DefaultMark() uint32
ProtectFunc() control.Func
DefaultOptions() NetworkOptions
RegisterAutoRedirectOutputMark(mark uint32) error
AutoRedirectOutputMark() uint32
NetworkMonitor() tun.NetworkUpdateMonitor
@@ -24,6 +27,13 @@ type NetworkManager interface {
ResetNetwork()
}
type NetworkOptions struct {
DefaultNetworkStrategy C.NetworkStrategy
DefaultFallbackDelay time.Duration
DefaultInterface string
DefaultMark uint32
}
type InterfaceUpdateListener interface {
InterfaceUpdated()
}