X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fwebrtc%2Fbase%2Fipaddress.cc;h=4f311d5a2938aee8efe771820b8a8958101bb3ee;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=4441e16f6bececa95cc09f33a93c633e348a3db5;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/webrtc/base/ipaddress.cc b/src/third_party/webrtc/base/ipaddress.cc index 4441e16..4f311d5 100644 --- a/src/third_party/webrtc/base/ipaddress.cc +++ b/src/third_party/webrtc/base/ipaddress.cc @@ -186,6 +186,30 @@ void IPAddress::set_strip_sensitive(bool enable) { strip_sensitive_ = enable; } +bool InterfaceAddress::operator==(const InterfaceAddress &other) const { + return ipv6_flags_ == other.ipv6_flags() && + static_cast(*this) == other; +} + +bool InterfaceAddress::operator!=(const InterfaceAddress &other) const { + return !((*this) == other); +} + +const InterfaceAddress& InterfaceAddress::operator=( + const InterfaceAddress& other) { + ipv6_flags_ = other.ipv6_flags_; + static_cast(*this) = other; + return *this; +} + +std::ostream& operator<<(std::ostream& os, const InterfaceAddress& ip) { + os << static_cast(ip); + + if (ip.family() == AF_INET6) + os << "|flags:0x" << std::hex << ip.ipv6_flags(); + + return os; +} bool IsPrivateV4(uint32 ip_in_host_order) { return ((ip_in_host_order >> 24) == 127) || @@ -235,6 +259,17 @@ bool IPFromString(const std::string& str, IPAddress* out) { return true; } +bool IPFromString(const std::string& str, int flags, + InterfaceAddress* out) { + IPAddress ip; + if (!IPFromString(str, &ip)) { + return false; + } + + *out = InterfaceAddress(ip, flags); + return true; +} + bool IPIsAny(const IPAddress& ip) { switch (ip.family()) { case AF_INET: