refactor: Modular network manager

This commit is contained in:
世界
2024-11-10 12:11:21 +08:00
parent 2a786daabe
commit 2622bdaa8b
35 changed files with 615 additions and 606 deletions

View File

@@ -1,8 +1,6 @@
package platform
import (
"context"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/process"
"github.com/sagernet/sing-box/option"
@@ -12,7 +10,7 @@ import (
)
type Interface interface {
Initialize(ctx context.Context, router adapter.Router) error
Initialize(networkManager adapter.NetworkManager) error
UsePlatformAutoDetectInterfaceControl() bool
AutoDetectInterfaceControl(fd int) error
OpenTun(options *tun.Options, platformOptions option.TunPlatformOptions) (tun.Tun, error)