diff --git a/RNS/Interfaces/AutoInterface.py b/RNS/Interfaces/AutoInterface.py index 6e146a0..993fbb8 100644 --- a/RNS/Interfaces/AutoInterface.py +++ b/RNS/Interfaces/AutoInterface.py @@ -82,7 +82,6 @@ class AutoInterface(Interface): return ifas def interface_name_to_index(self, ifname): - # socket.if_nametoindex doesn't work with uuid interface names on windows, it wants the ethernet_0 style # we will just get the index from netinfo instead as it seems to work if RNS.vendor.platformutils.is_windows(): @@ -102,7 +101,7 @@ class AutoInterface(Interface): ignored_interfaces = c.as_list("ignored_devices") if "ignored_devices" in c else None configured_bitrate = c["configured_bitrate"] if "configured_bitrate" in c else None - from RNS.vendor import netinfo + from RNS.Interfaces import netinfo super().__init__() self.netinfo = netinfo diff --git a/RNS/Interfaces/BackboneInterface.py b/RNS/Interfaces/BackboneInterface.py index 133ee33..8ecef12 100644 --- a/RNS/Interfaces/BackboneInterface.py +++ b/RNS/Interfaces/BackboneInterface.py @@ -55,7 +55,7 @@ class BackboneInterface(Interface): @staticmethod def get_address_for_if(name, bind_port, prefer_ipv6=False): - from RNS.vendor import netinfo + from RNS.Interfaces import netinfo ifaddr = netinfo.ifaddresses(name) if len(ifaddr) < 1: raise SystemError(f"No addresses available on specified kernel interface \"{name}\" for BackboneInterface to bind to") diff --git a/RNS/Interfaces/TCPInterface.py b/RNS/Interfaces/TCPInterface.py index 1fe9df7..2745c32 100644 --- a/RNS/Interfaces/TCPInterface.py +++ b/RNS/Interfaces/TCPInterface.py @@ -445,7 +445,7 @@ class TCPServerInterface(Interface): @staticmethod def get_address_for_if(name, bind_port, prefer_ipv6=False): - from RNS.vendor import netinfo + from RNS.Interfaces import netinfo ifaddr = netinfo.ifaddresses(name) if len(ifaddr) < 1: raise SystemError(f"No addresses available on specified kernel interface \"{name}\" for TCPServerInterface to bind to") diff --git a/RNS/Interfaces/UDPInterface.py b/RNS/Interfaces/UDPInterface.py index 4b78f07..db1bcad 100644 --- a/RNS/Interfaces/UDPInterface.py +++ b/RNS/Interfaces/UDPInterface.py @@ -35,13 +35,13 @@ class UDPInterface(Interface): @staticmethod def get_address_for_if(name): - from RNS.vendor import netinfo + from RNS.Interfaces import netinfo ifaddr = netinfo.ifaddresses(name) return ifaddr[netinfo.AF_INET][0]["addr"] @staticmethod def get_broadcast_for_if(name): - from RNS.vendor import netinfo + from RNS.Interfaces import netinfo ifaddr = netinfo.ifaddresses(name) return ifaddr[netinfo.AF_INET][0]["broadcast"] diff --git a/RNS/Interfaces/__init__.py b/RNS/Interfaces/__init__.py index 2e8f31d..f189954 100755 --- a/RNS/Interfaces/__init__.py +++ b/RNS/Interfaces/__init__.py @@ -23,6 +23,7 @@ import os import glob import RNS.Interfaces.Android +import RNS.Interfaces.util.netinfo as netinfo py_modules = glob.glob(os.path.dirname(__file__)+"/*.py") pyc_modules = glob.glob(os.path.dirname(__file__)+"/*.pyc") diff --git a/RNS/vendor/netinfo.py b/RNS/Interfaces/util/netinfo.py similarity index 100% rename from RNS/vendor/netinfo.py rename to RNS/Interfaces/util/netinfo.py