OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2009 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 10 matching lines...) Expand all Loading... |
21 #include "webrtc/base/constructormagic.h" | 21 #include "webrtc/base/constructormagic.h" |
22 #include "webrtc/base/criticalsection.h" | 22 #include "webrtc/base/criticalsection.h" |
23 #include "webrtc/base/sigslotrepeater.h" | 23 #include "webrtc/base/sigslotrepeater.h" |
24 #include "webrtc/base/sslstreamadapter.h" | 24 #include "webrtc/base/sslstreamadapter.h" |
25 #include "webrtc/base/thread_checker.h" | 25 #include "webrtc/base/thread_checker.h" |
26 #include "webrtc/media/base/cryptoparams.h" | 26 #include "webrtc/media/base/cryptoparams.h" |
27 #include "webrtc/p2p/base/sessiondescription.h" | 27 #include "webrtc/p2p/base/sessiondescription.h" |
28 | 28 |
29 // Forward declaration to avoid pulling in libsrtp headers here | 29 // Forward declaration to avoid pulling in libsrtp headers here |
30 struct srtp_event_data_t; | 30 struct srtp_event_data_t; |
31 struct srtp_ctx_t; | 31 |
32 struct srtp_policy_t; | 32 // Libsrtp V1/V2 compatibility hack. |
| 33 // TODO(mattdr): Remove this #define after libsrtp 2.0 is in. |
| 34 #define srtp_ctx_t_ srtp_ctx_t |
| 35 |
| 36 struct srtp_ctx_t_; |
33 | 37 |
34 namespace cricket { | 38 namespace cricket { |
35 | 39 |
36 class SrtpSession; | 40 class SrtpSession; |
37 class SrtpStat; | 41 class SrtpStat; |
38 | 42 |
39 void EnableSrtpDebugging(); | 43 void EnableSrtpDebugging(); |
40 void ShutdownSrtp(); | 44 void ShutdownSrtp(); |
41 | 45 |
42 // Class to transform SRTP to/from RTP. | 46 // Class to transform SRTP to/from RTP. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 private: | 219 private: |
216 bool SetKey(int type, int cs, const uint8_t* key, size_t len); | 220 bool SetKey(int type, int cs, const uint8_t* key, size_t len); |
217 // Returns send stream current packet index from srtp db. | 221 // Returns send stream current packet index from srtp db. |
218 bool GetSendStreamPacketIndex(void* data, int in_len, int64_t* index); | 222 bool GetSendStreamPacketIndex(void* data, int in_len, int64_t* index); |
219 | 223 |
220 static bool Init(); | 224 static bool Init(); |
221 void HandleEvent(const srtp_event_data_t* ev); | 225 void HandleEvent(const srtp_event_data_t* ev); |
222 static void HandleEventThunk(srtp_event_data_t* ev); | 226 static void HandleEventThunk(srtp_event_data_t* ev); |
223 | 227 |
224 rtc::ThreadChecker thread_checker_; | 228 rtc::ThreadChecker thread_checker_; |
225 srtp_ctx_t* session_; | 229 srtp_ctx_t_* session_; |
226 int rtp_auth_tag_len_; | 230 int rtp_auth_tag_len_; |
227 int rtcp_auth_tag_len_; | 231 int rtcp_auth_tag_len_; |
228 std::unique_ptr<SrtpStat> srtp_stat_; | 232 std::unique_ptr<SrtpStat> srtp_stat_; |
229 static bool inited_; | 233 static bool inited_; |
230 static rtc::GlobalLockPod lock_; | 234 static rtc::GlobalLockPod lock_; |
231 int last_send_seq_num_; | 235 int last_send_seq_num_; |
232 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession); | 236 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession); |
233 }; | 237 }; |
234 | 238 |
235 // Class that collects failures of SRTP. | 239 // Class that collects failures of SRTP. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 std::map<FailureKey, FailureStat> failures_; | 304 std::map<FailureKey, FailureStat> failures_; |
301 // Threshold in ms to silent the signaling errors. | 305 // Threshold in ms to silent the signaling errors. |
302 int signal_silent_time_; | 306 int signal_silent_time_; |
303 | 307 |
304 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); | 308 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); |
305 }; | 309 }; |
306 | 310 |
307 } // namespace cricket | 311 } // namespace cricket |
308 | 312 |
309 #endif // WEBRTC_PC_SRTPFILTER_H_ | 313 #endif // WEBRTC_PC_SRTPFILTER_H_ |
OLD | NEW |