Base interface class for the Reticulum Network Stack.
All concrete interfaces (UDP, TCP, Serial, etc.) inherit from this.
Constants
ANNOUNCE_CAP = 2
Announce cap and queued announce life (from Reticulum)
AUTOCONFIGURE_MTU = false
MTU configuration flags โ subclasses may override
DISCOVER_PATHS_FOR = [MODE_ACCESS_POINT, MODE_GATEWAY, MODE_ROAMING]
Which interface modes a Transport Node should actively discover paths for
IA_FREQ_SAMPLES = 6
How many samples to use for announce frequency calculations
IC_BURST_PENALTY = 5 * 60
IC_HELD_RELEASE_INTERVAL = 30
IC_NEW_TIME = (2 * 60) * 60
Spawned interface new time (2 hours)
MAX_HELD_ANNOUNCES = 256
Maximum amount of ingress limited announces to hold at any given time
MODE_FULL = 1_u8
Interface mode definitions
MODE_POINT_TO_POINT = 2_u8
QUEUED_ANNOUNCE_LIFE = (60 * 60) * 24
Instance methods
age
Age of the interface in seconds
Sourceannounce_queue
Announce queue and rate limiting
Sourceannounce_queue=(announce_queue :
Array(
AnnounceQueueEntry))
Announce queue and rate limiting
Sourceannounce_rate_grace=(announce_rate_grace :
Int32 |
Nil)
Sourceannounce_rate_penalty=(announce_rate_penalty :
Int32 |
Nil)
Sourceannounce_rate_target
Announce rate limiting (set by Reticulum config)
Sourceannounce_rate_target=(announce_rate_target :
Int32 |
Nil)
Announce rate limiting (set by Reticulum config)
Sourceautoconnect_hash
Autoconnect properties (set by InterfaceDiscovery)
Sourceautoconnect_hash=(autoconnect_hash :
Bytes |
Nil)
Autoconnect properties (set by InterfaceDiscovery)
Sourceautoconnect_source=(autoconnect_source :
String |
Nil)
Sourcedetach
Called when the interface is being detached/removed
Sourcediscovery_announce_interval
Sourcediscovery_announce_interval=(discovery_announce_interval :
Int32 |
Nil)
Sourcediscovery_bandwidth=(discovery_bandwidth :
Int32 |
Nil)
Sourcediscovery_channel=(discovery_channel :
Int32 |
Nil)
Sourcediscovery_encrypt=(discovery_encrypt :
Bool)
Sourcediscovery_frequency=(discovery_frequency :
Int32 |
Nil)
Sourcediscovery_modulation=(discovery_modulation :
Int32 |
Nil)
Sourcediscovery_publish_ifac=(discovery_publish_ifac :
Bool)
Sourcediscovery_stamp_value=(discovery_stamp_value :
Int32 |
Nil)
Sourcefinal_init
Called after interface configuration is complete
Sourceget_hash
Compute a hash of this interface based on its string representation
Sourceheld_announces
Held announces: destination_hash => raw packet bytes
Sourceheld_announces=(held_announces :
Hash(
String,
HeldAnnounce))
Held announces: destination_hash => raw packet bytes
Sourcehold_announce(announce : HeldAnnounce)
Hold an announce packet for later release
Sourceia_freq_deque
Access the ia/oa frequency deques for testing
Sourceic_held_release_interval
Sourceic_held_release_interval=(ic_held_release_interval :
Int32)
Sourceic_max_held_announces=(ic_max_held_announces :
Int32)
Sourceifac_identity=(ifac_identity : Identity | Nil)
Sourceifac_size
IFAC (Interface Authentication Code) properties
Sourceifac_size=(ifac_size :
Int32)
IFAC (Interface Authentication Code) properties
Sourceinbound_callback
Inbound callback โ invoked by process_incoming to deliver data to Transport.
Sourceinbound_callback=(inbound_callback :
Proc(
Bytes,
Interface,
Nil) |
Nil)
Inbound callback โ invoked by process_incoming to deliver data to Transport.
Sourceincoming_announce_frequency
Calculate the incoming announce frequency (announces/second)
Sourceingress_control
Ingress control properties
Sourceingress_control=(ingress_control :
Bool)
Ingress control properties
Sourcelast_discovery_announce=(last_discovery_announce :
Float64)
Sourcemanagement_protected=(management_protected :
Bool)
Sourceoptimise_mtu
Auto-configure HW_MTU based on bitrate
Sourceoutgoing_announce_frequency
Calculate the outgoing announce frequency (announces/second)
Sourceparent_interface
Parent/spawned interface references
Sourceparent_interface=(parent_interface : Interface | Nil)
Parent/spawned interface references
Sourceprocess_announce_queue
Process the announce queue: send oldest lowest-hop announce, respecting rate cap
Sourceprocess_held_announces
Process and release held announces when rate allows
Sourceprocess_outgoing(data :
Bytes)
Send data out through the interface. Subclasses must implement this.
Sourcereceived_announce(from_spawned = false)
Record an incoming announce timestamp
Sourcerecompute_ifac_identity
Recompute IFAC signing identity from current ifac_netname/ifac_netkey.
Mirrors the IFAC computation in ReticulumInstance#interface_post_init.
Sourcesent_announce(from_spawned = false)
Record an outgoing announce timestamp
Sourceshould_ingress_limit?
Determine when an interface should activate ingress limiting.
Subclasses may override for different behavior.
Sourcespawned_interfaces=(spawned_interfaces :
Array(
Interface) |
Nil)
Sourcesupports_discovery=(supports_discovery :
Bool)
Sourceteardown
Tear down the interface, releasing any resources (sockets, fibers, etc.).
Subclasses should override to close their specific resources.
SourceAppends a short String representation of this object
which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source