![]() |
Bitcoin Core 22.99.0
P2P Digital Currency
|
#include <netaddress.h>
Public Member Functions | |
| CSubNet () | |
Construct an invalid subnet (empty, Match() always returns false). More... | |
| CSubNet (const CNetAddr &addr, uint8_t mask) | |
| Construct from a given network start and number of bits (CIDR mask). More... | |
| CSubNet (const CNetAddr &addr, const CNetAddr &mask) | |
| Construct from a given network start and mask. More... | |
| CSubNet (const CNetAddr &addr) | |
| Construct a single-host subnet. More... | |
| bool | Match (const CNetAddr &addr) const |
| std::string | ToString () const |
| bool | IsValid () const |
Protected Member Functions | |
| bool | SanityCheck () const |
Protected Attributes | |
| CNetAddr | network |
| Network (base) address. More... | |
| uint8_t | netmask [16] |
| Netmask, in network byte order. More... | |
| bool | valid |
| Is this value valid? (only used to signal parse errors) More... | |
Friends | |
| bool | operator== (const CSubNet &a, const CSubNet &b) |
| bool | operator!= (const CSubNet &a, const CSubNet &b) |
| bool | operator< (const CSubNet &a, const CSubNet &b) |
Definition at line 469 of file netaddress.h.
| CSubNet::CSubNet | ( | ) |
Construct an invalid subnet (empty, Match() always returns false).
Definition at line 1053 of file netaddress.cpp.
| CSubNet::CSubNet | ( | const CNetAddr & | addr, |
| uint8_t | mask | ||
| ) |
Construct from a given network start and number of bits (CIDR mask).
| [in] | addr | Network start. Must be IPv4 or IPv6, otherwise an invalid subnet is created. |
| [in] | mask | CIDR mask, must be in [0, 32] for IPv4 addresses and in [0, 128] for IPv6 addresses. Otherwise an invalid subnet is created. |
Definition at line 1059 of file netaddress.cpp.
Construct from a given network start and mask.
| [in] | addr | Network start. Must be IPv4 or IPv6, otherwise an invalid subnet is created. |
| [in] | mask | Network mask, must be of the same type as addr and not contain 0-bits followed by 1-bits. Otherwise an invalid subnet is created. |
Definition at line 1100 of file netaddress.cpp.
|
explicit |
Construct a single-host subnet.
| [in] | addr | The sole address to be contained in the subnet, can also be non-IPv[46]. |
Definition at line 1131 of file netaddress.cpp.
| bool CSubNet::IsValid | ( | ) | const |
| bool CSubNet::Match | ( | const CNetAddr & | addr | ) | const |
Definition at line 1158 of file netaddress.cpp.
|
protected |
Definition at line 1224 of file netaddress.cpp.
| std::string CSubNet::ToString | ( | ) | const |
Definition at line 1186 of file netaddress.cpp.
Definition at line 517 of file netaddress.h.
Definition at line 1252 of file netaddress.cpp.
Definition at line 1247 of file netaddress.cpp.
|
protected |
Netmask, in network byte order.
Definition at line 475 of file netaddress.h.
|
protected |
Network (base) address.
Definition at line 473 of file netaddress.h.
|
protected |
Is this value valid? (only used to signal parse errors)
Definition at line 477 of file netaddress.h.