Source file
src/net/netip/export_test.go
1
2
3
4
5 package netip
6
7 import "unique"
8
9 var (
10 Z0 = z0
11 Z4 = z4
12 Z6noz = z6noz
13 )
14
15 type Uint128 = uint128
16
17 type AddrDetail = addrDetail
18
19 func MakeAddrDetail(isV6 bool, zoneV6 string) AddrDetail {
20 return AddrDetail{isV6: isV6, zoneV6: zoneV6}
21 }
22
23 func Mk128(hi, lo uint64) Uint128 {
24 return uint128{hi, lo}
25 }
26
27 func MkAddr(u Uint128, z unique.Handle[AddrDetail]) Addr {
28 return Addr{u, z}
29 }
30
31 func IPv4(a, b, c, d uint8) Addr { return AddrFrom4([4]byte{a, b, c, d}) }
32
33 var TestAppendToMarshal = testAppendToMarshal
34
35 func (a Addr) IsZero() bool { return a.isZero() }
36 func (p Prefix) IsZero() bool { return p.isZero() }
37
38 func (p Prefix) Compare(p2 Prefix) int { return p.compare(p2) }
39
View as plain text