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 |
11 #ifndef WEBRTC_P2P_BASE_DTLSTRANSPORTINTERNAL_H_ | 11 #ifndef WEBRTC_P2P_BASE_DTLSTRANSPORTINTERNAL_H_ |
12 #define WEBRTC_P2P_BASE_DTLSTRANSPORTINTERNAL_H_ | 12 #define WEBRTC_P2P_BASE_DTLSTRANSPORTINTERNAL_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/base/sslstreamadapter.h" | 18 #include "webrtc/base/sslstreamadapter.h" |
19 #include "webrtc/p2p/base/icetransportinternal.h" | 19 #include "webrtc/p2p/base/icetransportinternal.h" |
20 #include "webrtc/p2p/base/jseptransport.h" | 20 #include "webrtc/p2p/base/jseptransport.h" |
21 #include "webrtc/p2p/base/packettransportinterface.h" | 21 #include "webrtc/p2p/base/packettransportinterface.h" |
22 | 22 |
23 namespace cricket { | 23 namespace cricket { |
24 | 24 |
25 enum PacketFlags { | |
26 PF_NORMAL = 0x00, // A normal packet. | |
27 PF_SRTP_BYPASS = 0x01, // An encrypted SRTP packet; bypass any additional | |
28 // crypto provided by the transport (e.g. DTLS) | |
29 }; | |
30 | |
25 // DtlsTransportInternal is an internal interface that does DTLS. | 31 // DtlsTransportInternal is an internal interface that does DTLS. |
26 // Once the public interface is supported, | 32 // Once the public interface is supported, |
27 // (https://www.w3.org/TR/webrtc/#rtcdtlstransport-interface) | 33 // (https://www.w3.org/TR/webrtc/#rtcdtlstransport-interface) |
28 // the DtlsTransportInterface will be split from this class. | 34 // the DtlsTransportInterface will be split from this class. |
29 class DtlsTransportInternal : public rtc::PacketTransportInterface { | 35 class DtlsTransportInternal : public rtc::PacketTransportInterface { |
30 public: | 36 public: |
31 virtual ~DtlsTransportInternal() {} | 37 virtual ~DtlsTransportInternal() {} |
32 | 38 |
33 virtual DtlsTransportState dtls_state() const = 0; | 39 virtual DtlsTransportState dtls_state() const = 0; |
34 | 40 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 | 89 |
84 // Expose the underneath IceTransport. | 90 // Expose the underneath IceTransport. |
85 virtual IceTransportInternal* ice_transport() = 0; | 91 virtual IceTransportInternal* ice_transport() = 0; |
86 | 92 |
87 sigslot::signal2<DtlsTransportInternal*, DtlsTransportState> SignalDtlsState; | 93 sigslot::signal2<DtlsTransportInternal*, DtlsTransportState> SignalDtlsState; |
88 | 94 |
89 // Emitted whenever the Dtls handshake failed on some transport channel. | 95 // Emitted whenever the Dtls handshake failed on some transport channel. |
90 sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError; | 96 sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError; |
91 | 97 |
92 // Debugging description of this transport. | 98 // Debugging description of this transport. |
93 std::string debug_name() const override { | 99 const std::string debug_name() const override { |
Taylor Brandstetter
2017/01/10 19:43:47
Like I mentioned earlier, we can remove the "const
Zhi Huang
2017/01/12 20:04:12
Done.
| |
94 return transport_name() + " " + std::to_string(component()); | 100 return transport_name() + " " + std::to_string(component()); |
95 } | 101 } |
96 | 102 |
103 protected: | |
104 DtlsTransportInternal() {} | |
105 | |
97 private: | 106 private: |
98 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportInternal); | 107 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportInternal); |
99 }; | 108 }; |
100 | 109 |
101 } // namespace cricket | 110 } // namespace cricket |
102 | 111 |
103 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTINTERNAL_H_ | 112 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTINTERNAL_H_ |
OLD | NEW |