srtp.h
/*
* srtp.h
*
* interface to libsrtp
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
*
* Copyright (c) 2001-2017, Cisco Systems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef SRTP_SRTP_H
#define SRTP_SRTP_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* SRTP_MASTER_KEY_LEN is the nominal master key length supported by libSRTP
*/
#define SRTP_MASTER_KEY_LEN 30
/*
* SRTP_MAX_KEY_LEN is the maximum key length supported by libSRTP
*/
#define SRTP_MAX_KEY_LEN 64
/*
* SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP
*/
#define SRTP_MAX_TAG_LEN 16
#define SRTP_MAX_MKI_LEN 128
#define SRTP_MAX_TRAILER_LEN (SRTP_MAX_TAG_LEN + SRTP_MAX_MKI_LEN)
#define SRTP_MAX_NUM_MASTER_KEYS 16
#define SRTP_SALT_LEN 14
/*
* SRTP_AEAD_SALT_LEN is the length of the SALT values used with
* GCM mode. GCM mode requires an IV. The SALT value is used
* as part of the IV formation logic applied to each RTP packet.
*/
#define SRTP_AEAD_SALT_LEN 12
#define SRTP_AES_128_KEY_LEN 16
#define SRTP_AES_192_KEY_LEN 24
#define SRTP_AES_256_KEY_LEN 32
#define SRTP_AES_ICM_128_KEY_LEN_WSALT (SRTP_SALT_LEN + SRTP_AES_128_KEY_LEN)
#define SRTP_AES_ICM_192_KEY_LEN_WSALT (SRTP_SALT_LEN + SRTP_AES_192_KEY_LEN)
#define SRTP_AES_ICM_256_KEY_LEN_WSALT (SRTP_SALT_LEN + SRTP_AES_256_KEY_LEN)
#define SRTP_AES_GCM_128_KEY_LEN_WSALT \
(SRTP_AEAD_SALT_LEN + SRTP_AES_128_KEY_LEN)
#define SRTP_AES_GCM_192_KEY_LEN_WSALT \
(SRTP_AEAD_SALT_LEN + SRTP_AES_192_KEY_LEN)
#define SRTP_AES_GCM_256_KEY_LEN_WSALT \
(SRTP_AEAD_SALT_LEN + SRTP_AES_256_KEY_LEN)
typedef uint32_t srtp_cipher_type_id_t;
typedef uint32_t srtp_auth_type_id_t;
typedef enum {
srtp_err_status_ok = 0,
srtp_err_status_fail = 1,
srtp_err_status_bad_param = 2,
srtp_err_status_alloc_fail = 3,
srtp_err_status_dealloc_fail = 4,
srtp_err_status_init_fail = 5,
srtp_err_status_terminus = 6,
srtp_err_status_auth_fail = 7,
srtp_err_status_cipher_fail = 8,
srtp_err_status_replay_fail = 9,
srtp_err_status_replay_old = 10,
srtp_err_status_algo_fail = 11,
srtp_err_status_no_such_op = 12,
srtp_err_status_no_ctx = 13,
srtp_err_status_cant_check = 14,
srtp_err_status_key_expired = 15,
srtp_err_status_socket_err = 16,
srtp_err_status_signal_err = 17,
srtp_err_status_nonce_bad = 18,
srtp_err_status_read_fail = 19,
srtp_err_status_write_fail = 20,
srtp_err_status_parse_err = 21,
srtp_err_status_encode_err = 22,
srtp_err_status_semaphore_err = 23,
srtp_err_status_pfkey_err = 24,
srtp_err_status_bad_mki = 25,
srtp_err_status_pkt_idx_old = 26,
srtp_err_status_pkt_idx_adv = 27
} srtp_err_status_t;
typedef struct srtp_ctx_t_ srtp_ctx_t;
typedef enum {
sec_serv_none = 0,
sec_serv_conf = 1,
sec_serv_auth = 2,
sec_serv_conf_and_auth = 3
} srtp_sec_serv_t;
typedef struct srtp_crypto_policy_t {
srtp_cipher_type_id_t cipher_type;
int cipher_key_len;
srtp_auth_type_id_t auth_type;
int auth_key_len;
int auth_tag_len;
srtp_sec_serv_t sec_serv;
} srtp_crypto_policy_t;
typedef enum {
ssrc_undefined = 0,
ssrc_specific = 1,
ssrc_any_inbound = 2,
ssrc_any_outbound = 3
} srtp_ssrc_type_t;
typedef struct {
srtp_ssrc_type_t type;
unsigned int value;
} srtp_ssrc_t;
typedef struct srtp_master_key_t {
unsigned char *key;
unsigned char *mki_id;
unsigned int mki_size;
} srtp_master_key_t;
typedef struct srtp_policy_t {
srtp_ssrc_t ssrc;
srtp_crypto_policy_t rtp;
srtp_crypto_policy_t rtcp;
unsigned char *key;
srtp_master_key_t **keys;
unsigned long num_master_keys;
void *deprecated_ekt;
unsigned long window_size;
int allow_repeat_tx;
int *enc_xtn_hdr;
int enc_xtn_hdr_count;
struct srtp_policy_t *next;
} srtp_policy_t;
typedef srtp_ctx_t *srtp_t;
srtp_err_status_t srtp_init(void);
srtp_err_status_t srtp_shutdown(void);
srtp_err_status_t srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
srtp_err_status_t srtp_protect_mki(srtp_ctx_t *ctx,
void *rtp_hdr,
int *pkt_octet_len,
unsigned int use_mki,
unsigned int mki_index);
srtp_err_status_t srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr);
srtp_err_status_t srtp_unprotect_mki(srtp_t ctx,
void *srtp_hdr,
int *len_ptr,
unsigned int use_mki);
srtp_err_status_t srtp_create(srtp_t *session, const srtp_policy_t *policy);
srtp_err_status_t srtp_add_stream(srtp_t session, const srtp_policy_t *policy);
srtp_err_status_t srtp_remove_stream(srtp_t session, unsigned int ssrc);
srtp_err_status_t srtp_update(srtp_t session, const srtp_policy_t *policy);
srtp_err_status_t srtp_update_stream(srtp_t session,
const srtp_policy_t *policy);
void srtp_crypto_policy_set_rtp_default(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_rtcp_default(srtp_crypto_policy_t *p);
#define srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(p) \
srtp_crypto_policy_set_rtp_default(p)
void srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_cm_128_null_auth(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_null_cipher_hmac_sha1_80(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_null_cipher_hmac_null(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_cm_256_null_auth(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_cm_192_hmac_sha1_32(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_cm_192_null_auth(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_gcm_128_8_auth(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_gcm_256_8_auth(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_gcm_128_8_only_auth(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_gcm_256_8_only_auth(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_gcm_128_16_auth(srtp_crypto_policy_t *p);
void srtp_crypto_policy_set_aes_gcm_256_16_auth(srtp_crypto_policy_t *p);
srtp_err_status_t srtp_dealloc(srtp_t s);
/*
* @brief identifies a particular SRTP profile
*
* An srtp_profile_t enumeration is used to identify a particular SRTP
* profile (that is, a set of algorithms and parameters).
*/
typedef enum {
srtp_profile_reserved = 0,
srtp_profile_aes128_cm_sha1_80 = 1,
srtp_profile_aes128_cm_sha1_32 = 2,
srtp_profile_null_sha1_80 = 5,
srtp_profile_null_sha1_32 = 6,
srtp_profile_aead_aes_128_gcm = 7,
srtp_profile_aead_aes_256_gcm = 8,
} srtp_profile_t;
srtp_err_status_t srtp_crypto_policy_set_from_profile_for_rtp(
srtp_crypto_policy_t *policy,
srtp_profile_t profile);
srtp_err_status_t srtp_crypto_policy_set_from_profile_for_rtcp(
srtp_crypto_policy_t *policy,
srtp_profile_t profile);
unsigned int srtp_profile_get_master_key_length(srtp_profile_t profile);
unsigned int srtp_profile_get_master_salt_length(srtp_profile_t profile);
void srtp_append_salt_to_key(unsigned char *key,
unsigned int bytes_in_key,
unsigned char *salt,
unsigned int bytes_in_salt);
srtp_err_status_t srtp_protect_rtcp(srtp_t ctx,
void *rtcp_hdr,
int *pkt_octet_len);
srtp_err_status_t srtp_protect_rtcp_mki(srtp_t ctx,
void *rtcp_hdr,
int *pkt_octet_len,
unsigned int use_mki,
unsigned int mki_index);
srtp_err_status_t srtp_unprotect_rtcp(srtp_t ctx,
void *srtcp_hdr,
int *pkt_octet_len);
srtp_err_status_t srtp_unprotect_rtcp_mki(srtp_t ctx,
void *srtcp_hdr,
int *pkt_octet_len,
unsigned int use_mki);
void srtp_set_user_data(srtp_t ctx, void *data);
void *srtp_get_user_data(srtp_t ctx);
typedef enum {
event_ssrc_collision,
event_key_soft_limit,
event_key_hard_limit,
event_packet_index_limit
} srtp_event_t;
typedef struct srtp_event_data_t {
srtp_t session;
uint32_t ssrc;
srtp_event_t event;
} srtp_event_data_t;
typedef void(srtp_event_handler_func_t)(srtp_event_data_t *data);
srtp_err_status_t srtp_install_event_handler(srtp_event_handler_func_t func);
const char *srtp_get_version_string(void);
unsigned int srtp_get_version(void);
srtp_err_status_t srtp_set_debug_module(const char *mod_name, int v);
srtp_err_status_t srtp_list_debug_modules(void);
typedef enum {
srtp_log_level_error,
srtp_log_level_warning,
srtp_log_level_info,
srtp_log_level_debug
} srtp_log_level_t;
typedef void(srtp_log_handler_func_t)(srtp_log_level_t level,
const char *msg,
void *data);
srtp_err_status_t srtp_install_log_handler(srtp_log_handler_func_t func,
void *data);
srtp_err_status_t srtp_get_protect_trailer_length(srtp_t session,
uint32_t use_mki,
uint32_t mki_index,
uint32_t *length);
srtp_err_status_t srtp_get_protect_rtcp_trailer_length(srtp_t session,
uint32_t use_mki,
uint32_t mki_index,
uint32_t *length);
srtp_err_status_t srtp_set_stream_roc(srtp_t session,
uint32_t ssrc,
uint32_t roc);
srtp_err_status_t srtp_get_stream_roc(srtp_t session,
uint32_t ssrc,
uint32_t *roc);
/* in host order, so outside the #if */
#define SRTCP_E_BIT 0x80000000
/* for byte-access */
#define SRTCP_E_BYTE_BIT 0x80
#define SRTCP_INDEX_MASK 0x7fffffff
#ifdef __cplusplus
}
#endif
#endif /* SRTP_SRTP_H */
srtp_protect_rtcp_mki
srtp_err_status_t srtp_protect_rtcp_mki(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len, unsigned int use_mki, unsigned int mki_index)
srtp_protect_rtcp_mki() is the Secure RTCP sender-side packet processing function that can utilize mk...
srtp_unprotect_rtcp
srtp_err_status_t srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len)
srtp_unprotect_rtcp() is the Secure RTCP receiver-side packet processing function.
srtp_protect_rtcp
srtp_err_status_t srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len)
srtp_protect_rtcp() is the Secure RTCP sender-side packet processing function.
srtp_unprotect_rtcp_mki
srtp_err_status_t srtp_unprotect_rtcp_mki(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len, unsigned int use_mki)
srtp_unprotect_rtcp() is the Secure RTCP receiver-side packet processing function.
srtp_append_salt_to_key
void srtp_append_salt_to_key(unsigned char *key, unsigned int bytes_in_key, unsigned char *salt, unsigned int bytes_in_salt)
appends the salt to the key
srtp_update_stream
srtp_err_status_t srtp_update_stream(srtp_t session, const srtp_policy_t *policy)
srtp_update_stream() updates a SRTP stream.
srtp_t
srtp_ctx_t * srtp_t
An srtp_t points to an SRTP session structure.
Definition srtp.h:351
srtp_crypto_policy_set_rtcp_default
void srtp_crypto_policy_set_rtcp_default(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_rtcp_default() sets a crypto policy structure to the SRTP default policy for R...
srtp_crypto_policy_set_from_profile_for_rtp
srtp_err_status_t srtp_crypto_policy_set_from_profile_for_rtp(srtp_crypto_policy_t *policy, srtp_profile_t profile)
srtp_crypto_policy_set_from_profile_for_rtp() sets a crypto policy structure to the appropriate value...
srtp_err_status_t
srtp_err_status_t
srtp_err_status_t defines error codes.
Definition srtp.h:164
srtp_crypto_policy_set_aes_cm_192_hmac_sha1_32
void srtp_crypto_policy_set_aes_cm_192_hmac_sha1_32(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_cm_192_hmac_sha1_32() sets a crypto policy structure to a short-authentica...
srtp_profile_get_master_salt_length
unsigned int srtp_profile_get_master_salt_length(srtp_profile_t profile)
returns the master salt length for a given SRTP profile
srtp_crypto_policy_set_aes_gcm_256_16_auth
void srtp_crypto_policy_set_aes_gcm_256_16_auth(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_gcm_256_16_auth() sets a crypto policy structure to an AEAD encryption pol...
srtp_crypto_policy_set_aes_cm_256_null_auth
void srtp_crypto_policy_set_aes_cm_256_null_auth(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_cm_256_null_auth() sets a crypto policy structure to an encryption-only po...
srtp_crypto_policy_set_aes_gcm_128_8_auth
void srtp_crypto_policy_set_aes_gcm_128_8_auth(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_gcm_128_8_auth() sets a crypto policy structure to an AEAD encryption poli...
srtp_crypto_policy_set_rtp_default
void srtp_crypto_policy_set_rtp_default(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_rtp_default() sets a crypto policy structure to the SRTP default policy for RT...
srtp_ssrc_type_t
srtp_ssrc_type_t
srtp_ssrc_type_t describes the type of an SSRC.
Definition srtp.h:247
srtp_crypto_policy_set_aes_gcm_256_8_only_auth
void srtp_crypto_policy_set_aes_gcm_256_8_only_auth(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_gcm_256_8_only_auth() sets a crypto policy structure to an AEAD authentica...
srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32
void srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32() sets a crypto policy structure to a short-authentica...
srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32
void srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32() sets a crypto policy structure to a short-authentica...
srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80
void srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80() sets a crypto policy structure to a encryption and a...
srtp_crypto_policy_set_null_cipher_hmac_sha1_80
void srtp_crypto_policy_set_null_cipher_hmac_sha1_80(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_null_cipher_hmac_sha1_80() sets a crypto policy structure to an authentication...
srtp_crypto_policy_set_from_profile_for_rtcp
srtp_err_status_t srtp_crypto_policy_set_from_profile_for_rtcp(srtp_crypto_policy_t *policy, srtp_profile_t profile)
srtp_crypto_policy_set_from_profile_for_rtcp() sets a crypto policy structure to the appropriate valu...
srtp_dealloc
srtp_err_status_t srtp_dealloc(srtp_t s)
srtp_dealloc() deallocates storage for an SRTP session context.
srtp_add_stream
srtp_err_status_t srtp_add_stream(srtp_t session, const srtp_policy_t *policy)
srtp_add_stream() allocates and initializes an SRTP stream within a given SRTP session.
srtp_update
srtp_err_status_t srtp_update(srtp_t session, const srtp_policy_t *policy)
srtp_update() updates all streams in the session.
srtp_sec_serv_t
srtp_sec_serv_t
srtp_sec_serv_t describes a set of security services.
Definition srtp.h:210
srtp_remove_stream
srtp_err_status_t srtp_remove_stream(srtp_t session, unsigned int ssrc)
srtp_remove_stream() deallocates an SRTP stream.
srtp_create
srtp_err_status_t srtp_create(srtp_t *session, const srtp_policy_t *policy)
srtp_create() allocates and initializes an SRTP session.
srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80
void srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80() sets a crypto policy structure to a encryption and a...
srtp_unprotect
srtp_err_status_t srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr)
srtp_unprotect() is the Secure RTP receiver-side packet processing function.
srtp_cipher_type_id_t
uint32_t srtp_cipher_type_id_t
A srtp_cipher_type_id_t is an identifier for a particular cipher type.
Definition srtp.h:139
srtp_shutdown
srtp_err_status_t srtp_shutdown(void)
srtp_shutdown() de-initializes the srtp library.
srtp_crypto_policy_set_aes_cm_128_null_auth
void srtp_crypto_policy_set_aes_cm_128_null_auth(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_cm_128_null_auth() sets a crypto policy structure to an encryption-only po...
srtp_protect_mki
srtp_err_status_t srtp_protect_mki(srtp_ctx_t *ctx, void *rtp_hdr, int *pkt_octet_len, unsigned int use_mki, unsigned int mki_index)
srtp_protect_mki() is the Secure RTP sender-side packet processing function that can utilize MKI.
srtp_crypto_policy_set_aes_cm_192_null_auth
void srtp_crypto_policy_set_aes_cm_192_null_auth(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_cm_192_null_auth() sets a crypto policy structure to an encryption-only po...
srtp_crypto_policy_set_aes_gcm_128_16_auth
void srtp_crypto_policy_set_aes_gcm_128_16_auth(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_gcm_128_16_auth() sets a crypto policy structure to an AEAD encryption pol...
srtp_crypto_policy_set_aes_gcm_256_8_auth
void srtp_crypto_policy_set_aes_gcm_256_8_auth(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_gcm_256_8_auth() sets a crypto policy structure to an AEAD encryption poli...
srtp_auth_type_id_t
uint32_t srtp_auth_type_id_t
An srtp_auth_type_id_t is an identifier for a particular authentication function.
Definition srtp.h:154
srtp_crypto_policy_set_aes_gcm_128_8_only_auth
void srtp_crypto_policy_set_aes_gcm_128_8_only_auth(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_aes_gcm_128_8_only_auth() sets a crypto policy structure to an AEAD authentica...
srtp_protect
srtp_err_status_t srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr)
srtp_protect() is the Secure RTP sender-side packet processing function.
srtp_profile_get_master_key_length
unsigned int srtp_profile_get_master_key_length(srtp_profile_t profile)
returns the master key length for a given SRTP profile
srtp_crypto_policy_set_null_cipher_hmac_null
void srtp_crypto_policy_set_null_cipher_hmac_null(srtp_crypto_policy_t *p)
srtp_crypto_policy_set_null_cipher_hmac_null() sets a crypto policy structure to use no encryption or...
srtp_init
srtp_err_status_t srtp_init(void)
srtp_init() initializes the srtp library.
srtp_unprotect_mki
srtp_err_status_t srtp_unprotect_mki(srtp_t ctx, void *srtp_hdr, int *len_ptr, unsigned int use_mki)
srtp_unprotect_mki() is the Secure RTP receiver-side packet processing function that checks for MKI.
srtp_err_status_write_fail
@ srtp_err_status_write_fail
Definition srtp.h:188
srtp_err_status_parse_err
@ srtp_err_status_parse_err
Definition srtp.h:189
srtp_err_status_socket_err
@ srtp_err_status_socket_err
Definition srtp.h:184
srtp_err_status_read_fail
@ srtp_err_status_read_fail
Definition srtp.h:187
srtp_err_status_bad_mki
@ srtp_err_status_bad_mki
Definition srtp.h:193
srtp_err_status_pkt_idx_adv
@ srtp_err_status_pkt_idx_adv
Definition srtp.h:197
srtp_err_status_auth_fail
@ srtp_err_status_auth_fail
Definition srtp.h:173
srtp_err_status_init_fail
@ srtp_err_status_init_fail
Definition srtp.h:170
srtp_err_status_encode_err
@ srtp_err_status_encode_err
Definition srtp.h:190
srtp_err_status_cant_check
@ srtp_err_status_cant_check
Definition srtp.h:181
srtp_err_status_replay_fail
@ srtp_err_status_replay_fail
Definition srtp.h:175
srtp_err_status_ok
@ srtp_err_status_ok
Definition srtp.h:165
srtp_err_status_pkt_idx_old
@ srtp_err_status_pkt_idx_old
Definition srtp.h:195
srtp_err_status_bad_param
@ srtp_err_status_bad_param
Definition srtp.h:167
srtp_err_status_signal_err
@ srtp_err_status_signal_err
Definition srtp.h:185
srtp_err_status_cipher_fail
@ srtp_err_status_cipher_fail
Definition srtp.h:174
srtp_err_status_terminus
@ srtp_err_status_terminus
Definition srtp.h:171
srtp_err_status_replay_old
@ srtp_err_status_replay_old
Definition srtp.h:176
srtp_err_status_fail
@ srtp_err_status_fail
Definition srtp.h:166
srtp_err_status_semaphore_err
@ srtp_err_status_semaphore_err
Definition srtp.h:191
srtp_err_status_algo_fail
@ srtp_err_status_algo_fail
Definition srtp.h:178
srtp_err_status_nonce_bad
@ srtp_err_status_nonce_bad
Definition srtp.h:186
srtp_err_status_no_such_op
@ srtp_err_status_no_such_op
Definition srtp.h:179
srtp_err_status_pfkey_err
@ srtp_err_status_pfkey_err
Definition srtp.h:192
srtp_err_status_no_ctx
@ srtp_err_status_no_ctx
Definition srtp.h:180
srtp_err_status_dealloc_fail
@ srtp_err_status_dealloc_fail
Definition srtp.h:169
srtp_err_status_alloc_fail
@ srtp_err_status_alloc_fail
Definition srtp.h:168
srtp_err_status_key_expired
@ srtp_err_status_key_expired
Definition srtp.h:183
ssrc_any_outbound
@ ssrc_any_outbound
Definition srtp.h:253
ssrc_specific
@ ssrc_specific
Definition srtp.h:249
ssrc_undefined
@ ssrc_undefined
Definition srtp.h:248
ssrc_any_inbound
@ ssrc_any_inbound
Definition srtp.h:250
sec_serv_conf_and_auth
@ sec_serv_conf_and_auth
Definition srtp.h:214
sec_serv_none
@ sec_serv_none
Definition srtp.h:211
sec_serv_conf
@ sec_serv_conf
Definition srtp.h:212
sec_serv_auth
@ sec_serv_auth
Definition srtp.h:213
srtp_get_stream_roc
srtp_err_status_t srtp_get_stream_roc(srtp_t session, uint32_t ssrc, uint32_t *roc)
srtp_get_stream_roc(session, ssrc, roc)
srtp_log_level_t
srtp_log_level_t
srtp_log_level_t defines log levels.
Definition srtp.h:1635
srtp_get_version_string
const char * srtp_get_version_string(void)
Returns the version string of the library.
srtp_get_version
unsigned int srtp_get_version(void)
Returns the numeric representation of the library version.
srtp_install_log_handler
srtp_err_status_t srtp_install_log_handler(srtp_log_handler_func_t func, void *data)
sets the log handler to the function supplied by the caller.
srtp_install_event_handler
srtp_err_status_t srtp_install_event_handler(srtp_event_handler_func_t func)
sets the event handler to the function supplied by the caller.
srtp_list_debug_modules
srtp_err_status_t srtp_list_debug_modules(void)
srtp_list_debug_modules() outputs a list of debugging modules
srtp_set_debug_module
srtp_err_status_t srtp_set_debug_module(const char *mod_name, int v)
srtp_set_debug_module(mod_name, v)
srtp_get_protect_trailer_length
srtp_err_status_t srtp_get_protect_trailer_length(srtp_t session, uint32_t use_mki, uint32_t mki_index, uint32_t *length)
srtp_get_protect_trailer_length(session, use_mki, mki_index, length)
srtp_event_handler_func_t
void() srtp_event_handler_func_t(srtp_event_data_t *data)
srtp_event_handler_func_t is the function prototype for the event handler.
Definition srtp.h:1584
srtp_log_handler_func_t
void() srtp_log_handler_func_t(srtp_log_level_t level, const char *msg, void *data)
srtp_log_handler_func_t is the function prototype for the log handler.
Definition srtp.h:1652
srtp_get_protect_rtcp_trailer_length
srtp_err_status_t srtp_get_protect_rtcp_trailer_length(srtp_t session, uint32_t use_mki, uint32_t mki_index, uint32_t *length)
srtp_get_protect_rtcp_trailer_length(session, use_mki, mki_index, length)
srtp_set_stream_roc
srtp_err_status_t srtp_set_stream_roc(srtp_t session, uint32_t ssrc, uint32_t roc)
srtp_set_stream_roc(session, ssrc, roc)
srtp_event_t
srtp_event_t
srtp_event_t defines events that need to be handled
Definition srtp.h:1550
srtp_log_level_debug
@ srtp_log_level_debug
Definition srtp.h:1639
srtp_log_level_warning
@ srtp_log_level_warning
Definition srtp.h:1637
srtp_log_level_error
@ srtp_log_level_error
Definition srtp.h:1636
srtp_log_level_info
@ srtp_log_level_info
Definition srtp.h:1638
event_ssrc_collision
@ event_ssrc_collision
Definition srtp.h:1551
event_key_soft_limit
@ event_key_soft_limit
Definition srtp.h:1552
event_packet_index_limit
@ event_packet_index_limit
Definition srtp.h:1556
event_key_hard_limit
@ event_key_hard_limit
Definition srtp.h:1554
srtp_set_user_data
void srtp_set_user_data(srtp_t ctx, void *data)
srtp_set_user_data() stores the given pointer into the SRTP session for later retrieval.
srtp_get_user_data
void * srtp_get_user_data(srtp_t ctx)
srtp_get_user_data() retrieves the pointer to the custom data previously stored with srtp_set_user_da...
srtp_crypto_policy_t
srtp_crypto_policy_t describes a particular crypto policy that can be applied to an SRTP stream.
Definition srtp.h:226
srtp_crypto_policy_t::auth_type
srtp_auth_type_id_t auth_type
Definition srtp.h:231
srtp_crypto_policy_t::sec_serv
srtp_sec_serv_t sec_serv
Definition srtp.h:237
srtp_crypto_policy_t::auth_tag_len
int auth_tag_len
Definition srtp.h:235
srtp_crypto_policy_t::auth_key_len
int auth_key_len
Definition srtp.h:233
srtp_crypto_policy_t::cipher_type
srtp_cipher_type_id_t cipher_type
Definition srtp.h:227
srtp_crypto_policy_t::cipher_key_len
int cipher_key_len
Definition srtp.h:229
srtp_event_data_t
srtp_event_data_t is the structure passed as a callback to the event handler function
Definition srtp.h:1567
srtp_event_data_t::session
srtp_t session
Definition srtp.h:1568
srtp_event_data_t::event
srtp_event_t event
Definition srtp.h:1571
srtp_event_data_t::ssrc
uint32_t ssrc
Definition srtp.h:1569
srtp_master_key_t
srtp_master_key_t represents a master key. There will be a Master Key Index and the Master Key associ...
Definition srtp.h:279
srtp_policy_t
represents the policy for an SRTP session.
Definition srtp.h:311
srtp_policy_t::deprecated_ekt
void * deprecated_ekt
Definition srtp.h:322
srtp_policy_t::enc_xtn_hdr
int * enc_xtn_hdr
Definition srtp.h:333
srtp_policy_t::enc_xtn_hdr_count
int enc_xtn_hdr_count
Definition srtp.h:334
srtp_policy_t::num_master_keys
unsigned long num_master_keys
Definition srtp.h:321
srtp_policy_t::next
struct srtp_policy_t * next
Definition srtp.h:336
srtp_policy_t::rtp
srtp_crypto_policy_t rtp
Definition srtp.h:316
srtp_policy_t::rtcp
srtp_crypto_policy_t rtcp
Definition srtp.h:317
srtp_policy_t::key
unsigned char * key
Definition srtp.h:318
srtp_policy_t::window_size
unsigned long window_size
Definition srtp.h:324
srtp_policy_t::ssrc
srtp_ssrc_t ssrc
Definition srtp.h:312
srtp_policy_t::allow_repeat_tx
int allow_repeat_tx
Definition srtp.h:326
srtp_ssrc_t
An srtp_ssrc_t represents a particular SSRC value, or a ‘wildcard’ SSRC.
Definition srtp.h:267
srtp_ssrc_t::type
srtp_ssrc_type_t type
Definition srtp.h:268
srtp_ssrc_t::value
unsigned int value
Definition srtp.h:269