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