[][src]Function srtp2_sys::srtp_protect_rtcp

pub unsafe extern "C" fn srtp_protect_rtcp(
    ctx: srtp_t,
    rtcp_hdr: *mut c_void,
    pkt_octet_len: *mut c_int
) -> srtp_err_status_t

@brief srtp_protect_rtcp() is the Secure RTCP sender-side packet processing function.

The function call srtp_protect_rtcp(ctx, rtp_hdr, len_ptr) applies SRTCP protection to the RTCP packet rtcp_hdr (which has length *len_ptr) using the SRTP session context ctx. If srtp_err_status_ok is returned, then rtp_hdr points to the resulting SRTCP packet and *len_ptr is the number of octets in that packet; otherwise, no assumptions should be made about the value of either data elements.

@warning This function assumes that it can write the authentication tag into the location in memory immediately following the RTCP packet, and assumes that the RTCP packet is aligned on a 32-bit boundary.

@warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4 into the location in memory immediately following the RTCP packet. Callers MUST ensure that this much writable memory is available in the buffer that holds the RTCP packet.

@param ctx is the SRTP context to use in processing the packet.

@param rtcp_hdr is a pointer to the RTCP packet (before the call); after the function returns, it points to the srtp packet.

@param pkt_octet_len is a pointer to the length in octets of the complete RTCP packet (header and body) before the function call, and of the complete SRTCP packet after the call, if srtp_err_status_ok was returned. Otherwise, the value of the data to which it points is undefined.

@return

  • srtp_err_status_ok if there were no problems.
  • [other] if there was a failure in the cryptographic mechanisms.