blob: 6d88deff076d25d51a43109bc35aabb28dcb6d7d [file] [log] [blame]
Zhi Huange818b6e2018-02-22 15:26:27 -08001/*
2 * Copyright 2018 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 Anton10542f22019-01-11 09:11:00 -080011#ifndef PC_JSEP_TRANSPORT_H_
12#define PC_JSEP_TRANSPORT_H_
Zhi Huange818b6e2018-02-22 15:26:27 -080013
14#include <map>
15#include <memory>
16#include <string>
17#include <vector>
18
Danil Chapovalov66cadcc2018-06-19 16:47:43 +020019#include "absl/types/optional.h"
Zhi Huange818b6e2018-02-22 15:26:27 -080020#include "api/candidate.h"
Qingsi Wang25ec8882019-11-15 12:33:05 -080021#include "api/ice_transport_interface.h"
Zhi Huange818b6e2018-02-22 15:26:27 -080022#include "api/jsep.h"
Niels Möller65f17ca2019-09-12 13:59:36 +020023#include "api/transport/datagram_transport_interface.h"
Bjorn A Mellembc3eebc2019-09-23 14:53:54 -070024#include "media/sctp/sctp_transport_internal.h"
Steve Anton10542f22019-01-11 09:11:00 -080025#include "p2p/base/dtls_transport.h"
26#include "p2p/base/p2p_constants.h"
27#include "p2p/base/transport_info.h"
Bjorn A Mellembc3eebc2019-09-23 14:53:54 -070028#include "pc/composite_data_channel_transport.h"
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -070029#include "pc/composite_rtp_transport.h"
Steve Anton10542f22019-01-11 09:11:00 -080030#include "pc/dtls_srtp_transport.h"
31#include "pc/dtls_transport.h"
32#include "pc/rtcp_mux_filter.h"
33#include "pc/rtp_transport.h"
Bjorn A Mellembc3eebc2019-09-23 14:53:54 -070034#include "pc/sctp_transport.h"
Steve Anton10542f22019-01-11 09:11:00 -080035#include "pc/session_description.h"
36#include "pc/srtp_filter.h"
37#include "pc/srtp_transport.h"
38#include "pc/transport_stats.h"
39#include "rtc_base/constructor_magic.h"
Steve Anton10542f22019-01-11 09:11:00 -080040#include "rtc_base/rtc_certificate.h"
41#include "rtc_base/ssl_stream_adapter.h"
Artem Titove41c4332018-07-25 15:04:28 +020042#include "rtc_base/third_party/sigslot/sigslot.h"
Harald Alvestrand78a5e962019-04-03 10:42:39 +020043#include "rtc_base/thread_checker.h"
Zhi Huange818b6e2018-02-22 15:26:27 -080044
45namespace cricket {
46
47class DtlsTransportInternal;
48
49struct JsepTransportDescription {
50 public:
51 JsepTransportDescription();
52 JsepTransportDescription(
53 bool rtcp_mux_enabled,
54 const std::vector<CryptoParams>& cryptos,
55 const std::vector<int>& encrypted_header_extension_ids,
Zhi Huange830e682018-03-30 10:48:35 -070056 int rtp_abs_sendtime_extn_id,
Bjorn A Mellem8e1343a2019-09-30 15:12:47 -070057 const TransportDescription& transport_description,
58 absl::optional<std::string> media_alt_protocol,
59 absl::optional<std::string> data_alt_protocol);
Zhi Huange818b6e2018-02-22 15:26:27 -080060 JsepTransportDescription(const JsepTransportDescription& from);
61 ~JsepTransportDescription();
62
63 JsepTransportDescription& operator=(const JsepTransportDescription& from);
64
65 bool rtcp_mux_enabled = true;
66 std::vector<CryptoParams> cryptos;
67 std::vector<int> encrypted_header_extension_ids;
Zhi Huange830e682018-03-30 10:48:35 -070068 int rtp_abs_sendtime_extn_id = -1;
Zhi Huange818b6e2018-02-22 15:26:27 -080069 // TODO(zhihuang): Add the ICE and DTLS related variables and methods from
70 // TransportDescription and remove this extra layer of abstraction.
71 TransportDescription transport_desc;
Bjorn A Mellem8e1343a2019-09-30 15:12:47 -070072
73 // Alt-protocols that apply to this JsepTransport. Presence indicates a
74 // request to use an alternative protocol for media and/or data. The
75 // alt-protocol is handled by a datagram transport. If one or both of these
76 // values are present, JsepTransport will attempt to negotiate use of the
77 // datagram transport for media and/or data.
78 absl::optional<std::string> media_alt_protocol;
79 absl::optional<std::string> data_alt_protocol;
Zhi Huange818b6e2018-02-22 15:26:27 -080080};
81
82// Helper class used by JsepTransportController that processes
83// TransportDescriptions. A TransportDescription represents the
84// transport-specific properties of an SDP m= section, processed according to
85// JSEP. Each transport consists of DTLS and ICE transport channels for RTP
86// (and possibly RTCP, if rtcp-mux isn't used).
87//
Zhi Huang365381f2018-04-13 16:44:34 -070088// On Threading: JsepTransport performs work solely on the network thread, and
Zhi Huange818b6e2018-02-22 15:26:27 -080089// so its methods should only be called on the network thread.
Bjorn A Mellem7a9a0922019-11-26 09:19:40 -080090class JsepTransport : public sigslot::has_slots<> {
Zhi Huange818b6e2018-02-22 15:26:27 -080091 public:
92 // |mid| is just used for log statements in order to identify the Transport.
93 // Note that |local_certificate| is allowed to be null since a remote
94 // description may be set before a local certificate is generated.
Zhi Huang365381f2018-04-13 16:44:34 -070095 JsepTransport(
Zhi Huange818b6e2018-02-22 15:26:27 -080096 const std::string& mid,
97 const rtc::scoped_refptr<rtc::RTCCertificate>& local_certificate,
Qingsi Wang25ec8882019-11-15 12:33:05 -080098 rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport,
99 rtc::scoped_refptr<webrtc::IceTransportInterface> rtcp_ice_transport,
Zhi Huange818b6e2018-02-22 15:26:27 -0800100 std::unique_ptr<webrtc::RtpTransport> unencrypted_rtp_transport,
101 std::unique_ptr<webrtc::SrtpTransport> sdes_transport,
102 std::unique_ptr<webrtc::DtlsSrtpTransport> dtls_srtp_transport,
Bjorn A Mellem364b2672019-08-20 16:58:03 -0700103 std::unique_ptr<webrtc::RtpTransportInternal> datagram_rtp_transport,
Zhi Huange818b6e2018-02-22 15:26:27 -0800104 std::unique_ptr<DtlsTransportInternal> rtp_dtls_transport,
Anton Sukhanov7940da02018-10-10 10:34:49 -0700105 std::unique_ptr<DtlsTransportInternal> rtcp_dtls_transport,
Bjorn A Mellembc3eebc2019-09-23 14:53:54 -0700106 std::unique_ptr<SctpTransportInternal> sctp_transport,
Bjorn A Mellembc3eebc2019-09-23 14:53:54 -0700107 std::unique_ptr<webrtc::DatagramTransportInterface> datagram_transport,
108 webrtc::DataChannelTransportInterface* data_channel_transport);
Zhi Huange818b6e2018-02-22 15:26:27 -0800109
Zhi Huang365381f2018-04-13 16:44:34 -0700110 ~JsepTransport() override;
Zhi Huange818b6e2018-02-22 15:26:27 -0800111
112 // Returns the MID of this transport. This is only used for logging.
113 const std::string& mid() const { return mid_; }
114
115 // Must be called before applying local session description.
116 // Needed in order to verify the local fingerprint.
117 void SetLocalCertificate(
118 const rtc::scoped_refptr<rtc::RTCCertificate>& local_certificate) {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200119 RTC_DCHECK_RUN_ON(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800120 local_certificate_ = local_certificate;
121 }
122
123 // Return the local certificate provided by SetLocalCertificate.
124 rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200125 RTC_DCHECK_RUN_ON(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800126 return local_certificate_;
127 }
128
129 webrtc::RTCError SetLocalJsepTransportDescription(
130 const JsepTransportDescription& jsep_description,
131 webrtc::SdpType type);
132
133 // Set the remote TransportDescription to be used by DTLS and ICE channels
134 // that are part of this Transport.
135 webrtc::RTCError SetRemoteJsepTransportDescription(
136 const JsepTransportDescription& jsep_description,
137 webrtc::SdpType type);
Zhi Huange818b6e2018-02-22 15:26:27 -0800138 webrtc::RTCError AddRemoteCandidates(const Candidates& candidates);
139
140 // Set the "needs-ice-restart" flag as described in JSEP. After the flag is
141 // set, offers should generate new ufrags/passwords until an ICE restart
142 // occurs.
143 //
144 // This and the below method can be called safely from any thread as long as
145 // SetXTransportDescription is not in progress.
146 void SetNeedsIceRestartFlag();
147 // Returns true if the ICE restart flag above was set, and no ICE restart has
148 // occurred yet for this transport (by applying a local description with
149 // changed ufrag/password).
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200150 bool needs_ice_restart() const {
151 rtc::CritScope scope(&accessor_lock_);
152 return needs_ice_restart_;
153 }
Zhi Huange818b6e2018-02-22 15:26:27 -0800154
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200155 // Returns role if negotiated, or empty absl::optional if it hasn't been
156 // negotiated yet.
157 absl::optional<rtc::SSLRole> GetDtlsRole() const;
Zhi Huange818b6e2018-02-22 15:26:27 -0800158
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700159 absl::optional<OpaqueTransportParameters> GetTransportParameters() const;
160
Zhi Huange818b6e2018-02-22 15:26:27 -0800161 // TODO(deadbeef): Make this const. See comment in transportcontroller.h.
162 bool GetStats(TransportStats* stats);
163
164 const JsepTransportDescription* local_description() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200165 RTC_DCHECK_RUN_ON(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800166 return local_description_.get();
167 }
168
169 const JsepTransportDescription* remote_description() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200170 RTC_DCHECK_RUN_ON(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800171 return remote_description_.get();
172 }
173
174 webrtc::RtpTransportInternal* rtp_transport() const {
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700175 rtc::CritScope scope(&accessor_lock_);
176 if (composite_rtp_transport_) {
177 return composite_rtp_transport_.get();
178 } else if (datagram_rtp_transport_) {
179 return datagram_rtp_transport_.get();
Zhi Huange818b6e2018-02-22 15:26:27 -0800180 } else {
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700181 return default_rtp_transport();
Zhi Huange818b6e2018-02-22 15:26:27 -0800182 }
183 }
184
Harald Alvestrandad88c882018-11-28 16:47:46 +0100185 const DtlsTransportInternal* rtp_dtls_transport() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200186 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100187 if (rtp_dtls_transport_) {
188 return rtp_dtls_transport_->internal();
189 } else {
190 return nullptr;
191 }
Zhi Huange818b6e2018-02-22 15:26:27 -0800192 }
193
Harald Alvestrandad88c882018-11-28 16:47:46 +0100194 DtlsTransportInternal* rtp_dtls_transport() {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200195 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100196 if (rtp_dtls_transport_) {
197 return rtp_dtls_transport_->internal();
198 } else {
199 return nullptr;
200 }
201 }
202
203 const DtlsTransportInternal* rtcp_dtls_transport() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200204 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100205 if (rtcp_dtls_transport_) {
206 return rtcp_dtls_transport_->internal();
207 } else {
208 return nullptr;
209 }
210 }
211
212 DtlsTransportInternal* rtcp_dtls_transport() {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200213 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100214 if (rtcp_dtls_transport_) {
215 return rtcp_dtls_transport_->internal();
216 } else {
217 return nullptr;
218 }
219 }
220
Harald Alvestrand4a7b3ac2019-01-17 10:39:40 +0100221 rtc::scoped_refptr<webrtc::DtlsTransport> RtpDtlsTransport() {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200222 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100223 return rtp_dtls_transport_;
Zhi Huange818b6e2018-02-22 15:26:27 -0800224 }
225
Bjorn A Mellembc3eebc2019-09-23 14:53:54 -0700226 rtc::scoped_refptr<webrtc::SctpTransport> SctpTransport() const {
227 rtc::CritScope scope(&accessor_lock_);
228 return sctp_transport_;
229 }
230
231 webrtc::DataChannelTransportInterface* data_channel_transport() const {
232 rtc::CritScope scope(&accessor_lock_);
233 if (composite_data_channel_transport_) {
234 return composite_data_channel_transport_.get();
235 } else if (sctp_data_channel_transport_) {
236 return sctp_data_channel_transport_.get();
237 }
238 return data_channel_transport_;
239 }
240
Anton Sukhanov316f3ac2019-05-23 15:50:38 -0700241 // Returns datagram transport, if available.
242 webrtc::DatagramTransportInterface* datagram_transport() const {
243 rtc::CritScope scope(&accessor_lock_);
Anton Sukhanov292ce4e2019-06-03 13:00:24 -0700244 return datagram_transport_.get();
Anton Sukhanov316f3ac2019-05-23 15:50:38 -0700245 }
246
Zhi Huange818b6e2018-02-22 15:26:27 -0800247 // This is signaled when RTCP-mux becomes active and
248 // |rtcp_dtls_transport_| is destroyed. The JsepTransportController will
249 // handle the signal and update the aggregate transport states.
250 sigslot::signal<> SignalRtcpMuxActive;
251
Bjorn A Mellemb689af42019-08-21 10:44:59 -0700252 // Signals that a data channel transport was negotiated and may be used to
253 // send data. The first parameter is |this|. The second parameter is the
254 // transport that was negotiated, or null if negotiation rejected the data
255 // channel transport. The third parameter (bool) indicates whether the
256 // negotiation was provisional or final. If true, it is provisional, if
257 // false, it is final.
Bjorn A Mellembc3eebc2019-09-23 14:53:54 -0700258 sigslot::signal2<JsepTransport*, webrtc::DataChannelTransportInterface*>
Bjorn A Mellemb689af42019-08-21 10:44:59 -0700259 SignalDataChannelTransportNegotiated;
260
Zhi Huange818b6e2018-02-22 15:26:27 -0800261 // TODO(deadbeef): The methods below are only public for testing. Should make
262 // them utility functions or objects so they can be tested independently from
263 // this class.
264
265 // Returns an error if the certificate's identity does not match the
266 // fingerprint, or either is NULL.
267 webrtc::RTCError VerifyCertificateFingerprint(
268 const rtc::RTCCertificate* certificate,
269 const rtc::SSLFingerprint* fingerprint) const;
270
Zhi Huangb57e1692018-06-12 11:41:11 -0700271 void SetActiveResetSrtpParams(bool active_reset_srtp_params);
272
Zhi Huange818b6e2018-02-22 15:26:27 -0800273 private:
274 bool SetRtcpMux(bool enable, webrtc::SdpType type, ContentSource source);
275
276 void ActivateRtcpMux();
277
278 bool SetSdes(const std::vector<CryptoParams>& cryptos,
279 const std::vector<int>& encrypted_extension_ids,
280 webrtc::SdpType type,
281 ContentSource source);
282
283 // Negotiates and sets the DTLS parameters based on the current local and
284 // remote transport description, such as the DTLS role to use, and whether
285 // DTLS should be activated.
286 //
287 // Called when an answer TransportDescription is applied.
288 webrtc::RTCError NegotiateAndSetDtlsParameters(
289 webrtc::SdpType local_description_type);
290
291 // Negotiates the DTLS role based off the offer and answer as specified by
292 // RFC 4145, section-4.1. Returns an RTCError if role cannot be determined
293 // from the local description and remote description.
294 webrtc::RTCError NegotiateDtlsRole(
295 webrtc::SdpType local_description_type,
296 ConnectionRole local_connection_role,
297 ConnectionRole remote_connection_role,
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200298 absl::optional<rtc::SSLRole>* negotiated_dtls_role);
Zhi Huange818b6e2018-02-22 15:26:27 -0800299
Zhi Huange818b6e2018-02-22 15:26:27 -0800300 // Pushes down the ICE parameters from the remote description.
Steve Anton71ff0732020-01-24 16:28:15 -0800301 void SetRemoteIceParameters(const IceParameters& ice_parameters,
302 IceTransportInternal* ice);
Zhi Huange818b6e2018-02-22 15:26:27 -0800303
304 // Pushes down the DTLS parameters obtained via negotiation.
305 webrtc::RTCError SetNegotiatedDtlsParameters(
306 DtlsTransportInternal* dtls_transport,
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200307 absl::optional<rtc::SSLRole> dtls_role,
Zhi Huange818b6e2018-02-22 15:26:27 -0800308 rtc::SSLFingerprint* remote_fingerprint);
309
310 bool GetTransportStats(DtlsTransportInternal* dtls_transport,
311 TransportStats* stats);
312
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700313 // Deactivates, signals removal, and deletes |composite_rtp_transport_| if the
314 // current state of negotiation is sufficient to determine which rtp_transport
Bjorn A Mellemb689af42019-08-21 10:44:59 -0700315 // and data channel transport to use.
316 void NegotiateDatagramTransport(webrtc::SdpType type)
317 RTC_RUN_ON(network_thread_);
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700318
319 // Returns the default (non-datagram) rtp transport, if any.
320 webrtc::RtpTransportInternal* default_rtp_transport() const
321 RTC_EXCLUSIVE_LOCKS_REQUIRED(accessor_lock_) {
322 if (dtls_srtp_transport_) {
323 return dtls_srtp_transport_.get();
324 } else if (sdes_transport_) {
325 return sdes_transport_.get();
326 } else if (unencrypted_rtp_transport_) {
327 return unencrypted_rtp_transport_.get();
328 } else {
329 return nullptr;
330 }
331 }
332
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200333 // Owning thread, for safety checks
334 const rtc::Thread* const network_thread_;
335 // Critical scope for fields accessed off-thread
336 // TODO(https://bugs.webrtc.org/10300): Stop doing this.
337 rtc::CriticalSection accessor_lock_;
Zhi Huange818b6e2018-02-22 15:26:27 -0800338 const std::string mid_;
339 // needs-ice-restart bit as described in JSEP.
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200340 bool needs_ice_restart_ RTC_GUARDED_BY(accessor_lock_) = false;
341 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_
342 RTC_GUARDED_BY(network_thread_);
343 std::unique_ptr<JsepTransportDescription> local_description_
344 RTC_GUARDED_BY(network_thread_);
345 std::unique_ptr<JsepTransportDescription> remote_description_
346 RTC_GUARDED_BY(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800347
Bjorn A Mellem0c1c1b42019-05-29 17:34:13 -0700348 // Ice transport which may be used by any of upper-layer transports (below).
349 // Owned by JsepTransport and guaranteed to outlive the transports below.
Qingsi Wang25ec8882019-11-15 12:33:05 -0800350 const rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport_;
351 const rtc::scoped_refptr<webrtc::IceTransportInterface> rtcp_ice_transport_;
Bjorn A Mellem0c1c1b42019-05-29 17:34:13 -0700352
Zhi Huange818b6e2018-02-22 15:26:27 -0800353 // To avoid downcasting and make it type safe, keep three unique pointers for
354 // different SRTP mode and only one of these is non-nullptr.
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700355 std::unique_ptr<webrtc::RtpTransport> unencrypted_rtp_transport_
356 RTC_GUARDED_BY(accessor_lock_);
357 std::unique_ptr<webrtc::SrtpTransport> sdes_transport_
358 RTC_GUARDED_BY(accessor_lock_);
359 std::unique_ptr<webrtc::DtlsSrtpTransport> dtls_srtp_transport_
360 RTC_GUARDED_BY(accessor_lock_);
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700361
362 // If multiple RTP transports are in use, |composite_rtp_transport_| will be
363 // passed to callers. This is only valid for offer-only, receive-only
364 // scenarios, as it is not possible for the composite to correctly choose
365 // which transport to use for sending.
366 std::unique_ptr<webrtc::CompositeRtpTransport> composite_rtp_transport_
367 RTC_GUARDED_BY(accessor_lock_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800368
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200369 rtc::scoped_refptr<webrtc::DtlsTransport> rtp_dtls_transport_
370 RTC_GUARDED_BY(accessor_lock_);
371 rtc::scoped_refptr<webrtc::DtlsTransport> rtcp_dtls_transport_
372 RTC_GUARDED_BY(accessor_lock_);
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700373 rtc::scoped_refptr<webrtc::DtlsTransport> datagram_dtls_transport_
374 RTC_GUARDED_BY(accessor_lock_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800375
Bjorn A Mellembc3eebc2019-09-23 14:53:54 -0700376 std::unique_ptr<webrtc::DataChannelTransportInterface>
377 sctp_data_channel_transport_ RTC_GUARDED_BY(accessor_lock_);
378 rtc::scoped_refptr<webrtc::SctpTransport> sctp_transport_
379 RTC_GUARDED_BY(accessor_lock_);
380
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200381 SrtpFilter sdes_negotiator_ RTC_GUARDED_BY(network_thread_);
382 RtcpMuxFilter rtcp_mux_negotiator_ RTC_GUARDED_BY(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800383
384 // Cache the encrypted header extension IDs for SDES negoitation.
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200385 absl::optional<std::vector<int>> send_extension_ids_
386 RTC_GUARDED_BY(network_thread_);
387 absl::optional<std::vector<int>> recv_extension_ids_
388 RTC_GUARDED_BY(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800389
Anton Sukhanov292ce4e2019-06-03 13:00:24 -0700390 // Optional datagram transport (experimental).
391 std::unique_ptr<webrtc::DatagramTransportInterface> datagram_transport_
392 RTC_GUARDED_BY(accessor_lock_);
393
Bjorn A Mellemfc604aa2019-09-24 14:59:21 -0700394 std::unique_ptr<webrtc::RtpTransportInternal> datagram_rtp_transport_
395 RTC_GUARDED_BY(accessor_lock_);
396
Bjorn A Mellem7a9a0922019-11-26 09:19:40 -0800397 // Non-SCTP data channel transport. Set to |datagram_transport_| if that
398 // transport should be used for data chanels. Unset otherwise.
Bjorn A Mellembc3eebc2019-09-23 14:53:54 -0700399 webrtc::DataChannelTransportInterface* data_channel_transport_
400 RTC_GUARDED_BY(accessor_lock_) = nullptr;
401
402 // Composite data channel transport, used during negotiation.
403 std::unique_ptr<webrtc::CompositeDataChannelTransport>
404 composite_data_channel_transport_ RTC_GUARDED_BY(accessor_lock_);
405
Zhi Huang365381f2018-04-13 16:44:34 -0700406 RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransport);
Zhi Huange818b6e2018-02-22 15:26:27 -0800407};
408
409} // namespace cricket
410
Steve Anton10542f22019-01-11 09:11:00 -0800411#endif // PC_JSEP_TRANSPORT_H_