diff --git a/tailnet/coordinator.go b/tailnet/coordinator.go index d6e8b6bbb6e59..ee696b0925e3c 100644 --- a/tailnet/coordinator.go +++ b/tailnet/coordinator.go @@ -16,14 +16,25 @@ import ( // Node represents a node in the network. type Node struct { - ID tailcfg.NodeID `json:"id"` - Key key.NodePublic `json:"key"` - DiscoKey key.DiscoPublic `json:"disco"` - PreferredDERP int `json:"preferred_derp"` - DERPLatency map[string]float64 `json:"derp_latency"` - Addresses []netip.Prefix `json:"addresses"` - AllowedIPs []netip.Prefix `json:"allowed_ips"` - Endpoints []string `json:"endpoints"` + // ID is used to identify the connection. + ID tailcfg.NodeID `json:"id"` + // Key is the Wireguard public key of the node. + Key key.NodePublic `json:"key"` + // DiscoKey is used for discovery messages over DERP to establish peer-to-peer connections. + DiscoKey key.DiscoPublic `json:"disco"` + // PreferredDERP is the DERP server that peered connections + // should meet at to establish. + PreferredDERP int `json:"preferred_derp"` + // DERPLatency is the latency in seconds to each DERP server. + DERPLatency map[string]float64 `json:"derp_latency"` + // Addresses are the IP address ranges this connection exposes. + Addresses []netip.Prefix `json:"addresses"` + // AllowedIPs specify what addresses can dial the connection. + // We allow all by default. + AllowedIPs []netip.Prefix `json:"allowed_ips"` + // Endpoints are ip:port combinations that can be used to establish + // peer-to-peer connections. + Endpoints []string `json:"endpoints"` } // ServeCoordinator matches the RW structure of a coordinator to exchange node messages.