Added announces_to_internal interface option

This commit is contained in:
Mark Qvist
2026-07-22 19:01:34 +02:00
parent b051e76d00
commit 1af173e8a5
4 changed files with 14 additions and 2 deletions
+1
View File
@@ -111,6 +111,7 @@ class Interface:
self.bootstrap_only = False
self.recursive_prs = False
self.announces_from_internal = True
self.announces_to_internal = None
self.parent_interface = None
self.spawned_interfaces = None
self.tunnel_id = None
+6 -1
View File
@@ -811,6 +811,9 @@ class Reticulum:
announces_from_internal = True
if "announces_from_internal" in c: announces_from_internal = c.as_bool("announces_from_internal")
announces_to_internal = None
if "announces_to_internal" in c: announces_to_internal = c.as_bool("announces_to_internal")
ignore_config_warnings = False
if "ignore_config_warnings" in c: ignore_config_warnings = c.as_bool("ignore_config_warnings")
@@ -896,6 +899,7 @@ class Reticulum:
interface.recursive_prs = recursive_prs
interface.announces_from_internal = announces_from_internal
interface.announces_to_internal = announces_to_internal
interface.announce_rate_target = announce_rate_target
interface.announce_rate_grace = announce_rate_grace
interface.announce_rate_penalty = announce_rate_penalty
@@ -1052,7 +1056,7 @@ class Reticulum:
def _add_interface(self, interface, mode = None, configured_bitrate=None, ifac_size=None, ifac_netname=None, ifac_netkey=None,
announce_cap=None, announce_rate_target=None, announce_rate_grace=None, announce_rate_penalty=None,
bootstrap_only=False, recursive_prs=False, announces_from_internal=True):
bootstrap_only=False, recursive_prs=False, announces_from_internal=True, announces_to_internal=None):
if not self.is_connected_to_shared_instance:
if interface != None and issubclass(type(interface), RNS.Interfaces.Interface.Interface):
@@ -1070,6 +1074,7 @@ class Reticulum:
interface.recursive_prs = recursive_prs
interface.announces_from_internal = announces_from_internal
interface.announces_to_internal = announces_to_internal
interface.announce_cap = announce_cap if announce_cap != None else Reticulum.ANNOUNCE_CAP/100.0
interface.announce_rate_target = announce_rate_target
interface.announce_rate_grace = announce_rate_grace
+2 -1
View File
@@ -1233,7 +1233,8 @@ class Transport:
should_transmit = False
RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", ac_loglevel) if RNS.sl(ac_loglevel) else None
else:
if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY:
if from_interface.announces_to_internal == True: pass
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", ac_loglevel) if RNS.sl(ac_loglevel) else None
should_transmit = False
+5
View File
@@ -1274,6 +1274,11 @@ These can be used to control various aspects of interface behaviour.
``internal`` mode interfaces may still be resolvable by means
of path requests.
* | To allow an interface that would *otherwise not* propagate
announces to ``internal`` mode interfaces to do so, you can
configure the ``announces_to_internal`` option to ``True``.
.. _interfaces-modes:
Interface Modes