Bitcoin Core 28.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 479 of file netaddress.h.
CSubNet::CSubNet | ( | ) |
Construct an invalid subnet (empty, Match()
always returns false).
Definition at line 916 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 922 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 963 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 994 of file netaddress.cpp.
bool CSubNet::IsValid | ( | ) | const |
bool CSubNet::Match | ( | const CNetAddr & | addr | ) | const |
Definition at line 1021 of file netaddress.cpp.
std::string CSubNet::ToString | ( | ) | const |
Definition at line 1049 of file netaddress.cpp.
Definition at line 525 of file netaddress.h.
Definition at line 1092 of file netaddress.cpp.
Definition at line 1087 of file netaddress.cpp.
|
protected |
Netmask, in network byte order.
Definition at line 485 of file netaddress.h.
|
protected |
Network (base) address.
Definition at line 483 of file netaddress.h.
|
protected |
Is this value valid? (only used to signal parse errors)
Definition at line 487 of file netaddress.h.