type net/netip.Addr
112 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#L80: func IPv6LinkLocalAllRouters() Addr { return AddrFrom16([16]byte{0: 0xff, 1: 0x02, 15: 0x02}) }
netip.go#L83: func IPv6Loopback() Addr { return AddrFrom16([16]byte{15: 0x01}) }
netip.go#L86: func IPv6Unspecified() Addr { return Addr{z: z6noz} }
netip.go#L89: func IPv4Unspecified() Addr { return AddrFrom4([4]byte{}) }
netip.go#L92: func AddrFrom4(addr [4]byte) Addr {
netip.go#L93: return Addr{
netip.go#L102: func AddrFrom16(addr [16]byte) Addr {
netip.go#L103: return Addr{
netip.go#L115: func ParseAddr(s string) (Addr, error) {
netip.go#L125: return Addr{}, parseAddrError{in: s, msg: "missing IPv6 address"}
netip.go#L128: return Addr{}, parseAddrError{in: s, msg: "unable to parse IP"}
netip.go#L133: func MustParseAddr(s string) Addr {
netip.go#L196: func parseIPv4(s string) (ip Addr, err error) {
netip.go#L200: return Addr{}, err
netip.go#L206: func parseIPv6(in string) (Addr, error) {
netip.go#L219: return Addr{}, parseAddrError{in: in, msg: "zone must be a non-empty string"}
netip.go#L256: return Addr{}, parseAddrError{in: in, msg: "each group must have 4 or less digits", at: s}
netip.go#L260: return Addr{}, parseAddrError{in: in, msg: "IPv6 field has value >=2^16", at: s}
netip.go#L265: return Addr{}, parseAddrError{in: in, msg: "each colon-separated field must have at least one digit", at: s}
netip.go#L272: return Addr{}, parseAddrError{in: in, msg: "embedded IPv4 address must replace the final 2 fields of the address", at: s}
netip.go#L276: 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#L285: return Addr{}, err
netip.go#L305: return Addr{}, parseAddrError{in: in, msg: "unexpected character, want colon", at: s}
netip.go#L307: return Addr{}, parseAddrError{in: in, msg: "colon must be followed by more characters", at: s}
netip.go#L314: return Addr{}, parseAddrError{in: in, msg: "multiple :: in address", at: s}
netip.go#L326: return Addr{}, parseAddrError{in: in, msg: "trailing garbage after address", at: s}
netip.go#L332: return Addr{}, parseAddrError{in: in, msg: "address string too short"}
netip.go#L341: return Addr{}, parseAddrError{in: in, msg: "the :: must expand to at least one field of zeros"}
netip.go#L349: func AddrFromSlice(slice []byte) (ip Addr, ok bool) {
netip.go#L356: return Addr{}, false
netip.go#L361: func (ip Addr) v4(i uint8) uint8 {
netip.go#L367: func (ip Addr) v6(i uint8) uint8 {
netip.go#L373: func (ip Addr) v6u16(i uint8) uint16 {
netip.go#L382: func (ip Addr) isZero() bool {
netip.go#L391: func (ip Addr) IsValid() bool { return ip.z != z0 }
netip.go#L398: func (ip Addr) BitLen() int {
netip.go#L409: func (ip Addr) Zone() string {
netip.go#L419: func (ip Addr) Compare(ip2 Addr) int {
netip.go#L456: func (ip Addr) Less(ip2 Addr) bool { return ip.Compare(ip2) == -1 }
netip.go#L461: func (ip Addr) Is4() bool {
netip.go#L468: func (ip Addr) Is4In6() bool {
netip.go#L474: func (ip Addr) Is6() bool {
netip.go#L482: func (ip Addr) Unmap() Addr {
netip.go#L492: func (ip Addr) WithZone(zone string) Addr {
netip.go#L506: func (ip Addr) withoutZone() Addr {
netip.go#L515: func (ip Addr) hasZone() bool {
netip.go#L520: func (ip Addr) IsLinkLocalUnicast() bool {
netip.go#L539: func (ip Addr) IsLoopback() bool {
netip.go#L558: func (ip Addr) IsMulticast() bool {
netip.go#L578: func (ip Addr) IsInterfaceLocalMulticast() bool {
netip.go#L588: func (ip Addr) IsLinkLocalMulticast() bool {
netip.go#L615: func (ip Addr) IsGlobalUnicast() bool {
netip.go#L641: func (ip Addr) IsPrivate() bool {
netip.go#L668: func (ip Addr) IsUnspecified() bool {
netip.go#L677: func (ip Addr) Prefix(b int) (Prefix, error) {
netip.go#L704: func (ip Addr) As16() (a16 [16]byte) {
netip.go#L713: func (ip Addr) As4() (a4 [4]byte) {
netip.go#L725: func (ip Addr) AsSlice() []byte {
netip.go#L743: func (ip Addr) Next() Addr {
netip.go#L748: return Addr{}
netip.go#L753: return Addr{}
netip.go#L761: func (ip Addr) Prev() Addr {
netip.go#L764: return Addr{}
netip.go#L767: return Addr{}
netip.go#L785: func (ip Addr) String() string {
netip.go#L802: func (ip Addr) AppendTo(b []byte) []byte {
netip.go#L856: func (ip Addr) string4() string {
netip.go#L863: func (ip Addr) appendTo4(ret []byte) []byte {
netip.go#L874: func (ip Addr) string4In6() string {
netip.go#L881: func (ip Addr) appendTo4In6(ret []byte) []byte {
netip.go#L896: func (ip Addr) string6() string {
netip.go#L910: func (ip Addr) appendTo6(ret []byte) []byte {
netip.go#L946: func (ip Addr) StringExpanded() string {
netip.go#L973: func (ip Addr) AppendText(b []byte) ([]byte, error) {
netip.go#L980: func (ip Addr) MarshalText() ([]byte, error) {
netip.go#L1004: func (ip *Addr) UnmarshalText(text []byte) error {
netip.go#L1006: *ip = Addr{}
netip.go#L1015: func (ip Addr) AppendBinary(b []byte) ([]byte, error) {
netip.go#L1028: func (ip Addr) marshalBinarySize() int {
netip.go#L1043: func (ip Addr) MarshalBinary() ([]byte, error) {
netip.go#L1049: func (ip *Addr) UnmarshalBinary(b []byte) error {
netip.go#L1053: *ip = Addr{}
netip.go#L1070: ip Addr
netip.go#L1076: func AddrPortFrom(ip Addr, port uint16) AddrPort { return AddrPort{ip: ip, port: port} }
netip.go#L1079: func (p AddrPort) Addr() Addr { return p.ip }
netip.go#L1275: var addr Addr
netip.go#L1289: ip Addr
netip.go#L1304: func PrefixFrom(ip Addr, bits int) Prefix {
netip.go#L1316: func (p Prefix) Addr() Addr { return p.ip }
netip.go#L1428: func (p Prefix) Contains(ip Addr) bool {
netip.go#L1580: var addr Addr
net
addrselect.go#L21: func sortByRFC6724withSrcs(addrs []IPAddr, srcs []netip.Addr) {
addrselect.go#L44: func srcAddrs(addrs []IPAddr) []netip.Addr {
addrselect.go#L45: srcs := make([]netip.Addr, len(addrs))
addrselect.go#L67: func ipAttrOf(ip netip.Addr) ipAttr {
addrselect.go#L82: src netip.Addr
addrselect.go#L283: func (t policyTable) Classify(ip netip.Addr) policyTableEntry {
addrselect.go#L308: func classifyScope(ip netip.Addr) scope {
addrselect.go#L335: func commonPrefixLen(a netip.Addr, b IP) (cpl int) {
lookup.go#L257: func (r *Resolver) LookupNetIP(ctx context.Context, network, host string) ([]netip.Addr, error) {
lookup.go#L266: ret := make([]netip.Addr, 0, len(ips))
udpsock_posix.go#L73: var ip netip.Addr