| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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 11 matching lines...) Expand all Loading... |
| 22 #include "webrtc/p2p/base/packettransportinternal.h" | 22 #include "webrtc/p2p/base/packettransportinternal.h" |
| 23 | 23 |
| 24 namespace cricket { | 24 namespace cricket { |
| 25 | 25 |
| 26 enum PacketFlags { | 26 enum PacketFlags { |
| 27 PF_NORMAL = 0x00, // A normal packet. | 27 PF_NORMAL = 0x00, // A normal packet. |
| 28 PF_SRTP_BYPASS = 0x01, // An encrypted SRTP packet; bypass any additional | 28 PF_SRTP_BYPASS = 0x01, // An encrypted SRTP packet; bypass any additional |
| 29 // crypto provided by the transport (e.g. DTLS) | 29 // crypto provided by the transport (e.g. DTLS) |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 // DtlsTransportInternal is an internal interface that does DTLS. | 32 // DtlsTransportInternal is an internal interface that does DTLS, also |
| 33 // negotiating SRTP crypto suites so that it may be used for DTLS-SRTP. |
| 34 // |
| 33 // Once the public interface is supported, | 35 // Once the public interface is supported, |
| 34 // (https://www.w3.org/TR/webrtc/#rtcdtlstransport-interface) | 36 // (https://www.w3.org/TR/webrtc/#rtcdtlstransport-interface) |
| 35 // the DtlsTransportInterface will be split from this class. | 37 // the DtlsTransportInterface will be split from this class. |
| 36 class DtlsTransportInternal : public rtc::PacketTransportInternal { | 38 class DtlsTransportInternal : public rtc::PacketTransportInternal { |
| 37 public: | 39 public: |
| 38 virtual ~DtlsTransportInternal() {} | 40 virtual ~DtlsTransportInternal() {} |
| 39 | 41 |
| 40 virtual DtlsTransportState dtls_state() const = 0; | 42 virtual DtlsTransportState dtls_state() const = 0; |
| 41 | 43 |
| 42 virtual const std::string& transport_name() const = 0; | 44 virtual const std::string& transport_name() const = 0; |
| 43 | 45 |
| 44 virtual int component() const = 0; | 46 virtual int component() const = 0; |
| 45 | 47 |
| 46 virtual bool IsDtlsActive() const = 0; | 48 virtual bool IsDtlsActive() const = 0; |
| 47 | 49 |
| 48 virtual bool GetSslRole(rtc::SSLRole* role) const = 0; | 50 virtual bool GetSslRole(rtc::SSLRole* role) const = 0; |
| 49 | 51 |
| 50 virtual bool SetSslRole(rtc::SSLRole role) = 0; | 52 virtual bool SetSslRole(rtc::SSLRole role) = 0; |
| 51 | 53 |
| 52 // Sets up the ciphers to use for DTLS-SRTP. | |
| 53 virtual bool SetSrtpCryptoSuites(const std::vector<int>& ciphers) = 0; | |
| 54 | |
| 55 // Keep the original one for backward compatibility until all dependencies | |
| 56 // move away. TODO(zhihuang): Remove this function. | |
| 57 virtual bool SetSrtpCiphers(const std::vector<std::string>& ciphers) = 0; | |
| 58 | |
| 59 // Finds out which DTLS-SRTP cipher was negotiated. | 54 // Finds out which DTLS-SRTP cipher was negotiated. |
| 60 // TODO(zhihuang): Remove this once all dependencies implement this. | 55 // TODO(zhihuang): Remove this once all dependencies implement this. |
| 61 virtual bool GetSrtpCryptoSuite(int* cipher) = 0; | 56 virtual bool GetSrtpCryptoSuite(int* cipher) = 0; |
| 62 | 57 |
| 63 // Finds out which DTLS cipher was negotiated. | 58 // Finds out which DTLS cipher was negotiated. |
| 64 // TODO(zhihuang): Remove this once all dependencies implement this. | 59 // TODO(zhihuang): Remove this once all dependencies implement this. |
| 65 virtual bool GetSslCipherSuite(int* cipher) = 0; | 60 virtual bool GetSslCipherSuite(int* cipher) = 0; |
| 66 | 61 |
| 67 // Gets the local RTCCertificate used for DTLS. | 62 // Gets the local RTCCertificate used for DTLS. |
| 68 virtual rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() | 63 virtual rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 protected: | 99 protected: |
| 105 DtlsTransportInternal() {} | 100 DtlsTransportInternal() {} |
| 106 | 101 |
| 107 private: | 102 private: |
| 108 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportInternal); | 103 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportInternal); |
| 109 }; | 104 }; |
| 110 | 105 |
| 111 } // namespace cricket | 106 } // namespace cricket |
| 112 | 107 |
| 113 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTINTERNAL_H_ | 108 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTINTERNAL_H_ |
| OLD | NEW |