19 (void)net_addr.GetNetClass();
30 assert(net_addr.IsInternal());
33 assert(!net_addr.IsRoutable());
35 (void)net_addr.IsBindAny();
36 if (net_addr.IsInternal()) {
39 if (net_addr.IsIPv4()) {
42 if (net_addr.IsIPv6()) {
45 (void)net_addr.IsLocal();
46 if (net_addr.IsRFC1918() || net_addr.IsRFC2544() || net_addr.IsRFC6598() || net_addr.IsRFC5737() || net_addr.IsRFC3927()) {
49 (void)net_addr.IsRFC2544();
50 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()) {
53 (void)net_addr.IsRFC3927();
54 (void)net_addr.IsRFC3964();
55 if (net_addr.IsRFC4193()) {
58 (void)net_addr.IsRFC4380();
59 (void)net_addr.IsRFC4843();
60 (void)net_addr.IsRFC4862();
61 (void)net_addr.IsRFC5737();
62 (void)net_addr.IsRFC6052();
63 (void)net_addr.IsRFC6145();
64 (void)net_addr.IsRFC6598();
65 (void)net_addr.IsRFC7343();
66 if (!net_addr.IsRoutable()) {
69 if (net_addr.IsTor()) {
72 (void)net_addr.IsValid();
73 (void)net_addr.ToStringAddr();
75 const CSubNet sub_net{net_addr, fuzzed_data_provider.ConsumeIntegral<uint8_t>()};
77 (void)sub_net.ToString();
79 const CService service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
81 (void)service.GetPort();
82 (void)service.ToStringAddrPort();
87 (void)net_addr.GetReachabilityFrom(other_net_addr);
88 (void)sub_net.Match(other_net_addr);
90 const CService other_service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
91 assert((service == other_service) != (service != other_service));
92 (void)(service < other_service);
94 const CSubNet sub_net_copy_1{net_addr, other_net_addr};
95 const CSubNet sub_net_copy_2{net_addr};
98 mutable_net_addr.
SetIP(net_addr);
99 assert(net_addr == mutable_net_addr);
A set of addresses that represent the hash of a string or FQDN.
void SetIP(const CNetAddr &ip)
CNetAddr ConsumeNetAddr(FuzzedDataProvider &fuzzed_data_provider) noexcept
A combination of a network address (CNetAddr) and a (TCP) port.
std::vector< unsigned char > GetKey() const
Addresses from these networks are not publicly routable on the global Internet.