aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/srtp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/src/srtp.rs')
-rw-r--r--openssl/src/srtp.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/openssl/src/srtp.rs b/openssl/src/srtp.rs
index 136ddbd2..03b722ac 100644
--- a/openssl/src/srtp.rs
+++ b/openssl/src/srtp.rs
@@ -5,10 +5,13 @@ use stack::Stackable;
use std::ffi::CStr;
use std::str;
+/// fake free method, since SRTP_PROTECTION_PROFILE is static
+unsafe fn free(_profile: *mut ffi::SRTP_PROTECTION_PROFILE) {}
+
#[allow(unused_unsafe)]
foreign_type_and_impl_send_sync! {
type CType = ffi::SRTP_PROTECTION_PROFILE;
- fn drop = ffi::SRTP_PROTECTION_PROFILE_free;
+ fn drop = free;
pub struct SrtpProtectionProfile;
/// Reference to `SrtpProtectionProfile`.
@@ -19,18 +22,18 @@ impl Stackable for SrtpProtectionProfile {
type StackType = ffi::stack_st_SRTP_PROTECTION_PROFILE;
}
-
impl SrtpProtectionProfileRef {
pub fn id(&self) -> SrtpProfileId {
SrtpProfileId::from_raw(unsafe { (*self.as_ptr()).id })
}
pub fn name(&self) -> &'static str {
- unsafe { CStr::from_ptr((*self.as_ptr()).name as *const _) }.to_str().expect("should be UTF-8")
+ unsafe { CStr::from_ptr((*self.as_ptr()).name as *const _) }
+ .to_str()
+ .expect("should be UTF-8")
}
}
-
-/// type of SRTP profile to use.
+/// An identifier of an SRTP protection profile.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct SrtpProfileId(c_ulong);