diff options
| author | Steven Fackler <[email protected]> | 2018-08-19 18:50:11 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2018-08-19 18:50:11 -0700 |
| commit | ef7721092dbf1e8b8572a0d9f081b2e7eed36960 (patch) | |
| tree | f2ba96394bb573c5f9559ad66942159b7b109f8f /openssl/src/srtp.rs | |
| parent | Merge pull request #975 from eun-ice/master (diff) | |
| download | rust-openssl-ef7721092dbf1e8b8572a0d9f081b2e7eed36960.tar.xz rust-openssl-ef7721092dbf1e8b8572a0d9f081b2e7eed36960.zip | |
SRTP cleanup
Diffstat (limited to 'openssl/src/srtp.rs')
| -rw-r--r-- | openssl/src/srtp.rs | 13 |
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); |