pub struct PeerChange {
pub id: Id,
pub derp_region: Option<RegionId>,
pub cap: Option<CapabilityVersion>,
pub cap_map: Option<NodeCapMap>,
pub underlay_addresses: Option<Vec<SocketAddr>>,
pub node_key: Option<NodePublicKey>,
pub key_signature: Option<Vec<u8>>,
pub disco_key: Option<DiscoPublicKey>,
pub node_key_expiry: Option<DateTime<Utc>>,
pub online: Option<bool>,
pub last_seen: Option<DateTime<Utc>>,
}Expand description
An incremental update to a single already-known peer Node, carried in
MapResponse::peers_changed_patch.
Control sends a patch (rather than a full node in peers_changed) when only a peer’s
reachability changes mid-session — most importantly its UDP endpoints
and home derp_region when an idle peer re-establishes connectivity.
Every field is Option: a patch sets only the fields it carries and leaves the rest of the
target node unchanged (see PeerTracker::apply_peer_update for the merge). Owned counterpart
of the borrow-bound ts_control_serde::PeerChange; the fields that map onto a domain
Node field are retained, including control’s online/last_seen liveness deltas — the
dominant channel by which peer online transitions are delivered (see Node::online).
Fields§
§id: IdThe Node::id of the peer being mutated. If no peer with this id is in the current
netmap, the patch is ignored (the wire contract — a patch never creates a node).
derp_region: Option<RegionId>If Some, the peer’s new home DERP region.
cap: Option<CapabilityVersion>If Some, the peer’s new advertised capability version.
cap_map: Option<NodeCapMap>If Some, the peer’s new capability map (replaces the prior map wholesale).
underlay_addresses: Option<Vec<SocketAddr>>If Some, the peer’s new UDP underlay endpoints (Endpoints in Go; replaces the prior
set). This is the field that lets magicsock re-handshake a peer that moved.
node_key: Option<NodePublicKey>If Some, the peer’s new WireGuard public key (key rotation).
key_signature: Option<Vec<u8>>If Some, the marshalled TKA signature over the new node key. Re-verified at the
peer-trust chokepoint when tailnet-lock enforcement is active.
disco_key: Option<DiscoPublicKey>If Some, the peer’s new disco public key.
node_key_expiry: Option<DateTime<Utc>>If Some, the peer’s new node-key expiry (KeyExpiry in Go). Maps to
Node::node_key_expiry; carried so an expiry-only patch isn’t lost until the next full
resync.
online: Option<bool>If Some, the peer’s new online status (PeerChange.Online). None here means “this patch
did not touch online”, not “offline” — the merge sets Node::online only when present.
last_seen: Option<DateTime<Utc>>If Some, the peer’s new last-seen time (PeerChange.LastSeen). Maps to Node::last_seen.
Trait Implementations§
Source§impl Clone for PeerChange
impl Clone for PeerChange
Source§fn clone(&self) -> PeerChange
fn clone(&self) -> PeerChange
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PeerChange
impl Debug for PeerChange
impl Eq for PeerChange
Source§impl From<&PeerChange<'_>> for PeerChange
impl From<&PeerChange<'_>> for PeerChange
Source§fn from(value: &PeerChange<'_>) -> Self
fn from(value: &PeerChange<'_>) -> Self
Source§impl PartialEq for PeerChange
impl PartialEq for PeerChange
Source§fn eq(&self, other: &PeerChange) -> bool
fn eq(&self, other: &PeerChange) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PeerChange
Auto Trait Implementations§
impl Freeze for PeerChange
impl RefUnwindSafe for PeerChange
impl Send for PeerChange
impl Sync for PeerChange
impl Unpin for PeerChange
impl UnsafeUnpin for PeerChange
impl UnwindSafe for PeerChange
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.