| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void OnReadableState(TransportChannel* channel); | 200 void OnReadableState(TransportChannel* channel); |
| 201 void OnWritableState(TransportChannel* channel); | 201 void OnWritableState(TransportChannel* channel); |
| 202 void OnReadPacket(TransportChannel* channel, const char* data, size_t size, | 202 void OnReadPacket(TransportChannel* channel, const char* data, size_t size, |
| 203 const rtc::PacketTime& packet_time, int flags); | 203 const rtc::PacketTime& packet_time, int flags); |
| 204 void OnSentPacket(TransportChannel* channel, | 204 void OnSentPacket(TransportChannel* channel, |
| 205 const rtc::SentPacket& sent_packet); | 205 const rtc::SentPacket& sent_packet); |
| 206 void OnReadyToSend(TransportChannel* channel); | 206 void OnReadyToSend(TransportChannel* channel); |
| 207 void OnReceivingState(TransportChannel* channel); | 207 void OnReceivingState(TransportChannel* channel); |
| 208 void OnDtlsEvent(rtc::StreamInterface* stream_, int sig, int err); | 208 void OnDtlsEvent(rtc::StreamInterface* stream_, int sig, int err); |
| 209 bool SetupDtls(); | 209 bool SetupDtls(); |
| 210 bool MaybeStartDtls(); | 210 void MaybeStartDtls(); |
| 211 bool HandleDtlsPacket(const char* data, size_t size); | 211 bool HandleDtlsPacket(const char* data, size_t size); |
| 212 void OnGatheringState(TransportChannelImpl* channel); | 212 void OnGatheringState(TransportChannelImpl* channel); |
| 213 void OnCandidateGathered(TransportChannelImpl* channel, const Candidate& c); | 213 void OnCandidateGathered(TransportChannelImpl* channel, const Candidate& c); |
| 214 void OnCandidatesRemoved(TransportChannelImpl* channel, | 214 void OnCandidatesRemoved(TransportChannelImpl* channel, |
| 215 const Candidates& candidates); | 215 const Candidates& candidates); |
| 216 void OnRoleConflict(TransportChannelImpl* channel); | 216 void OnRoleConflict(TransportChannelImpl* channel); |
| 217 void OnRouteChange(TransportChannel* channel, const Candidate& candidate); | 217 void OnRouteChange(TransportChannel* channel, const Candidate& candidate); |
| 218 void OnSelectedCandidatePairChanged( | 218 void OnSelectedCandidatePairChanged( |
| 219 TransportChannel* channel, | 219 TransportChannel* channel, |
| 220 CandidatePairInterface* selected_candidate_pair, | 220 CandidatePairInterface* selected_candidate_pair, |
| 221 int last_sent_packet_id, | 221 int last_sent_packet_id, |
| 222 bool ready_to_send); | 222 bool ready_to_send); |
| 223 void OnChannelStateChanged(TransportChannelImpl* channel); | 223 void OnChannelStateChanged(TransportChannelImpl* channel); |
| 224 void Reconnect(); | |
| 225 | 224 |
| 226 rtc::Thread* worker_thread_; // Everything should occur on this thread. | 225 rtc::Thread* worker_thread_; // Everything should occur on this thread. |
| 227 // Underlying channel, not owned by this class. | 226 // Underlying channel, not owned by this class. |
| 228 TransportChannelImpl* const channel_; | 227 TransportChannelImpl* const channel_; |
| 229 std::unique_ptr<rtc::SSLStreamAdapter> dtls_; // The DTLS stream | 228 std::unique_ptr<rtc::SSLStreamAdapter> dtls_; // The DTLS stream |
| 230 StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_. | 229 StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_. |
| 231 std::vector<int> srtp_ciphers_; // SRTP ciphers to use with DTLS. | 230 std::vector<int> srtp_ciphers_; // SRTP ciphers to use with DTLS. |
| 232 bool dtls_active_ = false; | 231 bool dtls_active_ = false; |
| 233 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_; | 232 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_; |
| 234 rtc::SSLRole ssl_role_; | 233 rtc::SSLRole ssl_role_; |
| 235 rtc::SSLProtocolVersion ssl_max_version_; | 234 rtc::SSLProtocolVersion ssl_max_version_; |
| 236 rtc::Buffer remote_fingerprint_value_; | 235 rtc::Buffer remote_fingerprint_value_; |
| 237 std::string remote_fingerprint_algorithm_; | 236 std::string remote_fingerprint_algorithm_; |
| 238 | 237 |
| 239 // Cached DTLS ClientHello packet that was received before we started the | 238 // Cached DTLS ClientHello packet that was received before we started the |
| 240 // DTLS handshake. This could happen if the hello was received before the | 239 // DTLS handshake. This could happen if the hello was received before the |
| 241 // transport channel became writable, or before a remote fingerprint was | 240 // transport channel became writable, or before a remote fingerprint was |
| 242 // received. | 241 // received. |
| 243 rtc::Buffer cached_client_hello_; | 242 rtc::Buffer cached_client_hello_; |
| 244 | 243 |
| 245 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper); | 244 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper); |
| 246 }; | 245 }; |
| 247 | 246 |
| 248 } // namespace cricket | 247 } // namespace cricket |
| 249 | 248 |
| 250 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ | 249 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ |
| OLD | NEW |