oRTP  0.23.0
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 #if defined(ANDROID) || defined(WINAPI_FAMILY_PHONE_APP)
25 // Android and Windows phone don't use make install
26 #include <srtp.h>
27 #else
28 #include <srtp/config.h>
29 #include <srtp/crypto_kernel.h>
30 #include <srtp/srtp.h>
31 #endif
32 #else
33 
34 typedef void* srtp_t;
35 typedef int err_status_t;
36 typedef int srtp_policy_t;
37 
38 #endif
39 
40 #include <ortp/rtpsession.h>
41 
42 /*srtp defines all this stuff*/
43 #undef PACKAGE_BUGREPORT
44 #undef PACKAGE_NAME
45 #undef PACKAGE_STRING
46 #undef PACKAGE_TARNAME
47 #undef PACKAGE_VERSION
48 
49 #ifdef __cplusplus
50 extern "C"{
51 #endif
52 
53 enum ortp_srtp_crypto_suite_t {
54  AES_128_SHA1_80 = 1,
55  AES_128_SHA1_32,
56  AES_128_NO_AUTH,
57  NO_CIPHER_SHA1_80
58 };
59 
60 ORTP_PUBLIC err_status_t ortp_srtp_init(void);
61 ORTP_PUBLIC err_status_t ortp_srtp_create(srtp_t *session, const srtp_policy_t *policy);
62 ORTP_PUBLIC err_status_t ortp_srtp_dealloc(srtp_t session);
63 ORTP_PUBLIC err_status_t ortp_srtp_add_stream(srtp_t session, const srtp_policy_t *policy);
64 ORTP_PUBLIC err_status_t ortp_crypto_get_random(uint8_t *tmp, int size);
65 ORTP_PUBLIC bool_t ortp_srtp_supported(void);
66 
67 ORTP_PUBLIC int srtp_transport_new(srtp_t srtp, RtpTransport **rtpt, RtpTransport **rtcpt );
68 
69 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);
70 
71 ORTP_PUBLIC void ortp_srtp_shutdown(void);
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif
Definition: rtpsession.h:92
The RtpSession api.