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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 int64_t* index); | 104 int64_t* index); |
105 bool ProtectRtcp(void* data, int in_len, int max_len, int* out_len); | 105 bool ProtectRtcp(void* data, int in_len, int max_len, int* out_len); |
106 // Decrypts/verifies an invidiual RTP/RTCP packet. | 106 // Decrypts/verifies an invidiual RTP/RTCP packet. |
107 // If an HMAC is used, this will decrease the packet size. | 107 // If an HMAC is used, this will decrease the packet size. |
108 bool UnprotectRtp(void* data, int in_len, int* out_len); | 108 bool UnprotectRtp(void* data, int in_len, int* out_len); |
109 bool UnprotectRtcp(void* data, int in_len, int* out_len); | 109 bool UnprotectRtcp(void* data, int in_len, int* out_len); |
110 | 110 |
111 // Returns rtp auth params from srtp context. | 111 // Returns rtp auth params from srtp context. |
112 bool GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len); | 112 bool GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len); |
113 | 113 |
| 114 // Returns srtp overhead for rtp packets. |
| 115 bool GetSrtpOverhead(int* srtp_overhead) const; |
| 116 |
114 // Update the silent threshold (in ms) for signaling errors. | 117 // Update the silent threshold (in ms) for signaling errors. |
115 void set_signal_silent_time(int signal_silent_time_in_ms); | 118 void set_signal_silent_time(int signal_silent_time_in_ms); |
116 | 119 |
117 bool ResetParams(); | 120 bool ResetParams(); |
118 | 121 |
119 sigslot::repeater3<uint32_t, Mode, Error> SignalSrtpError; | 122 sigslot::repeater3<uint32_t, Mode, Error> SignalSrtpError; |
120 | 123 |
121 protected: | 124 protected: |
122 bool ExpectOffer(ContentSource source); | 125 bool ExpectOffer(ContentSource source); |
123 bool StoreParams(const std::vector<CryptoParams>& params, | 126 bool StoreParams(const std::vector<CryptoParams>& params, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 int64_t* index); | 197 int64_t* index); |
195 bool ProtectRtcp(void* data, int in_len, int max_len, int* out_len); | 198 bool ProtectRtcp(void* data, int in_len, int max_len, int* out_len); |
196 // Decrypts/verifies an invidiual RTP/RTCP packet. | 199 // Decrypts/verifies an invidiual RTP/RTCP packet. |
197 // If an HMAC is used, this will decrease the packet size. | 200 // If an HMAC is used, this will decrease the packet size. |
198 bool UnprotectRtp(void* data, int in_len, int* out_len); | 201 bool UnprotectRtp(void* data, int in_len, int* out_len); |
199 bool UnprotectRtcp(void* data, int in_len, int* out_len); | 202 bool UnprotectRtcp(void* data, int in_len, int* out_len); |
200 | 203 |
201 // Helper method to get authentication params. | 204 // Helper method to get authentication params. |
202 bool GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len); | 205 bool GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len); |
203 | 206 |
| 207 int GetSrtpOverhead() const; |
| 208 |
204 // Update the silent threshold (in ms) for signaling errors. | 209 // Update the silent threshold (in ms) for signaling errors. |
205 void set_signal_silent_time(int signal_silent_time_in_ms); | 210 void set_signal_silent_time(int signal_silent_time_in_ms); |
206 | 211 |
207 // Calls srtp_shutdown if it's initialized. | 212 // Calls srtp_shutdown if it's initialized. |
208 static void Terminate(); | 213 static void Terminate(); |
209 | 214 |
210 sigslot::repeater3<uint32_t, SrtpFilter::Mode, SrtpFilter::Error> | 215 sigslot::repeater3<uint32_t, SrtpFilter::Mode, SrtpFilter::Error> |
211 SignalSrtpError; | 216 SignalSrtpError; |
212 | 217 |
213 private: | 218 private: |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 std::map<FailureKey, FailureStat> failures_; | 303 std::map<FailureKey, FailureStat> failures_; |
299 // Threshold in ms to silent the signaling errors. | 304 // Threshold in ms to silent the signaling errors. |
300 int signal_silent_time_; | 305 int signal_silent_time_; |
301 | 306 |
302 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); | 307 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); |
303 }; | 308 }; |
304 | 309 |
305 } // namespace cricket | 310 } // namespace cricket |
306 | 311 |
307 #endif // WEBRTC_PC_SRTPFILTER_H_ | 312 #endif // WEBRTC_PC_SRTPFILTER_H_ |
OLD | NEW |