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 <srtp2/srtp.h>
29#endif
30#else
31
32typedef void* srtp_t;
33typedef int srtp_err_status_t;
34typedef 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
48extern "C"{
49#endif
50
51enum 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
58ORTP_PUBLIC srtp_err_status_t ortp_srtp_init(void);
59ORTP_PUBLIC srtp_err_status_t ortp_srtp_create(srtp_t *session, const srtp_policy_t *policy);
60ORTP_PUBLIC srtp_err_status_t ortp_srtp_dealloc(srtp_t session);
61ORTP_PUBLIC srtp_err_status_t ortp_srtp_add_stream(srtp_t session, const srtp_policy_t *policy);
62ORTP_PUBLIC srtp_err_status_t ortp_crypto_get_random(uint8_t *tmp, int size);
63ORTP_PUBLIC bool_t ortp_srtp_supported(void);
64
65ORTP_PUBLIC int srtp_transport_new(srtp_t srtp, RtpTransport **rtpt, RtpTransport **rtcpt );
66
67ORTP_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
69ORTP_PUBLIC void ortp_srtp_shutdown(void);
70
71#ifndef srtp_err_reporting_init
72srtp_err_status_t srtp_err_reporting_init(void);
73#endif
74
75#ifdef __cplusplus
76}
77#endif
78
79#endif
The RtpSession api.
Definition: rtpsession.h:93