tsaddr
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package tsaddr handles Tailscale-specific IPs and ranges.
Index¶
- Constants
- func AllIPv4() netip.Prefix
- func AllIPv6() netip.Prefix
- func CGNATRange() netip.Prefix
- func ChromeOSVMRange() netip.Prefix
- func ContainsExitRoute(rr views.Slice[netip.Prefix]) bool
- func ContainsExitRoutes(rr views.Slice[netip.Prefix]) bool
- func ContainsNonExitSubnetRoutes(rr views.Slice[netip.Prefix]) bool
- func ExitRoutes() []netip.Prefix
- func FilterPrefixesCopy(in views.Slice[netip.Prefix], f func(netip.Prefix) bool) []netip.Prefix
- func IsExitRoute(p netip.Prefix) bool
- func IsTailscaleIP(ip netip.Addr) bool
- func IsTailscaleIPv4(ip netip.Addr) bool
- func IsViaPrefix(p netip.Prefix) bool
- func MapVia(siteID uint32, v4 netip.Prefix) (via netip.Prefix, err error)
- func PrefixIs4(p netip.Prefix) bool
- func PrefixIs6(p netip.Prefix) bool
- func PrefixesContainsIP(ipp []netip.Prefix, ip netip.Addr) bool
- func SortPrefixes(p []netip.Prefix)
- func Tailscale4To6(ipv4 netip.Addr) netip.Addr
- func Tailscale4To6Placeholder() netip.Addr
- func Tailscale4To6Range() netip.Prefix
- func Tailscale6to4(ipv6 netip.Addr) (netip.Addr, bool)
- func TailscaleEphemeral6Range() netip.Prefix
- func TailscaleServiceIP() netip.Addr
- func TailscaleServiceIPv6() netip.Addr
- func TailscaleULARange() netip.Prefix
- func TailscaleViaRange() netip.Prefix
- func UnmapVia(ip netip.Addr) netip.Addr
- func WithoutExitRoute(rr views.Slice[netip.Prefix]) views.Slice[netip.Prefix]
- func WithoutExitRoutes(rr views.Slice[netip.Prefix]) views.Slice[netip.Prefix]
Constants¶
const (TailscaleServiceIPString = "100.100.100.100"TailscaleServiceIPv6String = "fd7a:115c:a1e0::53")
Variables¶
This section is empty.
Functions¶
funcCGNATRange¶
CGNATRange returns the Carrier Grade NAT address range thatis the superset range that Tailscale assigns out of.Seehttps://tailscale.com/s/cgnatNote that Tailscale does not assign out of the ChromeOSVMRange.
funcChromeOSVMRange¶
ChromeOSVMRange returns the subset of the CGNAT IPv4 range used byChromeOS to interconnect the host OS to containers and VMs. Weavoid allocating Tailscale IPs from it, to avoid conflicts.
funcContainsExitRoute¶added inv1.76.0
ContainsExitRoute reports whether rr contains at least one of IPv4 orIPv6 /0 (exit) routes.
funcContainsExitRoutes¶added inv1.24.0
ContainsExitRoutes reports whether rr contains both the IPv4 andIPv6 /0 route.
funcContainsNonExitSubnetRoutes¶added inv1.50.0
ContainsNonExitSubnetRoutes reports whether v contains SubnetRoutes other than ExitNode Routes.
funcExitRoutes¶added inv1.24.0
ExitRoutes returns a slice containing AllIPv4 and AllIPv6.
funcFilterPrefixesCopy¶added inv1.24.0
FilterPrefixes returns a new slice, not aliasing in, containing elements ofin that match f.
funcIsExitRoute¶added inv1.76.0
IsExitRoute reports whether p is an exit node route.
funcIsTailscaleIP¶
IsTailscaleIP reports whether IP is an IP address in a range thatTailscale assigns from.
funcIsTailscaleIPv4¶added inv1.78.0
IsTailscaleIPv4 reports whether an IPv4 IP is an IP address thatTailscale assigns from.
funcIsViaPrefix¶added inv1.24.0
IsViaPrefix reports whether p is a CIDR in the Tailscale "via" range.See TailscaleViaRange.
funcPrefixesContainsIP¶added inv1.20.0
PrefixesContainsIP reports whether any prefix in ipp contains ip.
funcSortPrefixes¶added inv1.34.0
SortPrefixes sorts the prefixes in place.
funcTailscale4To6¶added inv1.2.0
Tailscale4To6 returns a Tailscale IPv6 address that maps 1:1 to thegiven Tailscale IPv4 address. Returns a zero IP if ipv4 isn't aTailscale IPv4 address.
funcTailscale4To6Placeholder¶added inv1.6.0
Tailscale4To6Placeholder returns an IP address that can be used asa source IP when one is required, but a netmap didn't provideany. This address never gets allocated by the 4-to-6 algorithm incontrol.
Currently used to work around a Windows limitation when programmingIPv6 routes in corner cases.
funcTailscale4To6Range¶added inv1.2.0
Tailscale4To6Range returns the subset of TailscaleULARange used forauto-translated Tailscale ipv4 addresses.
funcTailscale6to4¶added inv1.24.0
Tailscale6to4 returns the IPv4 address corresponding to the giventailscale IPv6 address within the 4To6 range. The IPv4 addressand true are returned if the given address was in the correct range,false if not.
funcTailscaleEphemeral6Range¶added inv1.8.0
TailscaleEphemeral6Range returns the subset of TailscaleULARangeused for ephemeral IPv6-only Tailscale nodes.
funcTailscaleServiceIP¶added inv1.0.1
TailscaleServiceIP returns the IPv4 listen address of servicesprovided by Tailscale itself such as the MagicDNS proxy.
For IPv6, use TailscaleServiceIPv6.
funcTailscaleServiceIPv6¶added inv1.20.0
TailscaleServiceIPv6 returns the IPv6 listen address of the servicesprovided by Tailscale itself such as the MagicDNS proxy.
For IPv4, use TailscaleServiceIP.
funcTailscaleULARange¶added inv1.2.0
TailscaleULARange returns the IPv6 Unique Local Address range thatis the superset range that Tailscale assigns out of.
funcTailscaleViaRange¶added inv1.24.0
TailscaleViaRange returns the IPv6 Unique Local Address subset rangeTailscaleULARange that's used for IPv4 tunneling via IPv6.
funcUnmapVia¶added inv1.24.0
UnmapVia returns the IPv4 address that corresponds to the provided Tailscale"via" IPv4-in-IPv6 address.
If ip is not a via address, it returns ip unchanged.
funcWithoutExitRoute¶added inv1.76.0
WithoutExitRoute returns rr unchanged if it has 0 /0routes. If it has a IPv4 or IPv6 /0 routes, then it returnsa copy with all /0 routes removed.
Types¶
This section is empty.