Lines Matching refs:IPAddress
124 class IPAddress {
126 static bool forString(const std::string& repr, IPAddress* ip);
127 static IPAddress forString(const std::string& repr) { in forString()
128 IPAddress ip; in forString()
129 if (!forString(repr, &ip)) return IPAddress(); in forString()
133 IPAddress() = default;
134 IPAddress(const IPAddress&) = default;
135 IPAddress(IPAddress&&) = default;
137 explicit IPAddress(const in_addr& ipv4) in IPAddress() function
139 explicit IPAddress(const in6_addr& ipv6) in IPAddress() function
141 IPAddress(const in6_addr& ipv6, uint32_t scope_id) in IPAddress() function
148 IPAddress(const IPAddress& ip, uint32_t scope_id) : IPAddress(ip) { in IPAddress() function
152 IPAddress& operator=(const IPAddress&) = default;
153 IPAddress& operator=(IPAddress&&) = default;
160 friend std::ostream& operator<<(std::ostream& os, const IPAddress& ip) {
164 friend bool operator==(const IPAddress& a, const IPAddress& b) { return (a.mData == b.mData); }
165 friend bool operator!=(const IPAddress& a, const IPAddress& b) { return (a.mData != b.mData); }
166 friend bool operator<(const IPAddress& a, const IPAddress& b) { return (a.mData < b.mData); }
167 friend bool operator>(const IPAddress& a, const IPAddress& b) { return (b.mData < a.mData); }
168 friend bool operator<=(const IPAddress& a, const IPAddress& b) { return (a < b) || (a == b); }
169 friend bool operator>=(const IPAddress& a, const IPAddress& b) { return (b < a) || (a == b); }
175 explicit IPAddress(const internal_::compact_ipdata& ipdata) : mData(ipdata) { in IPAddress() function
209 explicit IPPrefix(const IPAddress& ip) : mData(ip.mData) {} in IPPrefix()
214 IPPrefix(const IPAddress& ip, int length);
220 IPAddress ip() const noexcept { return IPAddress(mData); } in ip()
251 return IPSockAddr(IPAddress::forString(repr), port); in toIPSockAddr()
271 explicit IPSockAddr(const IPAddress& ip) : mData(ip.mData) {} in IPSockAddr()
272 IPSockAddr(const IPAddress& ip, in_port_t port) : mData(ip.mData) { mData.port = port; } in IPSockAddr()
274 : IPSockAddr(IPAddress(ipv4sa.sin_addr), ntohs(ipv4sa.sin_port)) {} in IPSockAddr()
276 : IPSockAddr(IPAddress(ipv6sa.sin6_addr, ipv6sa.sin6_scope_id), ntohs(ipv6sa.sin6_port)) {} in IPSockAddr()
282 IPAddress ip() const noexcept { return IPAddress(mData); } in ip()