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 |
11 #include "webrtc/rtc_base/network.h" | 11 #include "webrtc/base/network.h" |
12 | 12 |
13 #if defined(WEBRTC_POSIX) | 13 #if defined(WEBRTC_POSIX) |
14 // linux/if.h can't be included at the same time as the posix sys/if.h, and | 14 // linux/if.h can't be included at the same time as the posix sys/if.h, and |
15 // it's transitively required by linux/route.h, so include that version on | 15 // it's transitively required by linux/route.h, so include that version on |
16 // linux instead of the standard posix one. | 16 // linux instead of the standard posix one. |
17 #if defined(WEBRTC_LINUX) | 17 #if defined(WEBRTC_LINUX) |
18 #include <linux/if.h> | 18 #include <linux/if.h> |
19 #include <linux/route.h> | 19 #include <linux/route.h> |
20 #elif !defined(__native_client__) | 20 #elif !defined(__native_client__) |
21 #include <net/if.h> | 21 #include <net/if.h> |
22 #endif | 22 #endif |
23 #endif // WEBRTC_POSIX | 23 #endif // WEBRTC_POSIX |
24 | 24 |
25 #if defined(WEBRTC_WIN) | 25 #if defined(WEBRTC_WIN) |
| 26 #include "webrtc/base/win32.h" |
26 #include <Iphlpapi.h> | 27 #include <Iphlpapi.h> |
27 #include "webrtc/rtc_base/win32.h" | |
28 #elif !defined(__native_client__) | 28 #elif !defined(__native_client__) |
29 #include "webrtc/rtc_base/ifaddrs_converter.h" | 29 #include "webrtc/base/ifaddrs_converter.h" |
30 #endif | 30 #endif |
31 | 31 |
32 #include <stdio.h> | 32 #include <stdio.h> |
33 | 33 |
34 #include <algorithm> | 34 #include <algorithm> |
35 #include <memory> | 35 #include <memory> |
36 | 36 |
37 #include "webrtc/rtc_base/checks.h" | 37 #include "webrtc/base/checks.h" |
38 #include "webrtc/rtc_base/logging.h" | 38 #include "webrtc/base/logging.h" |
39 #include "webrtc/rtc_base/networkmonitor.h" | 39 #include "webrtc/base/networkmonitor.h" |
40 #include "webrtc/rtc_base/socket.h" // includes something that makes windows ha
ppy | 40 #include "webrtc/base/socket.h" // includes something that makes windows happy |
41 #include "webrtc/rtc_base/stream.h" | 41 #include "webrtc/base/stream.h" |
42 #include "webrtc/rtc_base/stringencode.h" | 42 #include "webrtc/base/stringencode.h" |
43 #include "webrtc/rtc_base/thread.h" | 43 #include "webrtc/base/thread.h" |
44 | 44 |
45 namespace rtc { | 45 namespace rtc { |
46 namespace { | 46 namespace { |
47 | 47 |
48 // Turning on IPv6 could make many IPv6 interfaces available for connectivity | 48 // Turning on IPv6 could make many IPv6 interfaces available for connectivity |
49 // check and delay the call setup time. kMaxIPv6Networks is the default upper | 49 // check and delay the call setup time. kMaxIPv6Networks is the default upper |
50 // limit of IPv6 networks but could be changed by set_max_ipv6_networks(). | 50 // limit of IPv6 networks but could be changed by set_max_ipv6_networks(). |
51 const int kMaxIPv6Networks = 5; | 51 const int kMaxIPv6Networks = 5; |
52 | 52 |
53 const uint32_t kUpdateNetworksMessage = 1; | 53 const uint32_t kUpdateNetworksMessage = 1; |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 std::stringstream ss; | 983 std::stringstream ss; |
984 // Print out the first space-terminated token of the network desc, plus | 984 // Print out the first space-terminated token of the network desc, plus |
985 // the IP address. | 985 // the IP address. |
986 ss << "Net[" << description_.substr(0, description_.find(' ')) | 986 ss << "Net[" << description_.substr(0, description_.find(' ')) |
987 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ | 987 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ |
988 << ":" << AdapterTypeToString(type_) << "]"; | 988 << ":" << AdapterTypeToString(type_) << "]"; |
989 return ss.str(); | 989 return ss.str(); |
990 } | 990 } |
991 | 991 |
992 } // namespace rtc | 992 } // namespace rtc |
OLD | NEW |