OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #if defined(WEBRTC_POSIX) | 25 #if defined(WEBRTC_POSIX) |
26 struct ifaddrs; | 26 struct ifaddrs; |
27 #endif // defined(WEBRTC_POSIX) | 27 #endif // defined(WEBRTC_POSIX) |
28 | 28 |
29 namespace rtc { | 29 namespace rtc { |
30 | 30 |
31 extern const char kPublicIPv4Host[]; | 31 extern const char kPublicIPv4Host[]; |
32 extern const char kPublicIPv6Host[]; | 32 extern const char kPublicIPv6Host[]; |
33 | 33 |
| 34 class IfAddrsConverter; |
34 class Network; | 35 class Network; |
35 class NetworkMonitorInterface; | 36 class NetworkMonitorInterface; |
36 class Thread; | 37 class Thread; |
37 | 38 |
38 enum AdapterType { | 39 enum AdapterType { |
39 // This enum resembles the one in Chromium net::ConnectionType. | 40 // This enum resembles the one in Chromium net::ConnectionType. |
40 ADAPTER_TYPE_UNKNOWN = 0, | 41 ADAPTER_TYPE_UNKNOWN = 0, |
41 ADAPTER_TYPE_ETHERNET = 1 << 0, | 42 ADAPTER_TYPE_ETHERNET = 1 << 0, |
42 ADAPTER_TYPE_WIFI = 1 << 1, | 43 ADAPTER_TYPE_WIFI = 1 << 1, |
43 ADAPTER_TYPE_CELLULAR = 1 << 2, | 44 ADAPTER_TYPE_CELLULAR = 1 << 2, |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 // Sets the flag for ignoring non-default routes. | 223 // Sets the flag for ignoring non-default routes. |
223 void set_ignore_non_default_routes(bool value) { | 224 void set_ignore_non_default_routes(bool value) { |
224 ignore_non_default_routes_ = true; | 225 ignore_non_default_routes_ = true; |
225 } | 226 } |
226 #endif | 227 #endif |
227 | 228 |
228 protected: | 229 protected: |
229 #if defined(WEBRTC_POSIX) | 230 #if defined(WEBRTC_POSIX) |
230 // Separated from CreateNetworks for tests. | 231 // Separated from CreateNetworks for tests. |
231 void ConvertIfAddrs(ifaddrs* interfaces, | 232 void ConvertIfAddrs(ifaddrs* interfaces, |
| 233 IfAddrsConverter* converter, |
232 bool include_ignored, | 234 bool include_ignored, |
233 NetworkList* networks) const; | 235 NetworkList* networks) const; |
234 #endif // defined(WEBRTC_POSIX) | 236 #endif // defined(WEBRTC_POSIX) |
235 | 237 |
236 // Creates a network object for each network available on the machine. | 238 // Creates a network object for each network available on the machine. |
237 bool CreateNetworks(bool include_ignored, NetworkList* networks) const; | 239 bool CreateNetworks(bool include_ignored, NetworkList* networks) const; |
238 | 240 |
239 // Determines if a network should be ignored. This should only be determined | 241 // Determines if a network should be ignored. This should only be determined |
240 // based on the network's property instead of any individual IP. | 242 // based on the network's property instead of any individual IP. |
241 bool IsIgnoredNetwork(const Network& network) const; | 243 bool IsIgnoredNetwork(const Network& network) const; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 AdapterType type_; | 381 AdapterType type_; |
380 int preference_; | 382 int preference_; |
381 bool active_ = true; | 383 bool active_ = true; |
382 | 384 |
383 friend class NetworkManager; | 385 friend class NetworkManager; |
384 }; | 386 }; |
385 | 387 |
386 } // namespace rtc | 388 } // namespace rtc |
387 | 389 |
388 #endif // WEBRTC_BASE_NETWORK_H_ | 390 #endif // WEBRTC_BASE_NETWORK_H_ |
OLD | NEW |