RNS::Packet
The fundamental data unit in Reticulum. Handles serialization to/from wire format, encryption via destination identities, header construction, hash-based addressing, and proof generation for reliable delivery.
Constants
─── Packet types ───────────────────────────────────────────────
With an MTU of 500, the maximum of data we can send in a single encrypted packet is 383 bytes.
─── Context flag values ───────────────────────────────────────
─── Header types ──────────────────────────────────────────────
─── Size constants ────────────────────────────────────────────
─── Context types ─────────────────────────────────────────────
Constructors
Creates a new packet. When destination is provided, builds a packet for
sending with the given data payload, packet_type, and routing parameters.
When destination is nil, treats data as raw wire bytes for unpacking.
Instance methods
Returns the truncated hash of this packet, used for addressing and proof routing within the network.
NOTE: property link : Link? — not added due to Packet/Link circular dependency
Serializes the packet into wire format by constructing the header,
encrypting the payload when required, and concatenating into @raw.
Re-sends a previously sent packet. Re-packs to obtain new ciphertext for encrypted destinations.
Sends the packet via Transport, packing it first if needed. Returns the PacketReceipt on success, or nil if no interface could process the packet.
Deserializes a raw byte packet from @raw, extracting flags, header
fields, destination hash, and payload data. Returns true on success,
false if the packet is malformed.