21 (void)net_addr.GetNetClass();
35 assert(net_addr.IsCJDNS());
38 assert(net_addr.IsInternal());
41 assert(!net_addr.IsRoutable());
43 (void)net_addr.IsBindAny();
44 if (net_addr.IsInternal()) {
47 if (net_addr.IsIPv4()) {
50 if (net_addr.IsIPv6()) {
53 (void)net_addr.IsLocal();
54 if (net_addr.IsRFC1918() || net_addr.IsRFC2544() || net_addr.IsRFC6598() || net_addr.IsRFC5737() || net_addr.IsRFC3927()) {
57 (void)net_addr.IsRFC2544();
58 if (net_addr.IsRFC3849() || net_addr.IsRFC3964() || net_addr.IsRFC4380() || net_addr.IsRFC4843() || net_addr.IsRFC7343() || net_addr.IsRFC4862() || net_addr.IsRFC6052() || net_addr.IsRFC6145()) {
61 (void)net_addr.IsRFC3927();
62 (void)net_addr.IsRFC3964();
63 if (net_addr.IsRFC4193()) {
66 (void)net_addr.IsRFC4380();
67 (void)net_addr.IsRFC4843();
68 (void)net_addr.IsRFC4862();
69 (void)net_addr.IsRFC5737();
70 (void)net_addr.IsRFC6052();
71 (void)net_addr.IsRFC6145();
72 (void)net_addr.IsRFC6598();
73 (void)net_addr.IsRFC7343();
74 if (!net_addr.IsRoutable()) {
77 if (net_addr.IsTor()) {
80 if (net_addr.IsI2P()) {
83 if (net_addr.IsCJDNS()) {
86 (void)net_addr.IsValid();
87 (void)net_addr.ToStringAddr();
89 const CSubNet sub_net{net_addr, fuzzed_data_provider.ConsumeIntegral<uint8_t>()};
91 (void)sub_net.ToString();
93 const CService service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
95 (void)service.GetPort();
96 (void)service.ToStringAddrPort();
101 (void)net_addr.GetReachabilityFrom(other_net_addr);
102 (void)sub_net.Match(other_net_addr);
104 const CService other_service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
105 assert((service == other_service) != (service != other_service));
106 (void)(service < other_service);
108 const CSubNet sub_net_copy_1{net_addr, other_net_addr};
109 const CSubNet sub_net_copy_2{net_addr};
112 mutable_net_addr.
SetIP(net_addr);
113 assert(net_addr == mutable_net_addr);
A set of addresses that represent the hash of a string or FQDN.
void SetIP(const CNetAddr &ip)
A combination of a network address (CNetAddr) and a (TCP) port.
std::vector< unsigned char > GetKey() const
CNetAddr ConsumeNetAddr(FuzzedDataProvider &fuzzed_data_provider, FastRandomContext *rand) noexcept
Create a CNetAddr.
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
Seed with a compile time constant of zeros.
Addresses from these networks are not publicly routable on the global Internet.