oRTP 0.22.0

- Main Page
- Data Structures
- Files

- File List
- Globals

ortp_srtp.h
1 /*
2 The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
3 Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20 #ifndef ortp_srtp_h
21 #define ortp_srtp_h
22
23 #ifdef HAVE_SRTP
24 #ifndef ANDROID
25 #include <srtp/srtp.h>
26 #else
27 // Android doesn't use make install
28 #include <srtp.h>
29 #endif
30 #else
31
32 typedef void* srtp_t;
33 typedef int err_status_t;
34 typedef int srtp_policy_t;
35
36 #endif
37
38 #include <ortp/rtpsession.h>
39
40 /*srtp defines all this stuff*/
41 #undef PACKAGE_BUGREPORT
42 #undef PACKAGE_NAME
43 #undef PACKAGE_STRING
44 #undef PACKAGE_TARNAME
45 #undef PACKAGE_VERSION
46
47 #ifdef __cplusplus
48 extern "C"{
49 #endif
50
51 enum ortp_srtp_crypto_suite_t {
52 AES_128_SHA1_80 = 1,
53 AES_128_SHA1_32,
54 AES_128_NO_AUTH,
55 NO_CIPHER_SHA1_80
56 };
57
58 ORTP_PUBLIC err_status_t ortp_srtp_init(void);
59 ORTP_PUBLIC err_status_t ortp_srtp_create(srtp_t *session, const srtp_policy_t *policy);
60 ORTP_PUBLIC err_status_t ortp_srtp_dealloc(srtp_t session);
61 ORTP_PUBLIC err_status_t ortp_srtp_add_stream(srtp_t session, const srtp_policy_t *policy);
62 ORTP_PUBLIC err_status_t ortp_crypto_get_random(uint8_t *tmp, int size);
63 ORTP_PUBLIC bool_t ortp_srtp_supported(void);
64
65 ORTP_PUBLIC int srtp_transport_new(srtp_t srtp, RtpTransport **rtpt, RtpTransport **rtcpt );
66
67 ORTP_PUBLIC srtp_t ortp_srtp_create_configure_session(enum ortp_srtp_crypto_suite_t suite, uint32_t ssrc, const char* snd_key, const char* rcv_key);
68
69 ORTP_PUBLIC void ortp_srtp_shutdown(void);
70
71 #ifdef __cplusplus
72 }
73 #endif
74
75 #endif