OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 void SetCandidatesGatheringComplete() { | 179 void SetCandidatesGatheringComplete() { |
180 if (gathering_state_ != kIceGatheringComplete) { | 180 if (gathering_state_ != kIceGatheringComplete) { |
181 gathering_state_ = kIceGatheringComplete; | 181 gathering_state_ = kIceGatheringComplete; |
182 SignalGatheringState(this); | 182 SignalGatheringState(this); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 void SetReceiving(bool receiving) { set_receiving(receiving); } | 186 void SetReceiving(bool receiving) { set_receiving(receiving); } |
187 | 187 |
188 void SetIceConfig(const IceConfig& config) override { | 188 void SetIceConfig(const IceConfig& config) override { ice_config_ = config; } |
189 receiving_timeout_ = config.receiving_timeout; | |
190 gather_continually_ = config.gather_continually; | |
191 } | |
192 | 189 |
193 int receiving_timeout() const { return receiving_timeout_; } | 190 int receiving_timeout() const { return ice_config_.receiving_timeout; } |
194 bool gather_continually() const { return gather_continually_; } | 191 bool gather_continually() const { return ice_config_.gather_continually(); } |
195 | 192 |
196 int SendPacket(const char* data, | 193 int SendPacket(const char* data, |
197 size_t len, | 194 size_t len, |
198 const rtc::PacketOptions& options, | 195 const rtc::PacketOptions& options, |
199 int flags) override { | 196 int flags) override { |
200 if (state_ != STATE_CONNECTED) { | 197 if (state_ != STATE_CONNECTED) { |
201 return -1; | 198 return -1; |
202 } | 199 } |
203 | 200 |
204 if (flags != PF_SRTP_BYPASS && flags != 0) { | 201 if (flags != PF_SRTP_BYPASS && flags != 0) { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 enum State { STATE_INIT, STATE_CONNECTING, STATE_CONNECTED }; | 314 enum State { STATE_INIT, STATE_CONNECTING, STATE_CONNECTED }; |
318 FakeTransportChannel* dest_ = nullptr; | 315 FakeTransportChannel* dest_ = nullptr; |
319 State state_ = STATE_INIT; | 316 State state_ = STATE_INIT; |
320 bool async_ = false; | 317 bool async_ = false; |
321 Candidates remote_candidates_; | 318 Candidates remote_candidates_; |
322 rtc::scoped_refptr<rtc::RTCCertificate> local_cert_; | 319 rtc::scoped_refptr<rtc::RTCCertificate> local_cert_; |
323 rtc::FakeSSLCertificate* remote_cert_ = nullptr; | 320 rtc::FakeSSLCertificate* remote_cert_ = nullptr; |
324 bool do_dtls_ = false; | 321 bool do_dtls_ = false; |
325 std::vector<int> srtp_ciphers_; | 322 std::vector<int> srtp_ciphers_; |
326 int chosen_crypto_suite_ = rtc::SRTP_INVALID_CRYPTO_SUITE; | 323 int chosen_crypto_suite_ = rtc::SRTP_INVALID_CRYPTO_SUITE; |
327 int receiving_timeout_ = -1; | 324 IceConfig ice_config_; |
328 bool gather_continually_ = false; | |
329 IceRole role_ = ICEROLE_UNKNOWN; | 325 IceRole role_ = ICEROLE_UNKNOWN; |
330 uint64_t tiebreaker_ = 0; | 326 uint64_t tiebreaker_ = 0; |
331 std::string ice_ufrag_; | 327 std::string ice_ufrag_; |
332 std::string ice_pwd_; | 328 std::string ice_pwd_; |
333 std::string remote_ice_ufrag_; | 329 std::string remote_ice_ufrag_; |
334 std::string remote_ice_pwd_; | 330 std::string remote_ice_pwd_; |
335 IceMode remote_ice_mode_ = ICEMODE_FULL; | 331 IceMode remote_ice_mode_ = ICEMODE_FULL; |
336 rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12; | 332 rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12; |
337 rtc::SSLFingerprint dtls_fingerprint_; | 333 rtc::SSLFingerprint dtls_fingerprint_; |
338 rtc::SSLRole ssl_role_ = rtc::SSL_CLIENT; | 334 rtc::SSLRole ssl_role_ = rtc::SSL_CLIENT; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 } | 579 } |
584 } | 580 } |
585 | 581 |
586 private: | 582 private: |
587 bool fail_create_channel_; | 583 bool fail_create_channel_; |
588 }; | 584 }; |
589 | 585 |
590 } // namespace cricket | 586 } // namespace cricket |
591 | 587 |
592 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ | 588 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ |
OLD | NEW |