zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 11 | #ifndef P2P_BASE_ICE_TRANSPORT_INTERNAL_H_ |
| 12 | #define P2P_BASE_ICE_TRANSPORT_INTERNAL_H_ |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 13 | |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 14 | #include <stdint.h> |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 15 | |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 16 | #include <string> |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 17 | #include <vector> |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 18 | |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 19 | #include "absl/types/optional.h" |
Patrik Höglund | e2d6a06 | 2017-10-05 14:53:33 +0200 | [diff] [blame] | 20 | #include "api/candidate.h" |
Jonas Olsson | 81125f0 | 2018-10-09 10:52:04 +0200 | [diff] [blame] | 21 | #include "api/transport/enums.h" |
Jonas Oreland | e8e7d7b | 2019-05-29 09:30:55 +0200 | [diff] [blame] | 22 | #include "p2p/base/connection.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 23 | #include "p2p/base/packet_transport_internal.h" |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 24 | #include "p2p/base/port.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 25 | #include "p2p/base/transport_description.h" |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 26 | #include "rtc_base/network_constants.h" |
Mirko Bonadei | ac19414 | 2018-10-22 17:08:37 +0200 | [diff] [blame] | 27 | #include "rtc_base/system/rtc_export.h" |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 28 | #include "rtc_base/third_party/sigslot/sigslot.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 29 | #include "rtc_base/time_utils.h" |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 30 | |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 31 | namespace cricket { |
| 32 | |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 33 | typedef std::vector<Candidate> Candidates; |
| 34 | |
Alex Loiko | 9289eda | 2018-11-23 16:18:59 +0000 | [diff] [blame] | 35 | enum IceConnectionState { |
| 36 | kIceConnectionConnecting = 0, |
| 37 | kIceConnectionFailed, |
| 38 | kIceConnectionConnected, // Writable, but still checking one or more |
| 39 | // connections |
| 40 | kIceConnectionCompleted, |
| 41 | }; |
| 42 | |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 43 | // TODO(deadbeef): Unify with PeerConnectionInterface::IceConnectionState |
| 44 | // once /talk/ and /webrtc/ are combined, and also switch to ENUM_NAME naming |
| 45 | // style. |
| 46 | enum IceGatheringState { |
| 47 | kIceGatheringNew = 0, |
| 48 | kIceGatheringGathering, |
| 49 | kIceGatheringComplete, |
| 50 | }; |
| 51 | |
| 52 | enum ContinualGatheringPolicy { |
| 53 | // All port allocator sessions will stop after a writable connection is found. |
| 54 | GATHER_ONCE = 0, |
| 55 | // The most recent port allocator session will keep on running. |
| 56 | GATHER_CONTINUALLY, |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | // ICE Nomination mode. |
| 60 | enum class NominationMode { |
| 61 | REGULAR, // Nominate once per ICE restart (Not implemented yet). |
| 62 | AGGRESSIVE, // Nominate every connection except that it will behave as if |
| 63 | // REGULAR when the remote is an ICE-LITE endpoint. |
| 64 | SEMI_AGGRESSIVE // Our current implementation of the nomination algorithm. |
| 65 | // The details are described in P2PTransportChannel. |
| 66 | }; |
| 67 | |
| 68 | // Information about ICE configuration. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 69 | // TODO(deadbeef): Use absl::optional to represent unset values, instead of |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 70 | // -1. |
| 71 | struct IceConfig { |
| 72 | // The ICE connection receiving timeout value in milliseconds. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 73 | absl::optional<int> receiving_timeout; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 74 | // Time interval in milliseconds to ping a backup connection when the ICE |
| 75 | // channel is strongly connected. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 76 | absl::optional<int> backup_connection_ping_interval; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 77 | |
| 78 | ContinualGatheringPolicy continual_gathering_policy = GATHER_ONCE; |
| 79 | |
| 80 | bool gather_continually() const { |
Qingsi Wang | 241d0c1 | 2018-06-05 16:44:10 -0700 | [diff] [blame] | 81 | return continual_gathering_policy == GATHER_CONTINUALLY; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | // Whether we should prioritize Relay/Relay candidate when nothing |
| 85 | // is writable yet. |
| 86 | bool prioritize_most_likely_candidate_pairs = false; |
| 87 | |
| 88 | // Writable connections are pinged at a slower rate once stablized. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 89 | absl::optional<int> stable_writable_connection_ping_interval; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 90 | |
| 91 | // If set to true, this means the ICE transport should presume TURN-to-TURN |
| 92 | // candidate pairs will succeed, even before a binding response is received. |
| 93 | bool presume_writable_when_fully_relayed = false; |
| 94 | |
Qingsi Wang | 1fe119f | 2019-05-31 16:55:33 -0700 | [diff] [blame] | 95 | // If true, after the ICE transport type (as the candidate filter used by the |
| 96 | // port allocator) is changed such that new types of ICE candidates are |
| 97 | // allowed by the new filter, e.g. from CF_RELAY to CF_ALL, candidates that |
| 98 | // have been gathered by the ICE transport but filtered out and not signaled |
| 99 | // to the upper layers, will be surfaced. |
| 100 | bool surface_ice_candidates_on_ice_transport_type_changed = false; |
| 101 | |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 102 | // Interval to check on all networks and to perform ICE regathering on any |
| 103 | // active network having no connection on it. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 104 | absl::optional<int> regather_on_failed_networks_interval; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 105 | |
| 106 | // Interval to perform ICE regathering on all networks |
| 107 | // The delay in milliseconds is sampled from the uniform distribution [a, b] |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 108 | absl::optional<rtc::IntervalRange> regather_all_networks_interval_range; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 109 | |
| 110 | // The time period in which we will not switch the selected connection |
| 111 | // when a new connection becomes receiving but the selected connection is not |
| 112 | // in case that the selected connection may become receiving soon. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 113 | absl::optional<int> receiving_switching_delay; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 114 | |
| 115 | // TODO(honghaiz): Change the default to regular nomination. |
| 116 | // Default nomination mode if the remote does not support renomination. |
| 117 | NominationMode default_nomination_mode = NominationMode::SEMI_AGGRESSIVE; |
| 118 | |
Qingsi Wang | e6826d2 | 2018-03-08 14:55:14 -0800 | [diff] [blame] | 119 | // The interval in milliseconds at which ICE checks (STUN pings) will be sent |
| 120 | // for a candidate pair when it is both writable and receiving (strong |
| 121 | // connectivity). This parameter overrides the default value given by |
| 122 | // |STRONG_PING_INTERVAL| in p2ptransport.h if set. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 123 | absl::optional<int> ice_check_interval_strong_connectivity; |
Qingsi Wang | e6826d2 | 2018-03-08 14:55:14 -0800 | [diff] [blame] | 124 | // The interval in milliseconds at which ICE checks (STUN pings) will be sent |
| 125 | // for a candidate pair when it is either not writable or not receiving (weak |
| 126 | // connectivity). This parameter overrides the default value given by |
| 127 | // |WEAK_PING_INTERVAL| in p2ptransport.h if set. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 128 | absl::optional<int> ice_check_interval_weak_connectivity; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 129 | // ICE checks (STUN pings) will not be sent at higher rate (lower interval) |
| 130 | // than this, no matter what other settings there are. |
| 131 | // Measure in milliseconds. |
Qingsi Wang | e6826d2 | 2018-03-08 14:55:14 -0800 | [diff] [blame] | 132 | // |
| 133 | // Note that this parameter overrides both the above check intervals for |
| 134 | // candidate pairs with strong or weak connectivity, if either of the above |
| 135 | // interval is shorter than the min interval. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 136 | absl::optional<int> ice_check_min_interval; |
Qingsi Wang | 22e623a | 2018-03-13 10:53:57 -0700 | [diff] [blame] | 137 | // The min time period for which a candidate pair must wait for response to |
| 138 | // connectivity checks before it becomes unwritable. This parameter |
| 139 | // overrides the default value given by |CONNECTION_WRITE_CONNECT_TIMEOUT| |
| 140 | // in port.h if set, when determining the writability of a candidate pair. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 141 | absl::optional<int> ice_unwritable_timeout; |
Qingsi Wang | 22e623a | 2018-03-13 10:53:57 -0700 | [diff] [blame] | 142 | |
| 143 | // The min number of connectivity checks that a candidate pair must sent |
| 144 | // without receiving response before it becomes unwritable. This parameter |
| 145 | // overrides the default value given by |CONNECTION_WRITE_CONNECT_FAILURES| in |
| 146 | // port.h if set, when determining the writability of a candidate pair. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 147 | absl::optional<int> ice_unwritable_min_checks; |
Jiawei Ou | 9d4fd555 | 2018-12-06 23:30:17 -0800 | [diff] [blame] | 148 | |
| 149 | // The min time period for which a candidate pair must wait for response to |
| 150 | // connectivity checks it becomes inactive. This parameter overrides the |
| 151 | // default value given by |CONNECTION_WRITE_TIMEOUT| in port.h if set, when |
| 152 | // determining the writability of a candidate pair. |
| 153 | absl::optional<int> ice_inactive_timeout; |
| 154 | |
Qingsi Wang | db53f8e | 2018-02-20 14:45:49 -0800 | [diff] [blame] | 155 | // The interval in milliseconds at which STUN candidates will resend STUN |
| 156 | // binding requests to keep NAT bindings open. |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 157 | absl::optional<int> stun_keepalive_interval; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 158 | |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 159 | absl::optional<rtc::AdapterType> network_preference; |
Qingsi Wang | 9a5c6f8 | 2018-02-01 10:38:40 -0800 | [diff] [blame] | 160 | |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 161 | IceConfig(); |
| 162 | IceConfig(int receiving_timeout_ms, |
| 163 | int backup_connection_ping_interval, |
| 164 | ContinualGatheringPolicy gathering_policy, |
| 165 | bool prioritize_most_likely_candidate_pairs, |
| 166 | int stable_writable_connection_ping_interval_ms, |
| 167 | bool presume_writable_when_fully_relayed, |
| 168 | int regather_on_failed_networks_interval_ms, |
Qingsi Wang | 866e08d | 2018-03-22 17:54:23 -0700 | [diff] [blame] | 169 | int receiving_switching_delay_ms); |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 170 | ~IceConfig(); |
Qingsi Wang | 866e08d | 2018-03-22 17:54:23 -0700 | [diff] [blame] | 171 | |
| 172 | // Helper getters for parameters with implementation-specific default value. |
| 173 | // By convention, parameters with default value are represented by |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 174 | // absl::optional and setting a parameter to null restores its default value. |
Qingsi Wang | 866e08d | 2018-03-22 17:54:23 -0700 | [diff] [blame] | 175 | int receiving_timeout_or_default() const; |
| 176 | int backup_connection_ping_interval_or_default() const; |
| 177 | int stable_writable_connection_ping_interval_or_default() const; |
| 178 | int regather_on_failed_networks_interval_or_default() const; |
| 179 | int receiving_switching_delay_or_default() const; |
| 180 | int ice_check_interval_strong_connectivity_or_default() const; |
| 181 | int ice_check_interval_weak_connectivity_or_default() const; |
| 182 | int ice_check_min_interval_or_default() const; |
| 183 | int ice_unwritable_timeout_or_default() const; |
| 184 | int ice_unwritable_min_checks_or_default() const; |
Jiawei Ou | 9d4fd555 | 2018-12-06 23:30:17 -0800 | [diff] [blame] | 185 | int ice_inactive_timeout_or_default() const; |
Qingsi Wang | 866e08d | 2018-03-22 17:54:23 -0700 | [diff] [blame] | 186 | int stun_keepalive_interval_or_default() const; |
Taylor Brandstetter | 6e2e7ce | 2017-12-19 10:26:23 -0800 | [diff] [blame] | 187 | }; |
| 188 | |
zhihuang | b2cdd93 | 2017-01-19 16:54:25 -0800 | [diff] [blame] | 189 | // TODO(zhihuang): Replace this with |
| 190 | // PeerConnectionInterface::IceConnectionState. |
zhihuang | d06adf6 | 2017-01-12 15:58:31 -0800 | [diff] [blame] | 191 | enum class IceTransportState { |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 192 | STATE_INIT, |
| 193 | STATE_CONNECTING, // Will enter this state once a connection is created |
| 194 | STATE_COMPLETED, |
zhihuang | d06adf6 | 2017-01-12 15:58:31 -0800 | [diff] [blame] | 195 | STATE_FAILED |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 196 | }; |
| 197 | |
| 198 | // TODO(zhihuang): Remove this once it's no longer used in |
| 199 | // remoting/protocol/libjingle_transport_factory.cc |
| 200 | enum IceProtocolType { |
| 201 | ICEPROTO_RFC5245 // Standard RFC 5245 version of ICE. |
| 202 | }; |
| 203 | |
| 204 | // IceTransportInternal is an internal abstract class that does ICE. |
| 205 | // Once the public interface is supported, |
Niels Möller | c6ec4b1 | 2018-10-24 14:10:53 +0200 | [diff] [blame] | 206 | // (https://www.w3.org/TR/webrtc/#rtcicetransport) |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 207 | // the IceTransportInterface will be split from this class. |
Mirko Bonadei | ac19414 | 2018-10-22 17:08:37 +0200 | [diff] [blame] | 208 | class RTC_EXPORT IceTransportInternal : public rtc::PacketTransportInternal { |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 209 | public: |
Steve Anton | 33f69db | 2017-10-30 10:01:15 -0700 | [diff] [blame] | 210 | IceTransportInternal(); |
| 211 | ~IceTransportInternal() override; |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 212 | |
Jonas Olsson | 81125f0 | 2018-10-09 10:52:04 +0200 | [diff] [blame] | 213 | // TODO(bugs.webrtc.org/9308): Remove GetState once all uses have been |
| 214 | // migrated to GetIceTransportState. |
zhihuang | d06adf6 | 2017-01-12 15:58:31 -0800 | [diff] [blame] | 215 | virtual IceTransportState GetState() const = 0; |
Jonas Olsson | 81125f0 | 2018-10-09 10:52:04 +0200 | [diff] [blame] | 216 | virtual webrtc::IceTransportState GetIceTransportState() const = 0; |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 217 | |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 218 | virtual int component() const = 0; |
| 219 | |
| 220 | virtual IceRole GetIceRole() const = 0; |
| 221 | |
| 222 | virtual void SetIceRole(IceRole role) = 0; |
| 223 | |
| 224 | virtual void SetIceTiebreaker(uint64_t tiebreaker) = 0; |
| 225 | |
| 226 | // TODO(zhihuang): Remove this once it's no longer called in |
| 227 | // remoting/protocol/libjingle_transport_factory.cc |
| 228 | virtual void SetIceProtocolType(IceProtocolType type) {} |
| 229 | |
| 230 | virtual void SetIceCredentials(const std::string& ice_ufrag, |
Steve Anton | 33f69db | 2017-10-30 10:01:15 -0700 | [diff] [blame] | 231 | const std::string& ice_pwd); |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 232 | |
| 233 | virtual void SetRemoteIceCredentials(const std::string& ice_ufrag, |
Steve Anton | 33f69db | 2017-10-30 10:01:15 -0700 | [diff] [blame] | 234 | const std::string& ice_pwd); |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 235 | |
| 236 | // The ufrag and pwd in |ice_params| must be set |
| 237 | // before candidate gathering can start. |
| 238 | virtual void SetIceParameters(const IceParameters& ice_params) = 0; |
| 239 | |
| 240 | virtual void SetRemoteIceParameters(const IceParameters& ice_params) = 0; |
| 241 | |
| 242 | virtual void SetRemoteIceMode(IceMode mode) = 0; |
| 243 | |
| 244 | virtual void SetIceConfig(const IceConfig& config) = 0; |
| 245 | |
| 246 | // Start gathering candidates if not already started, or if an ICE restart |
| 247 | // occurred. |
| 248 | virtual void MaybeStartGathering() = 0; |
| 249 | |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 250 | virtual void AddRemoteCandidate(const Candidate& candidate) = 0; |
| 251 | |
| 252 | virtual void RemoveRemoteCandidate(const Candidate& candidate) = 0; |
| 253 | |
Harald Alvestrand | 4241cf5 | 2019-01-21 09:29:42 +0100 | [diff] [blame] | 254 | virtual void RemoveAllRemoteCandidates() = 0; |
| 255 | |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 256 | virtual IceGatheringState gathering_state() const = 0; |
| 257 | |
zhihuang | d06adf6 | 2017-01-12 15:58:31 -0800 | [diff] [blame] | 258 | // Returns the current stats for this connection. |
Qingsi Wang | 72a43a1 | 2018-02-20 16:03:18 -0800 | [diff] [blame] | 259 | virtual bool GetStats(ConnectionInfos* candidate_pair_stats_list, |
| 260 | CandidateStatsList* candidate_stats_list) = 0; |
zhihuang | d06adf6 | 2017-01-12 15:58:31 -0800 | [diff] [blame] | 261 | |
skvlad | d030912 | 2017-02-02 17:18:37 -0800 | [diff] [blame] | 262 | // Returns RTT estimate over the currently active connection, or an empty |
Danil Chapovalov | 00c7183 | 2018-06-15 15:58:38 +0200 | [diff] [blame] | 263 | // absl::optional if there is none. |
| 264 | virtual absl::optional<int> GetRttEstimate() = 0; |
skvlad | d030912 | 2017-02-02 17:18:37 -0800 | [diff] [blame] | 265 | |
Harald Alvestrand | 4241cf5 | 2019-01-21 09:29:42 +0100 | [diff] [blame] | 266 | virtual const Connection* selected_connection() const = 0; |
| 267 | |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 268 | sigslot::signal1<IceTransportInternal*> SignalGatheringState; |
| 269 | |
| 270 | // Handles sending and receiving of candidates. |
| 271 | sigslot::signal2<IceTransportInternal*, const Candidate&> |
| 272 | SignalCandidateGathered; |
| 273 | |
Eldar Rello | da13ea2 | 2019-06-01 12:23:43 +0300 | [diff] [blame] | 274 | sigslot::signal2<IceTransportInternal*, const IceCandidateErrorEvent&> |
| 275 | SignalCandidateError; |
| 276 | |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 277 | sigslot::signal2<IceTransportInternal*, const Candidates&> |
| 278 | SignalCandidatesRemoved; |
| 279 | |
Zhi Huang | 942bc2e | 2017-11-13 13:26:07 -0800 | [diff] [blame] | 280 | // Deprecated by PacketTransportInternal::SignalNetworkRouteChanged. |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 281 | // This signal occurs when there is a change in the way that packets are |
| 282 | // being routed, i.e. to a different remote location. The candidate |
| 283 | // indicates where and how we are currently sending media. |
Zhi Huang | 942bc2e | 2017-11-13 13:26:07 -0800 | [diff] [blame] | 284 | // TODO(zhihuang): Update the Chrome remoting to use the new |
| 285 | // SignalNetworkRouteChanged. |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 286 | sigslot::signal2<IceTransportInternal*, const Candidate&> SignalRouteChange; |
| 287 | |
Alex Drake | 00c7ecf | 2019-08-06 10:54:47 -0700 | [diff] [blame^] | 288 | sigslot::signal1<const cricket::CandidatePairChangeEvent&> |
| 289 | SignalCandidatePairChanged; |
| 290 | |
zhihuang | d06adf6 | 2017-01-12 15:58:31 -0800 | [diff] [blame] | 291 | // Invoked when there is conflict in the ICE role between local and remote |
| 292 | // agents. |
| 293 | sigslot::signal1<IceTransportInternal*> SignalRoleConflict; |
| 294 | |
| 295 | // Emitted whenever the transport state changed. |
Jonas Olsson | 81125f0 | 2018-10-09 10:52:04 +0200 | [diff] [blame] | 296 | // TODO(bugs.webrtc.org/9308): Remove once all uses have migrated to the new |
| 297 | // IceTransportState. |
zhihuang | d06adf6 | 2017-01-12 15:58:31 -0800 | [diff] [blame] | 298 | sigslot::signal1<IceTransportInternal*> SignalStateChanged; |
| 299 | |
Jonas Olsson | 81125f0 | 2018-10-09 10:52:04 +0200 | [diff] [blame] | 300 | // Emitted whenever the new standards-compliant transport state changed. |
| 301 | sigslot::signal1<IceTransportInternal*> SignalIceTransportStateChanged; |
| 302 | |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 303 | // Invoked when the transport is being destroyed. |
| 304 | sigslot::signal1<IceTransportInternal*> SignalDestroyed; |
zhihuang | 86abd6f | 2016-12-19 11:54:05 -0800 | [diff] [blame] | 305 | }; |
| 306 | |
| 307 | } // namespace cricket |
zhihuang | d06adf6 | 2017-01-12 15:58:31 -0800 | [diff] [blame] | 308 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 309 | #endif // P2P_BASE_ICE_TRANSPORT_INTERNAL_H_ |