@@ -213,10 +213,20 @@ type Node struct {
213
213
Addresses []netip.Prefix // IP addresses of this Node directly
214
214
AllowedIPs []netip.Prefix // range of IP addresses to route to this node
215
215
Endpoints []string `json:",omitempty"` // IP+port (public via STUN, and local LANs)
216
- DERP string `json:",omitempty"` // DERP-in-IP:port ("127.3.3.40:N") endpoint
217
- Hostinfo HostinfoView
218
- Created time.Time
219
- Cap CapabilityVersion `json:",omitempty"` // if non-zero, the node's capability version; old servers might not send
216
+
217
+ // DERP is this node's home DERP region ID integer, but shoved into an
218
+ // IP:port string for legacy reasons. The IP address is always "127.3.3.40"
219
+ // (a loopback address (127) followed by the digits over the letters DERP on
220
+ // a QWERTY keyboard (3.3.40)). The "port number" is the home DERP region ID
221
+ // integer.
222
+ //
223
+ // TODO(bradfitz): simplify this legacy mess; add a new HomeDERPRegionID int
224
+ // field behind a new capver bump.
225
+ DERP string `json:",omitempty"` // DERP-in-IP:port ("127.3.3.40:N") endpoint
226
+
227
+ Hostinfo HostinfoView
228
+ Created time.Time
229
+ Cap CapabilityVersion `json:",omitempty"` // if non-zero, the node's capability version; old servers might not send
220
230
221
231
// Tags are the list of ACL tags applied to this node.
222
232
// Tags take the form of `tag:<value>` where value starts
@@ -677,11 +687,12 @@ type NetInfo struct {
677
687
// Empty means not checked.
678
688
PCP opt.Bool
679
689
680
- // PreferredDERP is this node's preferred DERP server
681
- // for incoming traffic. The node might be be temporarily
682
- // connected to multiple DERP servers (to send to other nodes)
683
- // but PreferredDERP is the instance number that the node
684
- // subscribes to traffic at.
690
+ // PreferredDERP is this node's preferred (home) DERP region ID.
691
+ // This is where the node expects to be contacted to begin a
692
+ // peer-to-peer connection. The node might be be temporarily
693
+ // connected to multiple DERP servers (to speak to other nodes
694
+ // that are located elsewhere) but PreferredDERP is the region ID
695
+ // that the node subscribes to traffic at.
685
696
// Zero means disconnected or unknown.
686
697
PreferredDERP int
687
698
@@ -1616,8 +1627,15 @@ type ControlIPCandidate struct {
1616
1627
Priority int `json:",omitempty"`
1617
1628
}
1618
1629
1619
- // Debug are instructions from the control server to the client
1620
- // to adjust debug settings.
1630
+ // Debug are instructions from the control server to the client to adjust debug
1631
+ // settings.
1632
+ //
1633
+ // Deprecated: these should no longer be used. They're a weird mix of declartive
1634
+ // and imperative. The imperative ones should be c2n requests instead, and the
1635
+ // declarative ones (at least the bools) should generally be self
1636
+ // Node.Capabilities.
1637
+ //
1638
+ // TODO(bradfitz): start migrating the imperative ones to c2n requests.
1621
1639
type Debug struct {
1622
1640
// LogHeapPprof controls whether the client should log
1623
1641
// its heap pprof data. Each true value sent from the server
0 commit comments