Changeset View
Changeset View
Standalone View
Standalone View
src/netaddress.h
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
private: | private: | ||||
/** | /** | ||||
* Set raw IPv4 or IPv6 address (in network byte order) | * Set raw IPv4 or IPv6 address (in network byte order) | ||||
* @note Only NET_IPV4 and NET_IPV6 are allowed for network. | * @note Only NET_IPV4 and NET_IPV6 are allowed for network. | ||||
*/ | */ | ||||
void SetRaw(Network network, const uint8_t *data); | void SetRaw(Network network, const uint8_t *data); | ||||
public: | public: | ||||
/** | |||||
* Transform an arbitrary string into a non-routable ipv6 address. | |||||
* Useful for mapping resolved addresses back to their source. | |||||
*/ | |||||
bool SetInternal(const std::string &name); | bool SetInternal(const std::string &name); | ||||
// for Tor addresses | // for Tor addresses | ||||
bool SetSpecial(const std::string &strName); | bool SetSpecial(const std::string &strName); | ||||
// INADDR_ANY equivalent | // INADDR_ANY equivalent | ||||
bool IsBindAny() const; | bool IsBindAny() const; | ||||
// IPv4 mapped address (::FFFF:0:0/96, 0.0.0.0/0) | // IPv4 mapped address (::FFFF:0:0/96, 0.0.0.0/0) | ||||
bool IsIPv4() const; | bool IsIPv4() const; | ||||
Show All 19 Lines | public: | ||||
// IPv6 Teredo tunnelling (2001::/32) | // IPv6 Teredo tunnelling (2001::/32) | ||||
bool IsRFC4380() const; | bool IsRFC4380() const; | ||||
// IPv6 ORCHID (deprecated) (2001:10::/28) | // IPv6 ORCHID (deprecated) (2001:10::/28) | ||||
bool IsRFC4843() const; | bool IsRFC4843() const; | ||||
// IPv6 ORCHIDv2 (2001:20::/28) | // IPv6 ORCHIDv2 (2001:20::/28) | ||||
bool IsRFC7343() const; | bool IsRFC7343() const; | ||||
// IPv6 autoconfig (FE80::/64) | // IPv6 autoconfig (FE80::/64) | ||||
bool IsRFC4862() const; | bool IsRFC4862() const; | ||||
// IPv6 well-known prefix (64:FF9B::/96) | // IPv6 well-known prefix for IPv4-embedded address (64:FF9B::/96) | ||||
bool IsRFC6052() const; | bool IsRFC6052() const; | ||||
// IPv6 IPv4-translated address (::FFFF:0:0:0/96) | // IPv6 IPv4-translated address (::FFFF:0:0:0/96) (actually defined in | ||||
// RFC2765) | |||||
bool IsRFC6145() const; | bool IsRFC6145() const; | ||||
bool IsTor() const; | bool IsTor() const; | ||||
bool IsLocal() const; | bool IsLocal() const; | ||||
bool IsRoutable() const; | bool IsRoutable() const; | ||||
bool IsInternal() const; | bool IsInternal() const; | ||||
bool IsValid() const; | bool IsValid() const; | ||||
enum Network GetNetwork() const; | enum Network GetNetwork() const; | ||||
std::string ToString() const; | std::string ToString() const; | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |