type net/netip.Addr
106 uses
net/netip (current package)
netip.go#L38: type Addr struct {
netip.go#L76: func IPv6LinkLocalAllNodes() Addr { return AddrFrom16([16]byte{0: 0xff, 1: 0x02, 15: 0x01}) }
netip.go#L79: func IPv6Unspecified() Addr { return Addr{z: z6noz} }
netip.go#L82: func IPv4Unspecified() Addr { return AddrFrom4([4]byte{}) }
netip.go#L85: func AddrFrom4(addr [4]byte) Addr {
netip.go#L86: return Addr{
netip.go#L95: func AddrFrom16(addr [16]byte) Addr {
netip.go#L96: return Addr{
netip.go#L107: func ipv6Slice(addr []byte) Addr {
netip.go#L108: return Addr{
netip.go#L120: func ParseAddr(s string) (Addr, error) {
netip.go#L130: return Addr{}, parseAddrError{in: s, msg: "missing IPv6 address"}
netip.go#L133: return Addr{}, parseAddrError{in: s, msg: "unable to parse IP"}
netip.go#L138: func MustParseAddr(s string) Addr {
netip.go#L161: func parseIPv4(s string) (ip Addr, err error) {
netip.go#L168: return Addr{}, parseAddrError{in: s, msg: "IPv4 field has octet with leading zero"}
netip.go#L173: return Addr{}, parseAddrError{in: s, msg: "IPv4 field has value >255"}
netip.go#L180: return Addr{}, parseAddrError{in: s, msg: "IPv4 field must have at least one digit", at: s[i:]}
netip.go#L184: return Addr{}, parseAddrError{in: s, msg: "IPv4 address too long"}
netip.go#L191: return Addr{}, parseAddrError{in: s, msg: "unexpected character", at: s[i:]}
netip.go#L195: return Addr{}, parseAddrError{in: s, msg: "IPv4 address too short"}
netip.go#L202: func parseIPv6(in string) (Addr, error) {
netip.go#L215: return Addr{}, parseAddrError{in: in, msg: "zone must be a non-empty string"}
netip.go#L252: return Addr{}, parseAddrError{in: in, msg: "IPv6 field has value >=2^16", at: s}
netip.go#L257: return Addr{}, parseAddrError{in: in, msg: "each colon-separated field must have at least one digit", at: s}
netip.go#L264: return Addr{}, parseAddrError{in: in, msg: "embedded IPv4 address must replace the final 2 fields of the address", at: s}
netip.go#L268: return Addr{}, parseAddrError{in: in, msg: "too many hex fields to fit an embedded IPv4 at the end of the address", at: s}
netip.go#L275: return Addr{}, parseAddrError{in: in, msg: err.Error(), at: s}
netip.go#L299: return Addr{}, parseAddrError{in: in, msg: "unexpected character, want colon", at: s}
netip.go#L301: return Addr{}, parseAddrError{in: in, msg: "colon must be followed by more characters", at: s}
netip.go#L308: return Addr{}, parseAddrError{in: in, msg: "multiple :: in address", at: s}
netip.go#L320: return Addr{}, parseAddrError{in: in, msg: "trailing garbage after address", at: s}
netip.go#L326: return Addr{}, parseAddrError{in: in, msg: "address string too short"}
netip.go#L337: return Addr{}, parseAddrError{in: in, msg: "the :: must expand to at least one field of zeros"}
netip.go#L345: func AddrFromSlice(slice []byte) (ip Addr, ok bool) {
netip.go#L352: return Addr{}, false
netip.go#L357: func (ip Addr) v4(i uint8) uint8 {
netip.go#L363: func (ip Addr) v6(i uint8) uint8 {
netip.go#L369: func (ip Addr) v6u16(i uint8) uint16 {
netip.go#L378: func (ip Addr) isZero() bool {
netip.go#L387: func (ip Addr) IsValid() bool { return ip.z != z0 }
netip.go#L394: func (ip Addr) BitLen() int {
netip.go#L405: func (ip Addr) Zone() string {
netip.go#L416: func (ip Addr) Compare(ip2 Addr) int {
netip.go#L453: func (ip Addr) Less(ip2 Addr) bool { return ip.Compare(ip2) == -1 }
netip.go#L455: func (ip Addr) lessOrEq(ip2 Addr) bool { return ip.Compare(ip2) <= 0 }
netip.go#L460: func (ip Addr) Is4() bool {
netip.go#L465: func (ip Addr) Is4In6() bool {
netip.go#L471: func (ip Addr) Is6() bool {
netip.go#L479: func (ip Addr) Unmap() Addr {
netip.go#L489: func (ip Addr) WithZone(zone string) Addr {
netip.go#L503: func (ip Addr) withoutZone() Addr {
netip.go#L512: func (ip Addr) hasZone() bool {
netip.go#L517: func (ip Addr) IsLinkLocalUnicast() bool {
netip.go#L532: func (ip Addr) IsLoopback() bool {
netip.go#L547: func (ip Addr) IsMulticast() bool {
netip.go#L563: func (ip Addr) IsInterfaceLocalMulticast() bool {
netip.go#L573: func (ip Addr) IsLinkLocalMulticast() bool {
netip.go#L596: func (ip Addr) IsGlobalUnicast() bool {
netip.go#L618: func (ip Addr) IsPrivate() bool {
netip.go#L641: func (ip Addr) IsUnspecified() bool {
netip.go#L650: func (ip Addr) Prefix(b int) (Prefix, error) {
netip.go#L682: func (ip Addr) As16() (a16 [16]byte) {
netip.go#L691: func (ip Addr) As4() (a4 [4]byte) {
netip.go#L703: func (ip Addr) AsSlice() []byte {
netip.go#L721: func (ip Addr) Next() Addr {
netip.go#L726: return Addr{}
netip.go#L731: return Addr{}
netip.go#L739: func (ip Addr) Prev() Addr {
netip.go#L742: return Addr{}
netip.go#L745: return Addr{}
netip.go#L763: func (ip Addr) String() string {
netip.go#L785: func (ip Addr) AppendTo(b []byte) []byte {
netip.go#L845: func (ip Addr) string4() string {
netip.go#L852: func (ip Addr) appendTo4(ret []byte) []byte {
netip.go#L868: func (ip Addr) string6() string {
netip.go#L882: func (ip Addr) appendTo6(ret []byte) []byte {
netip.go#L918: func (ip Addr) StringExpanded() string {
netip.go#L946: func (ip Addr) MarshalText() ([]byte, error) {
netip.go#L976: func (ip *Addr) UnmarshalText(text []byte) error {
netip.go#L978: *ip = Addr{}
netip.go#L986: func (ip Addr) marshalBinaryWithTrailingBytes(trailingBytes int) []byte {
netip.go#L1008: func (ip Addr) MarshalBinary() ([]byte, error) {
netip.go#L1014: func (ip *Addr) UnmarshalBinary(b []byte) error {
netip.go#L1018: *ip = Addr{}
netip.go#L1035: ip Addr
netip.go#L1041: func AddrPortFrom(ip Addr, port uint16) AddrPort { return AddrPort{ip: ip, port: port} }
netip.go#L1044: func (p AddrPort) Addr() Addr { return p.ip }
netip.go#L1223: var addr Addr
netip.go#L1237: ip Addr
netip.go#L1261: func PrefixFrom(ip Addr, bits int) Prefix {
netip.go#L1273: func (p Prefix) Addr() Addr { return p.ip }
netip.go#L1347: func (p Prefix) Contains(ip Addr) bool {
netip.go#L1483: var addr Addr
net
lookup.go#L240: func (r *Resolver) LookupNetIP(ctx context.Context, network, host string) ([]netip.Addr, error) {
lookup.go#L249: ret := make([]netip.Addr, 0, len(ips))
udpsock_posix.go#L73: var ip netip.Addr