summaryrefslogtreecommitdiffhomepage
path: root/types
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2023-08-16 15:23:40 -0700
committerBrad Fitzpatrick <bradfitz@tailscale.com>2023-08-16 15:23:43 -0700
commitb256c319c08c50bd52e617c500a37e566fbbb432 (patch)
tree5d5ee711ff693b81ac0a2f0fbff70c9c5cd4c929 /types
parent57da1f150199957fbb3659df3a607cfb2af74317 (diff)
downloadtailscale-bradfitz/gui_netmap.tar.xz
tailscale-bradfitz/gui_netmap.zip
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'types')
-rw-r--r--types/netmap/netmap.go30
1 files changed, 28 insertions, 2 deletions
diff --git a/types/netmap/netmap.go b/types/netmap/netmap.go
index b3a9df8ba..72ca82ac2 100644
--- a/types/netmap/netmap.go
+++ b/types/netmap/netmap.go
@@ -19,6 +19,34 @@ import (
"tailscale.com/wgengine/filter"
)
+type NetworkMapView struct {
+ nm *NetworkMap
+}
+
+type GUIPeerNode struct {
+ ID tailcfg.StableNodeID
+ BaseOrFQDNName string // no "." substring if in your tailnet, else FQDN
+ Owner tailcfg.UserID // user or fake userid for tagged nodes
+ IPv4 netip.Addr // may be be zero value (empty string in JSON)
+ IPv6 netip.Addr // may be be zero value (empty string in JSON)
+ MachineStatus tailcfg.MachineStatus
+ Hostinfo GUIHostInfo
+
+ IsExitNode bool
+}
+
+type GUIHostInfo struct {
+ ShareeNode bool `json:",omitempty"` // indicates this node exists in netmap because it's owned by a shared-to user
+}
+
+type GUINetworkMap struct {
+ SelfNode *tailcfg.Node // TODO: GUISelfNode ?
+ Peers []*GUIPeerNode
+ UserProfiles map[tailcfg.UserID]tailcfg.UserProfile
+
+ TKAEnabled bool
+}
+
// NetworkMap is the current state of the world.
//
// The fields should all be considered read-only. They might
@@ -70,8 +98,6 @@ type NetworkMap struct {
// hash of the latest update message to tick through TKA).
TKAHead tka.AUMHash
- // ACLs
-
User tailcfg.UserID
// Domain is the current Tailnet name.