Use API to create windows firewall rule

This commit is contained in:
世界 committed 2023-06-07 21:01:29 +08:00
1 parent f8d5f01665
commit 01dfba722a
6 files changed
+18 -4

No files matched your search

+1
View File
@@ -18,6 +18,7 @@ type PlatformInterface interface {
CloseDefaultInterfaceMonitor(listener InterfaceUpdateListener) error
UsePlatformInterfaceGetter() bool
GetInterfaces() (NetworkInterfaceIterator, error)
UnderNetworkExtension() bool
}
type TunInterface interface {
@@ -22,6 +22,7 @@ type Interface interface {
CreateDefaultInterfaceMonitor(errorHandler E.Handler) tun.DefaultInterfaceMonitor
UsePlatformInterfaceGetter() bool
Interfaces() ([]NetworkInterface, error)
UnderNetworkExtension() bool
process.Searcher
io.Writer
}
+4
View File
@@ -169,3 +169,7 @@ func (w *platformInterfaceWrapper) Interfaces() ([]platform.NetworkInterface, er
}
return interfaces, nil
}
func (w *platformInterfaceWrapper) UnderNetworkExtension() bool {
return w.iif.UnderNetworkExtension()
}