Added internal interface mode

This commit is contained in:
Mark Qvist
2026-06-19 19:27:52 +02:00
parent 51b7dc7cd4
commit 71f6f721fd
6 changed files with 50 additions and 9 deletions
+2 -1
View File
@@ -48,10 +48,11 @@ class Interface:
MODE_ROAMING = 0x04
MODE_BOUNDARY = 0x05
MODE_GATEWAY = 0x06
MODE_INTERNAL = 0x07
# Which interface modes a Transport Node should
# actively discover paths for.
DISCOVER_PATHS_FOR = [MODE_ACCESS_POINT, MODE_GATEWAY, MODE_ROAMING]
DISCOVER_PATHS_FOR = [MODE_ACCESS_POINT, MODE_GATEWAY, MODE_ROAMING, MODE_INTERNAL]
# How many samples to use for announce
# frequency calculations
+4
View File
@@ -710,6 +710,8 @@ class Reticulum:
interface_mode = Interface.Interface.MODE_BOUNDARY
elif c["mode"] == "gateway" or c["mode"] == "gw":
interface_mode = Interface.Interface.MODE_GATEWAY
elif c["mode"] == "internal":
interface_mode = Interface.Interface.MODE_INTERNAL
elif "mode" in c:
c["mode"] = str(c["mode"]).lower()
@@ -725,6 +727,8 @@ class Reticulum:
interface_mode = Interface.Interface.MODE_BOUNDARY
elif c["mode"] == "gateway" or c["mode"] == "gw":
interface_mode = Interface.Interface.MODE_GATEWAY
elif c["mode"] == "internal":
interface_mode = Interface.Interface.MODE_INTERNAL
ifac_size = None
if "ifac_size" in c:
+16
View File
@@ -1196,6 +1196,22 @@ class Transport:
RNS.log("Blocking announce broadcast on "+str(interface)+" due to AP mode", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
should_transmit = False
elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_INTERNAL:
from_interface = Transport.next_hop_interface(packet.destination_hash)
if from_interface == None or not hasattr(from_interface, "mode"):
should_transmit = False
if from_interface == None:
RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface doesn't exist", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
elif not hasattr(from_interface, "mode"):
RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
else:
if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING:
RNS.log("Blocking announce broadcast on "+str(interface)+" due to roaming-mode next-hop interface", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
should_transmit = False
elif from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY:
RNS.log("Blocking announce broadcast on "+str(interface)+" due to boundary-mode next-hop interface", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
should_transmit = False
elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING:
local_destination = None
with Transport.destinations_map_lock:
+1
View File
@@ -423,6 +423,7 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_ROAMING: modestr = "Roaming"
elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY: modestr = "Boundary"
elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_GATEWAY: modestr = "Gateway"
elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_INTERNAL: modestr = "Internal"
else: modestr = "Full"
+9
View File
@@ -1291,6 +1291,15 @@ the default mode.
public Transport Node available on the Internet, the interface
connecting over the Internet should be set to ``boundary`` mode.
* | The ``internal`` mode designates interfaces that belong to an
network different from any marked as ``boundary``. Announces from
a ``boundary`` interface will not propagate to interfaces set as
``internal``, but announces *will* propagate from ``internal`` *to*
``boundary``. Devices on the ``internal`` side of the network will
still be able to resolve paths to destinations across the boundary
when needed, since recursive path requests are enabled for ``internal``
mode interfaces by default.
For a table describing the impact of all modes on announce propagation,
please see the :ref:`Announce Propagation Rules<understanding-announcepropagation>` section.
+18 -8
View File
@@ -714,23 +714,33 @@ See the :ref:`Interface Modes<interfaces-modes>` section for a conceptual overvi
..
(.. code-block:: text)
Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼───> Full >───┼── ✕ ── AP
Boundary ── ✓ ──┤ ├── ✓ ── Boundary
AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✓ ──┼───> Full >───┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✓ ── Internal
Roaming ─── ✓ ──┘ └── ✓ ── Roaming
Full ────── ✕ ──┐ ┌── ✓ ── Full
AP ──────── ✕ ──┼────> AP >────┼── ✕ ── AP
Boundary ── ✕ ──┤ ├── ✓ ── Boundary
AP ──────── ✕ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┼────> AP >────┼── ✓ ── Boundary
Internal ── ✕ ──┤ ├── ✓ ── Internal
Roaming ─── ✕ ──┘ └── ✓ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼─> Roaming >──┼── ✕ ── AP
Boundary ── ✕ ──┤ ├── ✕ ── Boundary
AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┼─> Roaming >──┼── ✕ ── Boundary
Internal ── ✕ ──┤ ├── ✕ ── Internal
Roaming ─── ✕ ──┘ └── ✕ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼─> Boundary >─┼── ✕ ── AP
Boundary ── ✓ ──┤ ├── ✓ ── Boundary
AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✓ ──┼─> Boundary >─┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✕ ── Internal
Roaming ─── ✕ ──┘ └── ✕ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┼─> Internal >─┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✓ ── Internal
Roaming ─── ✕ ──┘ └── ✕ ── Roaming