class

RNS::Interface

Inherits Reference < Object

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

FIXED_MTU = false
FWD = false
IA_FREQ_SAMPLES = 6

How many samples to use for announce frequency calculations

IC_BURST_FREQ = 12.0
IC_BURST_FREQ_NEW = 3.5
IC_BURST_HOLD = 1 * 60
IC_BURST_PENALTY = 5 * 60
IC_HELD_RELEASE_INTERVAL = 30
IC_NEW_TIME = (2 * 60) * 60

Spawned interface new time (2 hours)

IN = false

Direction flags

MAX_HELD_ANNOUNCES = 256

Maximum amount of ingress limited announces to hold at any given time

MODE_ACCESS_POINT = 3_u8
MODE_BOUNDARY = 5_u8
MODE_FULL = 1_u8

Interface mode definitions

MODE_GATEWAY = 6_u8
MODE_POINT_TO_POINT = 2_u8
MODE_ROAMING = 4_u8
OA_FREQ_SAMPLES = 6
OUT = false
QUEUED_ANNOUNCE_LIFE = (60 * 60) * 24
RPT = false

Constructors

Class methods

autoconfigure_mtu?

Override in subclasses that have auto-configurable MTU

Source

Instance methods

age

Age of the interface in seconds

Source
announce_allowed_at
Source
announce_allowed_at=(announce_allowed_at : Float64)
Source
announce_cap
Source
announce_cap=(announce_cap : Float64)
Source
announce_queue

Announce queue and rate limiting

Source
announce_queue=(announce_queue : Array(AnnounceQueueEntry))

Announce queue and rate limiting

Source
announce_rate_grace
Source
announce_rate_grace=(announce_rate_grace : Int32 | Nil)
Source
announce_rate_penalty
Source
announce_rate_penalty=(announce_rate_penalty : Int32 | Nil)
Source
announce_rate_target

Announce rate limiting (set by Reticulum config)

Source
announce_rate_target=(announce_rate_target : Int32 | Nil)

Announce rate limiting (set by Reticulum config)

Source
autoconnect_down
Source
autoconnect_down=(autoconnect_down : Float64 | Nil)
Source
autoconnect_hash

Autoconnect properties (set by InterfaceDiscovery)

Source
autoconnect_hash=(autoconnect_hash : Bytes | Nil)

Autoconnect properties (set by InterfaceDiscovery)

Source
autoconnect_source
Source
autoconnect_source=(autoconnect_source : String | Nil)
Source
bitrate
Source
bitrate=(bitrate : Int64)
Source
bootstrap_only
Source
bootstrap_only=(bootstrap_only : Bool)
Source
created

Interface creation time

Source
detach

Called when the interface is being detached/removed

Source
detached?

Detach state

Source
discoverable
Source
discoverable=(discoverable : Bool)
Source
discovery_announce_interval
Source
discovery_announce_interval=(discovery_announce_interval : Int32 | Nil)
Source
discovery_bandwidth
Source
discovery_bandwidth=(discovery_bandwidth : Int32 | Nil)
Source
discovery_channel
Source
discovery_channel=(discovery_channel : Int32 | Nil)
Source
discovery_encrypt
Source
discovery_encrypt=(discovery_encrypt : Bool)
Source
discovery_frequency
Source
discovery_frequency=(discovery_frequency : Int32 | Nil)
Source
discovery_height
Source
discovery_height=(discovery_height : Float64 | Nil)
Source
discovery_latitude
Source
discovery_latitude=(discovery_latitude : Float64 | Nil)
Source
discovery_longitude
Source
discovery_longitude=(discovery_longitude : Float64 | Nil)
Source
discovery_modulation
Source
discovery_modulation=(discovery_modulation : Int32 | Nil)
Source
discovery_name
Source
discovery_name=(discovery_name : String | Nil)
Source
discovery_publish_ifac
Source
discovery_publish_ifac=(discovery_publish_ifac : Bool)
Source
discovery_stamp_value
Source
discovery_stamp_value=(discovery_stamp_value : Int32 | Nil)
Source
final_init

Called after interface configuration is complete

Source
get_hash

Compute a hash of this interface based on its string representation

Source
held_announces

Held announces: destination_hash => raw packet bytes

Source
held_announces=(held_announces : Hash(String, HeldAnnounce))

Held announces: destination_hash => raw packet bytes

Source
hold_announce(announce : HeldAnnounce)

Hold an announce packet for later release

