pub struct PeerState {
pub id: String,
pub generation: u64,
pub name: String,
pub ip: IpAddr,
pub online: bool,
pub ws_connected: bool,
pub connection_type: String,
pub os: Option<String>,
pub last_seen: Option<String>,
pub identity: Option<PeerIdentity>,
pub identity_suppressed: bool,
}Expand description
A peer’s state in the session registry.
Combines Layer 3 network information (discovery, addressing) with Layer 5 session state (connection status). Peers are added to the registry when Layer 3 reports them, NOT when transport connections are established.
RFC 022: id is always the Tailscale stable node id (routing key).
Application-facing durable identity lives in Self::identity and is
projected as an honest Option (never filled with the Tailscale id).
Fields§
§id: StringTailscale stable node ID from the network provider. Used as the primary key for routing inside the session layer.
generation: u64Generation counter for this id within this process (RFC 022 §7.7).
Bumped each time the same Tailscale node re-joins after Left.
Combined with id to form Self::peer_ref.
name: StringTailscale hostname (as seen by Layer 3). This is the slugged form,
NOT the user-facing device_name.
ip: IpAddrNetwork IP address.
online: boolWhether the peer is currently online (from Layer 3).
ws_connected: boolWhether the peer has an active WebSocket connection.
connection_type: StringConnection type description (e.g., “direct” or “relay:ord”).
os: Option<String>Operating system of the peer, if known (from Layer 3).
last_seen: Option<String>Last time the peer was seen online (RFC 3339 string).
identity: Option<PeerIdentity>Peer identity advertised in the remote’s hello envelope (RFC 017 §8).
None until identity is learned (hello / future hostinfo). This is
the source of truth for the durable ULID — never filled with the
Tailscale id as a fallback (RFC 022).
identity_suppressed: boolWhen true, identity is stored but not published as device_id
because another live peer already owns that ULID in by_device
(first-wins, RFC 022 §7.7).