1// Copyright 2021 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package netip
6
7import "unique"
8
9var (
10	Z0    = z0
11	Z4    = z4
12	Z6noz = z6noz
13)
14
15type Uint128 = uint128
16
17type AddrDetail = addrDetail
18
19func MakeAddrDetail(isV6 bool, zoneV6 string) AddrDetail {
20	return AddrDetail{isV6: isV6, zoneV6: zoneV6}
21}
22
23func Mk128(hi, lo uint64) Uint128 {
24	return uint128{hi, lo}
25}
26
27func MkAddr(u Uint128, z unique.Handle[AddrDetail]) Addr {
28	return Addr{u, z}
29}
30
31func IPv4(a, b, c, d uint8) Addr { return AddrFrom4([4]byte{a, b, c, d}) }
32
33var TestAppendToMarshal = testAppendToMarshal
34
35func (a Addr) IsZero() bool   { return a.isZero() }
36func (p Prefix) IsZero() bool { return p.isZero() }
37
38func (p Prefix) Compare(p2 Prefix) int { return p.compare(p2) }
39