libSRTP  2.1.0-pre
srtp.h
1 /*
2  * srtp.h
3  *
4  * interface to libsrtp
5  *
6  * David A. McGrew
7  * Cisco Systems, Inc.
8  */
9 /*
10  *
11  * Copyright (c) 2001-2017, Cisco Systems, Inc.
12  * All rights reserved.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions
16  * are met:
17  *
18  * Redistributions of source code must retain the above copyright
19  * notice, this list of conditions and the following disclaimer.
20  *
21  * Redistributions in binary form must reproduce the above
22  * copyright notice, this list of conditions and the following
23  * disclaimer in the documentation and/or other materials provided
24  * with the distribution.
25  *
26  * Neither the name of the Cisco Systems, Inc. nor the names of its
27  * contributors may be used to endorse or promote products derived
28  * from this software without specific prior written permission.
29  *
30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
33  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
34  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
35  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
37  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
41  * OF THE POSSIBILITY OF SUCH DAMAGE.
42  *
43  */
44 
45 
46 #ifndef SRTP_SRTP_H
47 #define SRTP_SRTP_H
48 
49 #include <stdint.h>
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
64 /*
65  * SRTP_MASTER_KEY_LEN is the nominal master key length supported by libSRTP
66  */
67 
68 #define SRTP_MASTER_KEY_LEN 30
69 
70 /*
71  * SRTP_MAX_KEY_LEN is the maximum key length supported by libSRTP
72  */
73 #define SRTP_MAX_KEY_LEN 64
74 
75 /*
76  * SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP
77  */
78 
79 #define SRTP_MAX_TAG_LEN 16
80 
85 #define SRTP_MAX_MKI_LEN 128
86 
87 
96 #define SRTP_MAX_TRAILER_LEN (SRTP_MAX_TAG_LEN + SRTP_MAX_MKI_LEN)
97 
103 #define SRTP_MAX_NUM_MASTER_KEYS 16
104 
105 #define SRTP_SALT_LEN 14
106 /*
107  * SRTP_AEAD_SALT_LEN is the length of the SALT values used with
108  * GCM mode. GCM mode requires an IV. The SALT value is used
109  * as part of the IV formation logic applied to each RTP packet.
110  */
111 #define SRTP_AEAD_SALT_LEN 12
112 
113 #define SRTP_AES_128_KEY_LEN 16
114 #define SRTP_AES_192_KEY_LEN 24
115 #define SRTP_AES_256_KEY_LEN 32
116 
117 #define SRTP_AES_ICM_128_KEY_LEN_WSALT (SRTP_SALT_LEN + SRTP_AES_128_KEY_LEN)
118 #define SRTP_AES_ICM_192_KEY_LEN_WSALT (SRTP_SALT_LEN + SRTP_AES_192_KEY_LEN)
119 #define SRTP_AES_ICM_256_KEY_LEN_WSALT (SRTP_SALT_LEN + SRTP_AES_256_KEY_LEN)
120 
121 #define SRTP_AES_GCM_128_KEY_LEN_WSALT (SRTP_AEAD_SALT_LEN + SRTP_AES_128_KEY_LEN)
122 #define SRTP_AES_GCM_192_KEY_LEN_WSALT (SRTP_AEAD_SALT_LEN + SRTP_AES_192_KEY_LEN)
123 #define SRTP_AES_GCM_256_KEY_LEN_WSALT (SRTP_AEAD_SALT_LEN + SRTP_AES_256_KEY_LEN)
124 
137 typedef uint32_t srtp_cipher_type_id_t;
138 
151 typedef uint32_t srtp_auth_type_id_t;
152 
161 typedef enum {
191 
192 
193 typedef struct srtp_ctx_t_ srtp_ctx_t;
194 
203 typedef enum {
209 
220 typedef struct srtp_crypto_policy_t {
221  srtp_cipher_type_id_t cipher_type;
225  srtp_auth_type_id_t auth_type;
234 
235 
243 typedef enum {
253 
264 typedef struct {
266  unsigned int value;
267 } srtp_ssrc_t;
268 
269 
273 typedef struct srtp_ekt_policy_ctx_t *srtp_ekt_policy_t;
274 
275 
279 typedef struct srtp_ekt_stream_ctx_t *srtp_ekt_stream_t;
280 
287 typedef struct srtp_master_key_t {
288  unsigned char *key;
289  unsigned char *mki_id;
290  unsigned int mki_size;
292 
320 typedef struct srtp_policy_t {
328  unsigned char *key;
330  srtp_master_key_t **keys;
331  unsigned long num_master_keys;
332  srtp_ekt_policy_t ekt;
334  unsigned long window_size;
342  int *enc_xtn_hdr;
344  struct srtp_policy_t *next;
345 } srtp_policy_t;
346 
347 
348 
349 
363 typedef srtp_ctx_t *srtp_t;
364 
365 
374 
382 
424 srtp_err_status_t srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr);
425 
474 srtp_err_status_t srtp_protect_mki(srtp_ctx_t *ctx, void *rtp_hdr,
475  int *pkt_octet_len, unsigned int use_mki,
476  unsigned int mki_index);
477 
519 srtp_err_status_t srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr);
520 
567 srtp_err_status_t srtp_unprotect_mki(srtp_t ctx, void *srtp_hdr, int *len_ptr,
568  unsigned int use_mki);
569 
592 srtp_err_status_t srtp_create(srtp_t *session, const srtp_policy_t *policy);
593 
594 
610 srtp_err_status_t srtp_add_stream(srtp_t session, const srtp_policy_t *policy);
611 
612 
635 srtp_err_status_t srtp_remove_stream(srtp_t session, unsigned int ssrc);
636 
662 srtp_err_status_t srtp_update(srtp_t session, const srtp_policy_t *policy);
663 
686 srtp_err_status_t srtp_update_stream(srtp_t session, const srtp_policy_t *policy);
687 
708 
729 
745 #define srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(p) srtp_crypto_policy_set_rtp_default(p)
746 
747 
780 
781 
782 
810 
811 
837 
862 
863 
888 
889 
922 
949 
950 
974 
975 
1007 
1008 
1035 
1036 
1059 
1082 
1105 
1128 
1151 
1174 
1175 
1193 
1194 
1195 /*
1196  * @brief identifies a particular SRTP profile
1197  *
1198  * An srtp_profile_t enumeration is used to identify a particular SRTP
1199  * profile (that is, a set of algorithms and parameters). These profiles
1200  * are defined for DTLS-SRTP:
1201  * https://www.iana.org/assignments/srtp-protection/srtp-protection.xhtml
1202  */
1203 
1204 typedef enum {
1205  srtp_profile_reserved = 0,
1206  srtp_profile_aes128_cm_sha1_80 = 1,
1207  srtp_profile_aes128_cm_sha1_32 = 2,
1208  srtp_profile_null_sha1_80 = 5,
1209  srtp_profile_null_sha1_32 = 6,
1210  srtp_profile_aead_aes_128_gcm = 7,
1211  srtp_profile_aead_aes_256_gcm = 8,
1212 } srtp_profile_t;
1213 
1214 
1239 
1240 
1241 
1242 
1267 
1271 unsigned int
1272 srtp_profile_get_master_key_length(srtp_profile_t profile);
1273 
1274 
1278 unsigned int
1279 srtp_profile_get_master_salt_length(srtp_profile_t profile);
1280 
1293 void
1294 srtp_append_salt_to_key(unsigned char *key, unsigned int bytes_in_key,
1295  unsigned char *salt, unsigned int bytes_in_salt);
1296 
1297 
1298 
1363 srtp_err_status_t srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len);
1364 
1365 
1411 srtp_err_status_t srtp_protect_rtcp_mki(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len,
1412  unsigned int use_mki, unsigned int mki_index);
1413 
1453 srtp_err_status_t srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len);
1454 
1499 srtp_err_status_t srtp_unprotect_rtcp_mki(srtp_t ctx, void *srtcp_hdr,
1500  int *pkt_octet_len,
1501  unsigned int use_mki);
1502 
1531 void
1532 srtp_set_user_data(srtp_t ctx, void *data);
1533 
1550 void*
1551 srtp_get_user_data(srtp_t ctx);
1552 
1600 typedef enum {
1613 } srtp_event_t;
1614 
1623 typedef struct srtp_event_data_t {
1624  srtp_t session;
1625  uint32_t ssrc;
1626  srtp_event_t event;
1628 
1641 
1656 
1661 const char *srtp_get_version_string(void);
1662 
1667 unsigned int srtp_get_version(void);
1668 
1677 srtp_err_status_t srtp_set_debug_module(const char *mod_name, int v);
1678 
1684 
1692 typedef enum {
1698 
1709 typedef void (srtp_log_handler_func_t)(srtp_log_level_t level, const char * msg, void *data);
1710 
1725 
1735 srtp_err_status_t srtp_get_protect_trailer_length(srtp_t session, uint32_t use_mki,
1736  uint32_t mki_index, uint32_t *length);
1737 
1747 srtp_err_status_t srtp_get_protect_rtcp_trailer_length(srtp_t session, uint32_t use_mki,
1748  uint32_t mki_index, uint32_t *length);
1749 
1750 
1760 srtp_err_status_t srtp_set_stream_roc(srtp_t session, uint32_t ssrc, uint32_t roc);
1761 
1771 srtp_err_status_t srtp_get_stream_roc(srtp_t session, uint32_t ssrc, uint32_t *roc);
1772 
1773 
1777 /* in host order, so outside the #if */
1778 #define SRTCP_E_BIT 0x80000000
1779 /* for byte-access */
1780 #define SRTCP_E_BYTE_BIT 0x80
1781 #define SRTCP_INDEX_MASK 0x7fffffff
1782 
1783 #ifdef __cplusplus
1784 }
1785 #endif
1786 
1787 #endif /* SRTP_SRTP_H */
Definition: srtp.h:207
Definition: srtp.h:1696
srtp_err_status_t srtp_set_stream_roc(srtp_t session, uint32_t ssrc, uint32_t roc)
srtp_set_stream_roc(session, ssrc, roc)
uint32_t ssrc
Definition: srtp.h:1625
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
Definition: srtp.h:169
srtp_t session
Definition: srtp.h:1624
struct srtp_ekt_policy_ctx_t * srtp_ekt_policy_t
points to an EKT policy
Definition: srtp.h:273
srtp_err_status_t srtp_dealloc(srtp_t s)
srtp_dealloc() deallocates storage for an SRTP session context.
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...
Definition: srtp.h:172
Definition: srtp.h:1693
srtp_crypto_policy_t describes a particular crypto policy that can be applied to an SRTP stream...
Definition: srtp.h:220
int cipher_key_len
Definition: srtp.h:223
srtp_err_status_t srtp_shutdown(void)
srtp_shutdown() de-initializes the srtp library.
srtp_ssrc_type_t type
Definition: srtp.h:265
Definition: srtp.h:188
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.
int * enc_xtn_hdr
Definition: srtp.h:342
struct srtp_crypto_policy_t srtp_crypto_policy_t
srtp_crypto_policy_t describes a particular crypto policy that can be applied to an SRTP stream...
Definition: srtp.h:180
Definition: srtp.h:178
unsigned int srtp_get_version(void)
Returns the numeric representation of the library version.
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_crypto_policy_t rtcp
Definition: srtp.h:327
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...
struct srtp_policy_t * next
Definition: srtp.h:344
srtp_event_t event
Definition: srtp.h:1626
Definition: srtp.h:189
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_master_key_t represents a master key. There will be a Master Key Index and the Master Key associ...
Definition: srtp.h:287
uint32_t srtp_cipher_type_id_t
A srtp_cipher_type_id_t is an identifier for a particular cipher type.
Definition: srtp.h:137
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_err_status_t srtp_update_stream(srtp_t session, const srtp_policy_t *policy)
srtp_update_stream() udpates a SRTP stream.
srtp_log_level_t
srtp_log_level_t defines log levels.
Definition: srtp.h:1692
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_err_status_t srtp_list_debug_modules(void)
srtp_list_debug_modules() outputs a list of debugging modules
struct srtp_master_key_t 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:246
Definition: srtp.h:204
Definition: srtp.h:165
Definition: srtp.h:187
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...
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...
Definition: srtp.h:249
Definition: srtp.h:181
srtp_err_status_t srtp_get_stream_roc(srtp_t session, uint32_t ssrc, uint32_t *roc)
srtp_get_stream_roc(session, ssrc, roc)
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...
Definition: srtp.h:170
srtp_ekt_policy_t ekt
Definition: srtp.h:332
Definition: srtp.h:1610
int auth_tag_len
Definition: srtp.h:229
Definition: srtp.h:177
struct srtp_event_data_t srtp_event_data_t
srtp_event_data_t is the structure passed as a callback to the event handler function ...
srtp_err_status_t srtp_create(srtp_t *session, const srtp_policy_t *policy)
srtp_create() allocates and initializes an SRTP session.
struct srtp_policy_t srtp_policy_t
represents the policy for an SRTP session.
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...
unsigned char * key
Definition: srtp.h:328
Definition: srtp.h:186
srtp_event_data_t is the structure passed as a callback to the event handler function ...
Definition: srtp.h:1623
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...
Definition: srtp.h:205
Definition: srtp.h:171
srtp_event_t
srtp_event_t defines events that need to be handled
Definition: srtp.h:1600
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)
Definition: srtp.h:175
unsigned int srtp_profile_get_master_key_length(srtp_profile_t profile)
returns the master key length for a given SRTP profile
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_err_status_t srtp_set_debug_module(const char *mod_name, int v)
srtp_set_debug_module(mod_name, v)
Definition: srtp.h:182
srtp_cipher_type_id_t cipher_type
Definition: srtp.h:221
srtp_crypto_policy_t rtp
Definition: srtp.h:326
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_ssrc_type_t
srtp_ssrc_type_t describes the type of an SSRC.
Definition: srtp.h:243
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.
Definition: srtp.h:185
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:1640
unsigned long num_master_keys
Definition: srtp.h:331
uint32_t srtp_auth_type_id_t
An srtp_auth_type_id_t is an identifier for a particular authentication function. ...
Definition: srtp.h:151
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...
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_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_ssrc_t ssrc
Definition: srtp.h:321
Definition: srtp.h:183
Definition: srtp.h:168
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...
int enc_xtn_hdr_count
Definition: srtp.h:343
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_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...
Definition: srtp.h:164
Definition: srtp.h:1694
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:1709
srtp_err_status_t
srtp_err_status_t defines error codes.
Definition: srtp.h:161
Definition: srtp.h:166
srtp_auth_type_id_t auth_type
Definition: srtp.h:225
unsigned int srtp_profile_get_master_salt_length(srtp_profile_t profile)
returns the master salt length for a given SRTP profile
srtp_ctx_t * srtp_t
An srtp_t points to an SRTP session structure.
Definition: srtp.h:363
Definition: srtp.h:167
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.
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...
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_sec_serv_t
srtp_sec_serv_t describes a set of security services.
Definition: srtp.h:203
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...
Definition: srtp.h:173
srtp_err_status_t srtp_init(void)
srtp_init() initializes the srtp library.
const char * srtp_get_version_string(void)
Returns the version string of the library.
unsigned int value
Definition: srtp.h:266
struct srtp_ekt_stream_ctx_t * srtp_ekt_stream_t
points to EKT stream data
Definition: srtp.h:279
unsigned long window_size
Definition: srtp.h:334
represents the policy for an SRTP session.
Definition: srtp.h:320
Definition: srtp.h:179
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.
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...
Definition: srtp.h:163
Definition: srtp.h:162
Definition: srtp.h:245
Definition: srtp.h:1604
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)
int allow_repeat_tx
Definition: srtp.h:336
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...
Definition: srtp.h:174
Definition: srtp.h:1607
srtp_sec_serv_t sec_serv
Definition: srtp.h:231
srtp_err_status_t srtp_remove_stream(srtp_t session, unsigned int ssrc)
srtp_remove_stream() deallocates an SRTP stream.
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.
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_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.
Definition: srtp.h:184
int auth_key_len
Definition: srtp.h:227
Definition: srtp.h:244
Definition: srtp.h:206
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...
Definition: srtp.h:1601
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.
Definition: srtp.h:176
Definition: srtp.h:1695
srtp_err_status_t srtp_update(srtp_t session, const srtp_policy_t *policy)
srtp_update() udpates all streams in the session.
An srtp_ssrc_t represents a particular SSRC value, or a `wildcard&#39; SSRC.
Definition: srtp.h:264