RNS::Link
Inherits RNS::Destination::DestinationInterface < RNS::LinkLike < Reference < Object
Encrypted bidirectional communication channel between two Reticulum destinations, established via ECDH key exchange over X25519 with Ed25519 signing.
Constants
Policies controlling whether incoming resource transfers are accepted. ─── Resource strategies ─────────────────────────────────────────
Curve type and key sizes for ECDH key exchange and signing. ─── Curve and key size constants ────────────────────────────────
Timeout, keepalive, and watchdog timing parameters for link lifecycle management. ─── Timing constants ────────────────────────────────────────────
Maximum Data Unit: largest plaintext payload that fits in an encrypted link packet. ─── MDU ─────────────────────────────────────────────────────────
Symmetric encryption modes negotiated during link establishment. ─── Encryption modes ────────────────────────────────────────────
Bitmasks for encoding MTU and encryption mode into signalling bytes. ─── Byte masks for MTU signalling ───────────────────────────────
Link lifecycle states: PENDING -> HANDSHAKE -> ACTIVE -> STALE -> CLOSED. ─── Link states ─────────────────────────────────────────────────
Reason codes recorded when a link is torn down. ─── Teardown reasons ────────────────────────────────────────────
Constructors
Creates a new link. When destination is provided, acts as initiator and sends a link request.
When owner and peer key bytes are provided instead, acts as responder during validate_request.
Class methods
Instance methods
Decrypts ciphertext using the link's derived symmetric key. Returns nil on failure.
Encrypts plaintext using the link's derived symmetric key via the Token cipher.
Generates an UInt64 hash value for this object.
This method must have the property that a == b implies a.hash == b.hash.
The hash value is used along with == by the Hash class to determine if two objects
reference the same hash key.
Subclasses must not override this method. Instead, they must define hash(hasher),
though usually the macro def_hash can be used to generate this method.
Reveals the initiator's identity to the responder by sending a signed identity proof.
Cleans up after link closure: purges keys, removes from destination, and fires the closed callback.
Loads the remote peer's X25519 and Ed25519 public keys from raw bytes.
Processes an incoming packet on this link, dispatching by context (data, identify, request, keepalive, etc.).
Sends a request to the remote destination on path and returns a RequestReceipt to track the response.
Called when an incoming request resource transfer concludes. Unpacks the request data and dispatches it to handle_request.
Called when an outgoing response resource transfer concludes.
Handles an RTT measurement packet on the responder side, activating the link.
Sends data over the link as an encrypted packet. Returns nil if the link is closed or if no interface could process the packet.
Test helper to set link_id directly (normally set via set_link_id from packet)
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>
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO) which can be overridden for custom implementations.
Also see #inspect.
Validates a signature against a message using the peer's Ed25519 public key.
Validates a link proof received by the initiator, completing the handshake and activating the link.