![]() |
Bitcoin Core 30.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 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 480 of file netaddress.h.
| CSubNet::CSubNet | ( | ) |
Construct an invalid subnet (empty, Match() always returns false).
Definition at line 914 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 920 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 961 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 992 of file netaddress.cpp.
| bool CSubNet::IsValid | ( | ) | const |
| bool CSubNet::Match | ( | const CNetAddr & | addr | ) | const |
Definition at line 1019 of file netaddress.cpp.
| std::string CSubNet::ToString | ( | ) | const |
Definition at line 1047 of file netaddress.cpp.
Definition at line 526 of file netaddress.h.
Definition at line 1090 of file netaddress.cpp.
Definition at line 1085 of file netaddress.cpp.
|
protected |
Netmask, in network byte order.
Definition at line 486 of file netaddress.h.
|
protected |
Network (base) address.
Definition at line 484 of file netaddress.h.
|
protected |
Is this value valid? (only used to signal parse errors)
Definition at line 488 of file netaddress.h.