19 (void)net_addr.GetNetClass();
33 assert(net_addr.IsCJDNS());
36 assert(net_addr.IsInternal());
39 assert(!net_addr.IsRoutable());
41 (void)net_addr.IsBindAny();
42 if (net_addr.IsInternal()) {
45 if (net_addr.IsIPv4()) {
48 if (net_addr.IsIPv6()) {
51 (void)net_addr.IsLocal();
52 if (net_addr.IsRFC1918() || net_addr.IsRFC2544() || net_addr.IsRFC6598() || net_addr.IsRFC5737() || net_addr.IsRFC3927()) {
55 (void)net_addr.IsRFC2544();
56 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()) {
59 (void)net_addr.IsRFC3927();
60 (void)net_addr.IsRFC3964();
61 if (net_addr.IsRFC4193()) {
64 (void)net_addr.IsRFC4380();
65 (void)net_addr.IsRFC4843();
66 (void)net_addr.IsRFC4862();
67 (void)net_addr.IsRFC5737();
68 (void)net_addr.IsRFC6052();
69 (void)net_addr.IsRFC6145();
70 (void)net_addr.IsRFC6598();
71 (void)net_addr.IsRFC7343();
72 if (!net_addr.IsRoutable()) {
75 if (net_addr.IsTor()) {
78 if (net_addr.IsI2P()) {
81 if (net_addr.IsCJDNS()) {
84 (void)net_addr.IsValid();
85 (void)net_addr.ToStringAddr();
87 const CSubNet sub_net{net_addr, fuzzed_data_provider.ConsumeIntegral<uint8_t>()};
89 (void)sub_net.ToString();
91 const CService service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
93 (void)service.GetPort();
94 (void)service.ToStringAddrPort();
99 (void)net_addr.GetReachabilityFrom(other_net_addr);
100 (void)sub_net.Match(other_net_addr);
102 const CService other_service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
103 assert((service == other_service) != (service != other_service));
104 (void)(service < other_service);
106 const CSubNet sub_net_copy_1{net_addr, other_net_addr};
107 const CSubNet sub_net_copy_2{net_addr};
110 mutable_net_addr.
SetIP(net_addr);
111 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.
Addresses from these networks are not publicly routable on the global Internet.