Index: pc/channel.h |
diff --git a/pc/channel.h b/pc/channel.h |
index 613597b990e19990f4aa54490caad6fca5e4645e..b4b20417715981583e8305eea24a7dd79cebd029 100644 |
--- a/pc/channel.h |
+++ b/pc/channel.h |
@@ -30,10 +30,13 @@ |
#include "p2p/base/transportcontroller.h" |
#include "p2p/client/socketmonitor.h" |
#include "pc/audiomonitor.h" |
+#include "pc/dtlssrtptransport.h" |
#include "pc/mediamonitor.h" |
#include "pc/mediasession.h" |
#include "pc/rtcpmuxfilter.h" |
+#include "pc/rtptransport.h" |
#include "pc/srtpfilter.h" |
+#include "pc/srtptransport.h" |
#include "rtc_base/asyncinvoker.h" |
#include "rtc_base/asyncudpsocket.h" |
#include "rtc_base/criticalsection.h" |
@@ -44,7 +47,6 @@ |
namespace webrtc { |
class AudioSinkInterface; |
class RtpTransportInternal; |
-class SrtpTransport; |
} // namespace webrtc |
namespace cricket { |
@@ -103,7 +105,9 @@ class BaseChannel |
// This function returns true if we are using SDES. |
bool sdes_active() const { return sdes_negotiator_.IsActive(); } |
// The following function returns true if we are using DTLS-based keying. |
- bool dtls_active() const { return dtls_active_; } |
+ bool dtls_active() const { |
+ return dtls_srtp_transport_ && dtls_srtp_transport_->IsActive(); |
+ } |
// This function returns true if using SRTP (DTLS-based keying or SDES). |
bool srtp_active() const { return sdes_active() || dtls_active(); } |
@@ -335,6 +339,13 @@ class BaseChannel |
ContentSource src, |
const std::vector<int>& encrypted_extension_ids, |
std::string* error_desc); |
+ bool SetSdesSrtp_n(const std::vector<CryptoParams>& params, |
+ ContentAction action, |
+ ContentSource src, |
+ const std::vector<int>& encrypted_extension_ids); |
+ bool SetDtlsSrtp_n(ContentSource src, |
+ const std::vector<int>& encrypted_extension_ids); |
+ |
bool SetRtcpMux_n(bool enable, |
ContentAction action, |
ContentSource src, |
@@ -369,7 +380,13 @@ class BaseChannel |
int GetTransportOverheadPerPacket() const; |
void UpdateTransportOverhead(); |
// Wraps the existing RtpTransport in an SrtpTransport. |
- void EnableSrtpTransport_n(); |
+ void EnableSdes_n(); |
+ // Create an SrtpTransport and wrap it in an DtlsSrptTransport. |
Taylor Brandstetter
2017/09/27 23:54:48
DtlsSrtpTransport
|
+ void EnableDtlsSrtp_n(); |
+ // Cache the send/recv encrypted header extension ids before the |
+ // DtlsSrtpTransport is enabled. |
+ void CacheEncryptedHeaderExtensionIds(cricket::ContentSource source, |
+ const std::vector<int>& extension_ids); |
rtc::Thread* const worker_thread_; |
rtc::Thread* const network_thread_; |
@@ -384,13 +401,18 @@ class BaseChannel |
const bool rtcp_mux_required_; |
+ std::vector<int> send_encrypted_header_extension_ids_; |
+ std::vector<int> recv_encrypted_header_extension_ids_; |
+ |
// Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS. |
// Temporary measure until more refactoring is done. |
// If non-null, "X_dtls_transport_" will always equal "X_packet_transport_". |
DtlsTransportInternal* rtp_dtls_transport_ = nullptr; |
DtlsTransportInternal* rtcp_dtls_transport_ = nullptr; |
std::unique_ptr<webrtc::RtpTransportInternal> rtp_transport_; |
- webrtc::SrtpTransport* srtp_transport_ = nullptr; |
+ webrtc::SrtpTransport* sdes_transport_ = nullptr; |
+ webrtc::DtlsSrtpTransport* dtls_srtp_transport_ = nullptr; |
+ |
std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; |
std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; |
SrtpFilter sdes_negotiator_; |
@@ -398,7 +420,6 @@ class BaseChannel |
bool writable_ = false; |
bool was_ever_writable_ = false; |
bool has_received_packet_ = false; |
- bool dtls_active_ = false; |
const bool srtp_required_ = true; |
// MediaChannel related members that should be accessed from the worker |