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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Wi-Fi network. If a network type is "unknown", it has a cost lower than | 70 // Wi-Fi network. If a network type is "unknown", it has a cost lower than |
71 // cellular but higher than Wi-Fi/Ethernet. So if an unknown network exists, | 71 // cellular but higher than Wi-Fi/Ethernet. So if an unknown network exists, |
72 // cellular networks will not be used to gather candidates and if a Wi-Fi | 72 // cellular networks will not be used to gather candidates and if a Wi-Fi |
73 // network is present, "unknown" networks will not be usd to gather | 73 // network is present, "unknown" networks will not be usd to gather |
74 // candidates. Doing so ensures that even if a cellular network type was not | 74 // candidates. Doing so ensures that even if a cellular network type was not |
75 // detected initially, it would not be used if a Wi-Fi network is present. | 75 // detected initially, it would not be used if a Wi-Fi network is present. |
76 PORTALLOCATOR_DISABLE_COSTLY_NETWORKS = 0x2000, | 76 PORTALLOCATOR_DISABLE_COSTLY_NETWORKS = 0x2000, |
77 | 77 |
78 // When specified, do not collect IPv6 ICE candidates on Wi-Fi. | 78 // When specified, do not collect IPv6 ICE candidates on Wi-Fi. |
79 PORTALLOCATOR_ENABLE_IPV6_ON_WIFI = 0x4000, | 79 PORTALLOCATOR_ENABLE_IPV6_ON_WIFI = 0x4000, |
| 80 |
| 81 // When this flag is set, ports not bound to any specific network interface |
| 82 // will be used, in addition to normal ports bound to the enumerated |
| 83 // interfaces. Without this flag, these "any address" ports would only be |
| 84 // used when network enumeration fails or is disabled. But under certain |
| 85 // conditions, these ports may succeed where others fail, so they may allow |
| 86 // the application to work in a wider variety of environments, at the expense |
| 87 // of having to allocate additional candidates. |
| 88 PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS = 0x8000, |
80 }; | 89 }; |
81 | 90 |
82 // Defines various reasons that have caused ICE regathering. | 91 // Defines various reasons that have caused ICE regathering. |
83 enum class IceRegatheringReason { NETWORK_CHANGE, NETWORK_FAILURE, MAX_VALUE }; | 92 enum class IceRegatheringReason { NETWORK_CHANGE, NETWORK_FAILURE, MAX_VALUE }; |
84 | 93 |
85 const uint32_t kDefaultPortAllocatorFlags = 0; | 94 const uint32_t kDefaultPortAllocatorFlags = 0; |
86 | 95 |
87 const uint32_t kDefaultStepDelay = 1000; // 1 sec step delay. | 96 const uint32_t kDefaultStepDelay = 1000; // 1 sec step delay. |
88 // As per RFC 5245 Appendix B.1, STUN transactions need to be paced at certain | 97 // As per RFC 5245 Appendix B.1, STUN transactions need to be paced at certain |
89 // internal. Less than 20ms is not acceptable. We choose 50ms as our default. | 98 // internal. Less than 20ms is not acceptable. We choose 50ms as our default. |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; | 471 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; |
463 bool candidate_pool_frozen_ = false; | 472 bool candidate_pool_frozen_ = false; |
464 bool prune_turn_ports_ = false; | 473 bool prune_turn_ports_ = false; |
465 | 474 |
466 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; | 475 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; |
467 }; | 476 }; |
468 | 477 |
469 } // namespace cricket | 478 } // namespace cricket |
470 | 479 |
471 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ | 480 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ |
OLD | NEW |