mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-05-30 04:01:32 -04:00
Cleanup
This commit is contained in:
parent
c07e968218
commit
c83043b087
6 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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"]
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue