Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: webrtc/base/ipaddress.h

Issue 1274013002: Bug 4865: Enable connectivity when the remote peer is on public internet. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/base/ipaddress.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // Returns the same address if this isn't a mapped address. 102 // Returns the same address if this isn't a mapped address.
103 IPAddress Normalized() const; 103 IPAddress Normalized() const;
104 104
105 // Returns this address as an IPv6 address. 105 // Returns this address as an IPv6 address.
106 // Maps v4 addresses (as ::ffff:a.b.c.d), returns v6 addresses unchanged. 106 // Maps v4 addresses (as ::ffff:a.b.c.d), returns v6 addresses unchanged.
107 IPAddress AsIPv6Address() const; 107 IPAddress AsIPv6Address() const;
108 108
109 // For socketaddress' benefit. Returns the IP in host byte order. 109 // For socketaddress' benefit. Returns the IP in host byte order.
110 uint32 v4AddressAsHostOrderInteger() const; 110 uint32 v4AddressAsHostOrderInteger() const;
111 111
112 // Whether this is an unspecified IP address.
113 bool IsNil() const;
114
112 static void set_strip_sensitive(bool enable); 115 static void set_strip_sensitive(bool enable);
113 116
114 private: 117 private:
115 int family_; 118 int family_;
116 union { 119 union {
117 in_addr ip4; 120 in_addr ip4;
118 in6_addr ip6; 121 in6_addr ip6;
119 } u_; 122 } u_;
120 123
121 static bool strip_sensitive_; 124 static bool strip_sensitive_;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 IPAddress TruncateIP(const IPAddress& ip, int length); 180 IPAddress TruncateIP(const IPAddress& ip, int length);
178 181
179 // Returns the number of contiguously set bits, counting from the MSB in network 182 // Returns the number of contiguously set bits, counting from the MSB in network
180 // byte order, in this IPAddress. Bits after the first 0 encountered are not 183 // byte order, in this IPAddress. Bits after the first 0 encountered are not
181 // counted. 184 // counted.
182 int CountIPMaskBits(IPAddress mask); 185 int CountIPMaskBits(IPAddress mask);
183 186
184 } // namespace rtc 187 } // namespace rtc
185 188
186 #endif // WEBRTC_BASE_IPADDRESS_H_ 189 #endif // WEBRTC_BASE_IPADDRESS_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/ipaddress.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698