tailscale.comtailscale.com/net/netaddr Index | Files

package netaddr

import "tailscale.com/net/netaddr"

Package netaddr is a transitional package while we finish migrating from inet.af/netaddr to Go 1.18's net/netip.

TODO(bradfitz): delete this package eventually. Tracking bug is https://github.com/tailscale/tailscale/issues/5162

Index

Functions

func FromStdIPNet

func FromStdIPNet(std *net.IPNet) (prefix netip.Prefix, ok bool)

FromStdIPNet returns an IPPrefix from the standard library's IPNet type. If std is invalid, ok is false.

func IPv4

func IPv4(a, b, c, d uint8) netip.Addr

IPv4 returns the IP of the IPv4 address a.b.c.d.

func Unmap

func Unmap(ap netip.AddrPort) netip.AddrPort

Unmap returns the provided AddrPort with its Addr IP component Unmap'ed.

See https://github.com/golang/go/issues/53607#issuecomment-1203466984

Source Files

netaddr.go

Version
v1.84.0 (latest)
Published
May 21, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
1 day ago

Tools for package owners.