1 /*
2  * libZRTP SDK library, implements the ZRTP secure VoIP protocol.
3  * Copyright (c) 2006-2009 Philip R. Zimmermann.  All rights reserved.
4  * Contact: http://philzimmermann.com
5  * For licensing and other legal details, see the file zrtp_legal.c.
6  *
7  * Viktor Krykun <v.krikun at zfoneproject.com>
8  */
9 
10 /**
11  * @file zrtp_config_user.h
12  * @brief libzrtp user configuration routine
13  */
14 
15 #ifndef __ZRTP_CONFIG_USER_H__
16 #define __ZRTP_CONFIG_USER_H__
17 
18 /**
19  * \defgroup zrtp_config Build Configuration
20  * \{
21  *
22  * As libzrtp based on few OS dependent components, target platform and byte-order must be defined
23  * on compilation level. libzrtp provides automatic platform and byte-order detection. Developer
24  * needs to define these parameters manually in very specific cases only.
25  *
26  * libzrtp originaly supports folowwing platforms:
27  *  - 32/64-bit Windows platform;
28  *  - Windows kernel mode;
29  *  - Apple Mac OS X and iPhone;
30  *  - Linux and *nix platforms;
31  *  - Symbian OS.
32  *
33  * In order to specify platform manually, developer should define ZRTP_PLATFORM value. If
34  * ZRTP_PLATFORM  is not defined - libzrtp will try to detect it automatically (see  zrtp_config.h).
35  *
36  * In order to specify platform byte-order manually, developer should define ZRTP_BYTE_ORDER value.
37  * If ZRTP_BYTE_ORDER  is not defined - libzrtp will try to detect it automatically.
38  */
39 
40 /** \brief Constant to define ZRTP Windows 32-bit platform */
41 #define ZP_WIN32					100
42 /** \brief Constant to define ZRTP Windows 64-bit platform */
43 #define ZP_WIN64					106
44 /** \brief Constant to define ZRTP Windows Kernel mode */
45 #define ZP_WIN32_KERNEL				101
46 /** \brief Constant to define ZRTP Windows CE platform */
47 #define ZP_WINCE					102
48 /** \brief Constant to define Linux and *nux platforms */
49 #define ZP_LINUX					103
50 /** \brief Constant to define Mac OS X Platform */
51 #define ZP_DARWIN					104
52 /** \brief Constant to define Symbian OS */
53 #define ZP_SYMBIAN					105
54 /** \brief Constant to define ZRTP BSD platform */
55 #define ZP_BSD						107
56 /** \brief Constant to define ZRTP Android platform */
57 #define ZP_ANDROID					108
58 
59 /** \brief Define Platform manually there */
60 //#undefine ZRTP_PLATFORM
61 
62 
63 /** \brief Constant to define Big Endian Platform */
64 #define ZBO_BIG_ENDIAN				0x4321
65 /** \brief Constant to define Little Endian Platform */
66 #define ZBO_LITTLE_ENDIAN			0x1234
67 
68 /** \brief Define Platform Byte Order manually there */
69 //#define ZRTP_BYTE_ORDER
70 
71 /** \brief Defines the max length in bytes of a binary SAS digest */
72 #ifndef ZRTP_SAS_DIGEST_LENGTH
73 #define ZRTP_SAS_DIGEST_LENGTH		32
74 #endif
75 
76 /** \brief Defines maximum number of ZRTP streams within one session */
77 #ifndef ZRTP_MAX_STREAMS_PER_SESSION
78 #define ZRTP_MAX_STREAMS_PER_SESSION 2
79 #endif
80 
81 /**
82  * \brief Allows to build libzrtp against external srtp encryption library
83  *
84  * The latest version of libzrtp, starting with 0.3.9, supplies a built-in mechanism for SRTP
85  * encryption. However, if for some reason during  development it is neccesary to use an external
86  * library, this flag must be set.
87  */
88 #ifndef ZRTP_USE_EXTERN_SRTP
89 #define ZRTP_USE_EXTERN_SRTP		0
90 #endif
91 
92 /**
93  * \brief Build libzrtp with minimum stack usage
94  *
95  * Set to 1 you build libzrtp in environment with strong limitation of stack size (Mobile platforms
96  * or in kernel mode). When this flag is set, some static data allocation will be changed to
97  * dynamic. The size of these data doesn't matter in "regular" PC applications, but on mobile
98  * platforms and in kernel mode, where the stack size is critical, libzrtp must work with optimized
99  * data.
100  */
101 #ifndef ZRTP_USE_STACK_MINIM
102 #define ZRTP_USE_STACK_MINIM		0
103 #endif
104 
105 #ifndef ZRTP_USE_BUILTIN
106 #define ZRTP_USE_BUILTIN			1
107 #endif
108 
109 #ifndef ZRTP_USE_BUILTIN_SCEHDULER
110 #define ZRTP_USE_BUILTIN_SCEHDULER	1
111 #endif
112 
113 #ifndef ZRTP_USE_BUILTIN_CACHE
114 #	if defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__)
115 #		if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
116 #			define ZRTP_USE_BUILTIN_CACHE		1
117 #		else
118 #			define ZRTP_USE_BUILTIN_CACHE		0
119 #		endif
120 #	else
121 #		define ZRTP_USE_BUILTIN_CACHE		1
122 #	endif
123 #endif
124 
125 #ifndef ZRTP_DEBUG_WITH_PJSIP
126 #define ZRTP_DEBUG_WITH_PJSIP		0
127 #endif
128 
129 /**
130  * \brief Set to 1 if you build libzrtp against libzrtp-s.
131  *
132  * CSD-mode was implemented to support new ZRTP/S protocol designed by KHAMSA SA, Via Giacometti 1,
133  * CH-6900, Lugano - info@khamsa.ch. and Phil Zimmermann. ZRTP/S allows to make secure ZRTP calls
134  * over CSD channels. This option affect enterprise version of the library only.
135  */
136 #ifndef ZRTP_BUILD_FOR_CSD
137 #define	ZRTP_BUILD_FOR_CSD			0
138 #endif
139 
140 /**
141  * \brief Maximum number of Preshared exchanges allowed since last retain secret update
142  *
143  * Preshared key exchange mode has lot of weaknesses comparing to DH. And one of them - lack of key
144  * continuity. Preshared mode is not recommended unless there is a strong necessity in using it
145  * (slow CPU device, low-latency channel).
146  *
147  * To minimize risk of using Preshared exchanges, libzrtp automatically limits number for preshared
148  * connection available for the same instance of RS value. In other words, libzrtp forces DH exchange
149  * every \c ZRTP_PRESHARED_MAX_ALLOWED calls.
150  */
151 #define ZRTP_PRESHARED_MAX_ALLOWED	20
152 
153 /**
154  * \brief Defines libzrtp log-level
155  *
156  * Defines  maximum log level for libzrtp: log-level 3 contains debug messages, 2 - warnings and
157  * software errors, 1 - security issues. If you set this option to 0 - libzrtp will not debug
158  * output and will not even make a log function calls.
159  */
160 #ifndef ZRTP_LOG_MAX_LEVEL
161 #define ZRTP_LOG_MAX_LEVEL			3
162 #endif
163 
164 /**
165  * \brief Enables SRTP debug output
166  *
167  * \warning! ZRTP crypto debug logs may include security sensitive information and cause security
168  *  weakness in the system. Enable SRTP debug logging only when it necessary.
169  */
170 #ifndef ZRTP_DEBUG_SRTP_KEYS
171 #define ZRTP_DEBUG_SRTP_KEYS		0
172 #endif
173 
174 /**
175  * \brief Enables ZRTP Crypto debug logging.
176  *
177  * \warning! ZRTP crypto debug logs may include security sensitive information and cause security
178  *  weakness in the system. Enable ZRTP Protocol debug logging only when it necessary.
179  */
180 #ifndef ZRTP_DEBUG_ZRTP_KEYS
181 #define ZRTP_DEBUG_ZRTP_KEYS		0
182 #endif
183 
184 
185 /* \} */
186 
187 #endif /*__ZRTP_CONFIG_USER_H__*/
188