cmd/cli: extend list of valid interfaces for MacOS

By parsing "networksetup -listallhardwareports" output to get list of
available hardware ports.
This commit is contained in:
Cuong Manh Le
2024-08-01 15:57:45 +07:00
committed by Cuong Manh Le
parent 82e0d4b0c4
commit 5f4a399850
5 changed files with 81 additions and 21 deletions
+3 -1
View File
@@ -10,7 +10,7 @@ func patchNetIfaceName(iface *net.Interface) error {
// validInterface reports whether the *net.Interface is a valid one.
// On Windows, only physical interfaces are considered valid.
func validInterface(iface *net.Interface) bool {
func validInterface(iface *net.Interface, validIfacesMap map[string]struct{}) bool {
if iface == nil {
return false
}
@@ -19,3 +19,5 @@ func validInterface(iface *net.Interface) bool {
}
return false
}
func validInterfacesMap() map[string]struct{} { return nil }