Changeset View
Changeset View
Standalone View
Standalone View
src/netaddress.h
Show All 27 Lines | |||||
}; | }; | ||||
/** IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96)) */ | /** IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96)) */ | ||||
class CNetAddr { | class CNetAddr { | ||||
protected: | protected: | ||||
// in network byte order | // in network byte order | ||||
uint8_t ip[16]; | uint8_t ip[16]; | ||||
// for scoped/link-local ipv6 addresses | // for scoped/link-local ipv6 addresses | ||||
uint32_t scopeId; | uint32_t scopeId{0}; | ||||
public: | public: | ||||
CNetAddr(); | CNetAddr(); | ||||
explicit CNetAddr(const struct in_addr &ipv4Addr); | explicit CNetAddr(const struct in_addr &ipv4Addr); | ||||
void SetIP(const CNetAddr &ip); | void SetIP(const CNetAddr &ip); | ||||
private: | private: | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |