Skip to main content

Crate tailfeather

Crate tailfeather 

Source
Expand description

Allocation-free protocol components and a cooperative mesh Node.

The protocol modules are public so applications can use the individual codecs, while Node is the preferred integration boundary. Node owns protocol state but no sockets, executor, clock, random source, or storage.

use tailfeather::{Node, keys::{Identity, Rng}};

struct Fixed;
impl Rng for Fixed {
    fn fill_bytes(&mut self, out: &mut [u8]) { out.fill(7); }
}

let identity = Identity::generate(&mut Fixed);
let node = Node::<4>::factory_reset(identity, 1);
assert!(node.requires_persistence());

Re-exports§

pub use node::ControlCommand;
pub use node::ControlEvent;
pub use node::ControlSession;
pub use node::DerpCommand;
pub use node::DerpEvent;
pub use node::DerpSession;
pub use node::Endpoint;
pub use node::Node;
pub use node::NodeAction;
pub use node::NodeError;
pub use node::NodeStatus;
pub use node::PersistState;
pub use node::RegistrationState;
pub use node::SecretBuffer;
pub use node::Transport;
pub use critical_section;
pub use embedded_io_async;
pub use embedded_tls;
pub use micro_h2 as http2;
pub use wirefeather as tunnel;

Modules§

control
The Tailscale control-plane messages, encoded without an allocator.
derp
DERP: relaying for peers with no direct path.
disco
Disco: finding a direct path to a peer.
keys
A Tailscale node’s identity: three keys, their wire encoding, and the blob that carries them across a reboot.
local_tcp
Bounded userspace TCP over caller-supplied IPv4 packets.
netmap
The network map: who else is on the tailnet, and how to reach them.
node
The transport-agnostic, cooperative node state machine.
noise
The Tailscale control-plane transport, known upstream as ts2021.
state
Power-loss-safe storage for a node’s persistent state.
stun
Minimal allocation-free STUN binding requests and IPv4 responses.
time
Allocation-free SNTP request validation and trusted-time consensus.

Structs§

BoundedVec
Bounded storage for netmap collections: inline without alloc, growing on the heap (fallibly) with it. A vector of at most N plain values, for collections that hold no secrets: packet-filter rules, DERP relays, parser scratch space. Without alloc it is a heapless::Vec<T, N>; with alloc it is a heap vector that grows on demand up to N (which may be UNBOUNDED). Unlike PeerVec, elements are stored contiguously, so growing may move them.

Constants§

UNBOUNDED
A PEERS bound with no limit: tables grow while memory allows. Requires the alloc feature. A capacity with no configured limit; the collection grows while the allocator has memory. Only meaningful with the alloc feature: without it the capacity is reserved inline and this would not fit in memory.