lib/reticulum/src/node/access.zig
daab053ee43316e1809a84551d573ddd1e5bf3d2
1 const ifac = @import("../interface/root.zig").ifac;
2
3 /// The shared key and code length that authenticate every frame on one carrier, for a caller that
4 /// runs a closed network and hands one of these to `registerCarrier`. The node appends the code to
5 /// each frame it sends on that carrier and checks and strips it from each frame it receives. The
6 /// key is 64 bytes and the code runs from 1 to 64 bytes.
7 pub const Access = struct {
8 key: ifac.Key,
9 size: ifac.Size,
10 };
11
12 /// What the node remembers about one carrier, so a caller reads one of these to see what the node
13 /// believes about a carrier it registered: that it is registered, whether the node may send on it,
14 /// whether it searches for paths it lacks, and its access code, if it has one. The node holds one
15 /// of these for every carrier index its limits allow, in storage the caller supplied. A carrier
16 /// with no access code carries its frames as they are.
17 pub const Registration = struct {
18 registered: u1 = 0,
19 outgoing: u1 = 0,
20 /// Whether the node asks this carrier for a path it lacks, which Reticulum@1.5.0
21 /// RNS/Interfaces/Interface.py:55,121 leaves off, so a caller turns this on for the carrier it
22 /// wants the node to search when it has no path to a destination. Registering the carrier again
23 /// returns the setting to off.
24 discover_paths: u1 = 0,
25 access: ?Access = null,
26 };