Documentation ¶
Overview ¶
Package netmap contains the netmap.NetworkMap type.
Index ¶
- type NetworkMap
- func (nm *NetworkMap) Concise() string
- func (b *NetworkMap) ConciseDiffFrom(a *NetworkMap) string
- func (nm *NetworkMap) JSON() string
- func (nm *NetworkMap) MagicDNSSuffix() string
- func (nm *NetworkMap) PeerByTailscaleIP(ip netip.Addr) (peer *tailcfg.Node, ok bool)
- func (nm *NetworkMap) PeerWithStableID(pid tailcfg.StableNodeID) (_ *tailcfg.Node, ok bool)
- func (nm *NetworkMap) String() string
- func (nm *NetworkMap) VeryConcise() string
- type WGConfigFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetworkMap ¶
type NetworkMap struct { SelfNode *tailcfg.Node NodeKey key.NodePublic PrivateKey key.NodePrivate Expiry time.Time // Name is the DNS name assigned to this node. Name string Addresses []netip.Prefix // same as tailcfg.Node.Addresses (IP addresses of this Node directly) MachineStatus tailcfg.MachineStatus MachineKey key.MachinePublic Peers []*tailcfg.Node // sorted by Node.ID DNS tailcfg.DNSConfig // TODO(maisem) : replace with View. Hostinfo tailcfg.Hostinfo PacketFilter []filter.Match SSHPolicy *tailcfg.SSHPolicy // or nil, if not enabled/allowed // CollectServices reports whether this node's Tailnet has // requested that info about services be included in HostInfo. // If set, Hostinfo.ShieldsUp blocks services collection; that // takes precedence over this field. CollectServices bool // DERPMap is the last DERP server map received. It's reused // between updates and should not be modified. DERPMap *tailcfg.DERPMap // Debug knobs from control server for debug or feature gating. Debug *tailcfg.Debug // ControlHealth are the list of health check problems for this // node from the perspective of the control plane. // If empty, there are no known problems from the control plane's // point of view, but the node might know about its own health // check problems. ControlHealth []string User tailcfg.UserID // Domain is the current Tailnet name. Domain string UserProfiles map[tailcfg.UserID]tailcfg.UserProfile }
NetworkMap is the current state of the world.
The fields should all be considered read-only. They might alias parts of previous NetworkMap values.
func (*NetworkMap) Concise ¶
func (nm *NetworkMap) Concise() string
func (*NetworkMap) ConciseDiffFrom ¶
func (b *NetworkMap) ConciseDiffFrom(a *NetworkMap) string
func (*NetworkMap) JSON ¶
func (nm *NetworkMap) JSON() string
func (*NetworkMap) MagicDNSSuffix ¶
func (nm *NetworkMap) MagicDNSSuffix() string
MagicDNSSuffix returns the domain's MagicDNS suffix (even if MagicDNS isn't necessarily in use).
It will neither start nor end with a period.
func (*NetworkMap) PeerByTailscaleIP ¶ added in v1.26.0
PeerByTailscaleIP returns a peer's Node based on its Tailscale IP.
If nm is nil or no peer is found, ok is false.
func (*NetworkMap) PeerWithStableID ¶ added in v1.28.0
func (nm *NetworkMap) PeerWithStableID(pid tailcfg.StableNodeID) (_ *tailcfg.Node, ok bool)
PeerWithStableID finds and returns the peer associated to the inputted StableNodeID.
func (*NetworkMap) String ¶
func (nm *NetworkMap) String() string
func (*NetworkMap) VeryConcise ¶ added in v1.14.0
func (nm *NetworkMap) VeryConcise() string
type WGConfigFlags ¶
type WGConfigFlags int
WGConfigFlags is a bitmask of flags to control the behavior of the wireguard configuration generation done by NetMap.WGCfg.
const ( AllowSingleHosts WGConfigFlags = 1 << iota AllowSubnetRoutes )