zrtp_config_user.h 6.1 KB

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