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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 bool SrtpFilter::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) { | 208 bool SrtpFilter::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) { |
209 if (!IsActive()) { | 209 if (!IsActive()) { |
210 LOG(LS_WARNING) << "Failed to GetRtpAuthParams: SRTP not active"; | 210 LOG(LS_WARNING) << "Failed to GetRtpAuthParams: SRTP not active"; |
211 return false; | 211 return false; |
212 } | 212 } |
213 | 213 |
214 RTC_CHECK(send_session_); | 214 RTC_CHECK(send_session_); |
215 return send_session_->GetRtpAuthParams(key, key_len, tag_len); | 215 return send_session_->GetRtpAuthParams(key, key_len, tag_len); |
216 } | 216 } |
217 | 217 |
| 218 bool SrtpFilter::GetSrtpOverhead(int* srtp_overhead) const { |
| 219 if (!IsActive()) { |
| 220 LOG(LS_WARNING) << "Failed to GetSrtpOverhead: SRTP not active"; |
| 221 return false; |
| 222 } |
| 223 |
| 224 RTC_CHECK(send_session_); |
| 225 *srtp_overhead = send_session_->GetSrtpOverhead(); |
| 226 return true; |
| 227 } |
| 228 |
218 void SrtpFilter::set_signal_silent_time(int signal_silent_time_in_ms) { | 229 void SrtpFilter::set_signal_silent_time(int signal_silent_time_in_ms) { |
219 signal_silent_time_in_ms_ = signal_silent_time_in_ms; | 230 signal_silent_time_in_ms_ = signal_silent_time_in_ms; |
220 if (IsActive()) { | 231 if (IsActive()) { |
221 RTC_CHECK(send_session_); | 232 RTC_CHECK(send_session_); |
222 send_session_->set_signal_silent_time(signal_silent_time_in_ms); | 233 send_session_->set_signal_silent_time(signal_silent_time_in_ms); |
223 RTC_CHECK(recv_session_); | 234 RTC_CHECK(recv_session_); |
224 recv_session_->set_signal_silent_time(signal_silent_time_in_ms); | 235 recv_session_->set_signal_silent_time(signal_silent_time_in_ms); |
225 if (send_rtcp_session_) | 236 if (send_rtcp_session_) |
226 send_rtcp_session_->set_signal_silent_time(signal_silent_time_in_ms); | 237 send_rtcp_session_->set_signal_silent_time(signal_silent_time_in_ms); |
227 if (recv_rtcp_session_) | 238 if (recv_rtcp_session_) |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 | 610 |
600 *key = external_hmac->key; | 611 *key = external_hmac->key; |
601 *key_len = external_hmac->key_length; | 612 *key_len = external_hmac->key_length; |
602 *tag_len = rtp_auth_tag_len_; | 613 *tag_len = rtp_auth_tag_len_; |
603 return true; | 614 return true; |
604 #else | 615 #else |
605 return false; | 616 return false; |
606 #endif | 617 #endif |
607 } | 618 } |
608 | 619 |
| 620 int SrtpSession::GetSrtpOverhead() const { |
| 621 return rtp_auth_tag_len_; |
| 622 } |
| 623 |
609 bool SrtpSession::GetSendStreamPacketIndex(void* p, | 624 bool SrtpSession::GetSendStreamPacketIndex(void* p, |
610 int in_len, | 625 int in_len, |
611 int64_t* index) { | 626 int64_t* index) { |
612 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 627 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
613 srtp_hdr_t* hdr = reinterpret_cast<srtp_hdr_t*>(p); | 628 srtp_hdr_t* hdr = reinterpret_cast<srtp_hdr_t*>(p); |
614 srtp_stream_ctx_t* stream = srtp_get_stream(session_, hdr->ssrc); | 629 srtp_stream_ctx_t* stream = srtp_get_stream(session_, hdr->ssrc); |
615 if (!stream) { | 630 if (!stream) { |
616 return false; | 631 return false; |
617 } | 632 } |
618 | 633 |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 SrtpNotAvailable(__FUNCTION__); | 938 SrtpNotAvailable(__FUNCTION__); |
924 } | 939 } |
925 | 940 |
926 void SrtpStat::HandleSrtpResult(const SrtpStat::FailureKey& key) { | 941 void SrtpStat::HandleSrtpResult(const SrtpStat::FailureKey& key) { |
927 SrtpNotAvailable(__FUNCTION__); | 942 SrtpNotAvailable(__FUNCTION__); |
928 } | 943 } |
929 | 944 |
930 #endif // HAVE_SRTP | 945 #endif // HAVE_SRTP |
931 | 946 |
932 } // namespace cricket | 947 } // namespace cricket |
OLD | NEW |