pub struct PeerState {
pub id: String,
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>,
}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.
Fields§
§id: StringTailscale stable node ID from the network provider. Used as the primary key for routing inside the session layer.
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 the WebSocket hello handshake has completed; Some
once we have received the remote’s identity block. This is the
source of truth for device_id and the display device_name.