mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-08-06 21:44:58 -04:00
Added better handling on Windows of interfaces that are non-adoptable for AutoInterface
This commit is contained in:
parent
4b07e30b9d
commit
444ae0206b
2 changed files with 87 additions and 63 deletions
12
RNS/vendor/ifaddr/niwrapper.py
vendored
12
RNS/vendor/ifaddr/niwrapper.py
vendored
|
@ -18,6 +18,18 @@ def interface_names_to_indexes() -> dict:
|
|||
results[adapter.name] = adapter.index
|
||||
return results
|
||||
|
||||
def interface_name_to_nice_name(ifname) -> str:
|
||||
try:
|
||||
adapters = RNS.vendor.ifaddr.get_adapters(include_unconfigured=True)
|
||||
for adapter in adapters:
|
||||
if adapter.name == ifname:
|
||||
if hasattr(adapter, "nice_name"):
|
||||
return adapter.nice_name
|
||||
except:
|
||||
return None
|
||||
|
||||
return None
|
||||
|
||||
def ifaddresses(ifname) -> dict:
|
||||
adapters = RNS.vendor.ifaddr.get_adapters(include_unconfigured=True)
|
||||
ifa = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue