Added Access Point interface mode

This commit is contained in:
Mark Qvist
2022-02-25 18:47:55 +01:00
parent 8ec356a28e
commit 0e1279d012
5 changed files with 49 additions and 4 deletions

View File

@@ -280,6 +280,16 @@ class Reticulum:
if not name in interface_names:
c = self.config["interfaces"][name]
interface_mode = Interface.Interface.MODE_FULL
if "mode" in c:
if c["mode"] == "full":
interface_mode = Interface.Interface.MODE_FULL
elif c["mode"] == "accesspoint" or c["mode"] == "ap":
interface_mode = Interface.Interface.MODE_ACCESS_POINT
elif c["mode"] == "pointtopoint" or c["mode"] == "ptp":
interface_mode = Interface.Interface.MODE_POINT_TO_POINT
try:
if ("interface_enabled" in c) and c.as_bool("interface_enabled") == True:
if c["type"] == "AutoInterface":
@@ -307,6 +317,8 @@ class Reticulum:
else:
interface.OUT = True
interface.mode = interface_mode
RNS.Transport.interfaces.append(interface)
else:
RNS.log("AutoInterface is not currently supported on Windows, disabling interface.", RNS.LOG_ERROR);
@@ -343,6 +355,8 @@ class Reticulum:
else:
interface.OUT = True
interface.mode = interface_mode
RNS.Transport.interfaces.append(interface)
@@ -370,6 +384,8 @@ class Reticulum:
else:
interface.OUT = True
interface.mode = interface_mode
RNS.Transport.interfaces.append(interface)
@@ -394,6 +410,8 @@ class Reticulum:
else:
interface.OUT = True
interface.mode = interface_mode
RNS.Transport.interfaces.append(interface)
@@ -414,6 +432,8 @@ class Reticulum:
else:
interface.OUT = True
interface.mode = interface_mode
RNS.Transport.interfaces.append(interface)
@@ -442,6 +462,8 @@ class Reticulum:
else:
interface.OUT = True
interface.mode = interface_mode
RNS.Transport.interfaces.append(interface)
if c["type"] == "KISSInterface":
@@ -483,6 +505,8 @@ class Reticulum:
else:
interface.OUT = True
interface.mode = interface_mode
RNS.Transport.interfaces.append(interface)
if c["type"] == "AX25KISSInterface":
@@ -525,6 +549,8 @@ class Reticulum:
else:
interface.OUT = True
interface.mode = interface_mode
RNS.Transport.interfaces.append(interface)
if c["type"] == "RNodeInterface":
@@ -561,6 +587,8 @@ class Reticulum:
else:
interface.OUT = True
interface.mode = interface_mode
RNS.Transport.interfaces.append(interface)
else:
RNS.log("Skipping disabled interface \""+name+"\"", RNS.LOG_DEBUG)