Source
hw_mtu
Source
hw_mtu=(hw_mtu : Int32 | Nil)
Source
ia_freq_deque

Access the ia/oa frequency deques for testing

Source
ic_burst_activated
Source
ic_burst_activated=(ic_burst_activated : Float64)
Source
ic_burst_active
Source
ic_burst_active=(ic_burst_active : Bool)
Source
ic_burst_freq
Source
ic_burst_freq=(ic_burst_freq : Float64)
Source
ic_burst_freq_new
Source
ic_burst_freq_new=(ic_burst_freq_new : Float64)
Source
ic_burst_hold
Source
ic_burst_hold=(ic_burst_hold : Int32)
Source
ic_burst_penalty
Source
ic_burst_penalty=(ic_burst_penalty : Int32)
Source
ic_held_release
Source
ic_held_release=(ic_held_release : Float64)
Source
ic_held_release_interval
Source
ic_held_release_interval=(ic_held_release_interval : Int32)
Source
ic_max_held_announces
Source
ic_max_held_announces=(ic_max_held_announces : Int32)
Source
ic_new_time
Source
ic_new_time=(ic_new_time : Int32)
Source
ifac_identity
Source
ifac_identity=(ifac_identity : Identity | Nil)
Source
ifac_key
Source
ifac_key=(ifac_key : Bytes | Nil)
Source
ifac_netkey
Source
ifac_netkey=(ifac_netkey : String | Nil)
Source
ifac_netname
Source
ifac_netname=(ifac_netname : String | Nil)
Source
ifac_signature
Source
ifac_signature=(ifac_signature : Bytes | Nil)
Source
ifac_size

IFAC (Interface Authentication Code) properties

Source
ifac_size=(ifac_size : Int32)

IFAC (Interface Authentication Code) properties

Source
inbound_callback

Inbound callback โ€” invoked by process_incoming to deliver data to Transport.

Source
inbound_callback=(inbound_callback : Proc(Bytes, Interface, Nil) | Nil)

Inbound callback โ€” invoked by process_incoming to deliver data to Transport.

Source
incoming_announce_frequency

Calculate the incoming announce frequency (announces/second)

Source
ingress_control

Ingress control properties

Source
ingress_control=(ingress_control : Bool)

Ingress control properties

Source
last_discovery_announce
Source
last_discovery_announce=(last_discovery_announce : Float64)
Source
last_state_change
Source
last_state_change=(last_state_change : Float64)
Source
management_protected

Management properties

Source
management_protected=(management_protected : Bool)

Management properties

Source
mode
Source
mode=(mode : UInt8)
Source
mtu=(mtu : Int32)
Source
name

Properties

Source
name=(name : String)

Properties

Source
oa_freq_deque
Source
online
Source
online=(online : Bool)
Source
optimise_mtu

Auto-configure HW_MTU based on bitrate

Source
outgoing_announce_frequency

Calculate the outgoing announce frequency (announces/second)

Source
parent_interface

Parent/spawned interface references

Source
parent_interface=(parent_interface : Interface | Nil)

Parent/spawned interface references

Source
process_announce_queue

Process the announce queue: send oldest lowest-hop announce, respecting rate cap

Source
process_held_announces

Process and release held announces when rate allows

Source
process_outgoing(data : Bytes)

Send data out through the interface. Subclasses must implement this.

Source
reachable_on
Source
reachable_on=(reachable_on : String | Nil)
Source
received_announce(from_spawned = false)

Record an incoming announce timestamp

Source
recompute_ifac_identity

Recompute IFAC signing identity from current ifac_netname/ifac_netkey. Mirrors the IFAC computation in ReticulumInstance#interface_post_init.

Source
rxb=(rxb : Int64)
Source
sent_announce(from_spawned = false)

Record an outgoing announce timestamp

Source
should_ingress_limit?

Determine when an interface should activate ingress limiting. Subclasses may override for different behavior.

Source
spawned_interfaces
Source
spawned_interfaces=(spawned_interfaces : Array(Interface) | Nil)
Source
supports_discovery

Discovery properties

Source
supports_discovery=(supports_discovery : Bool)

Discovery properties

Source
teardown

Tear down the interface, releasing any resources (sockets, fibers, etc.). Subclasses should override to close their specific resources.

Source
to_s(io : IO)

Appends 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
tunnel_id
Source
tunnel_id=(tunnel_id : Bytes | Nil)
Source
txb=(txb : Int64)
Source

Nested types