1
0

shared_globals.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef CONFIG
  2. #define CONFIG "config.h"
  3. #endif // CONFIG
  4. #include CONFIG
  5. #include "shared_globals.h"
  6. int global_argc, multi_argc = 0;
  7. CARGV global_argv, multi_argv = NULL;
  8. const char *const Version = VERSION;
  9. DWORD VLActivationInterval = 60 * 2; // 2 hours
  10. DWORD VLRenewalInterval = 60 * 24 * 7; // 7 days
  11. int_fast8_t DisconnectImmediately = FALSE;
  12. const char *const cIPv4 = "IPv4";
  13. const char *const cIPv6 = "IPv6";
  14. #ifdef IS_LIBRARY
  15. char ErrorMessage[MESSAGE_BUFFER_SIZE];
  16. #endif // IS_LIBRARY
  17. #ifndef USE_MSRPC
  18. int_fast8_t UseMultiplexedRpc = TRUE;
  19. int_fast8_t UseRpcNDR64 = TRUE;
  20. int_fast8_t UseRpcBTFN = TRUE;
  21. #endif // USE_MSRPC
  22. #ifndef NO_SOCKETS
  23. const char *defaultport = "1688";
  24. #endif // NO_SOCKETS
  25. #if !defined(NO_PRIVATE_IP_DETECT)
  26. uint32_t PublicIPProtectionLevel = 0;
  27. #endif
  28. KmsResponseParam_t KmsResponseParameters[MAX_KMSAPPS];
  29. #if !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)
  30. int_fast8_t IsRestarted = FALSE;
  31. #endif // !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)
  32. #if !defined(NO_TIMEOUT) && !__minix__
  33. DWORD ServerTimeout = 30;
  34. #endif // !defined(NO_TIMEOUT) && !__minix__
  35. #if !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__
  36. #ifdef USE_MSRPC
  37. uint32_t MaxTasks = RPC_C_LISTEN_MAX_CALLS_DEFAULT;
  38. #else // !USE_MSRPC
  39. uint32_t MaxTasks = SEM_VALUE_MAX;
  40. #endif // !USE_MSRPC
  41. #endif // !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__
  42. #ifndef NO_LOG
  43. int_fast8_t LogDateAndTime = TRUE;
  44. char *fn_log = NULL;
  45. int_fast8_t logstdout = 0;
  46. #ifndef NO_VERBOSE_LOG
  47. int_fast8_t logverbose = 0;
  48. #endif // NO_VERBOSE_LOG
  49. #endif // NO_LOG
  50. #ifndef NO_SOCKETS
  51. #ifndef _WIN32
  52. int_fast8_t nodaemon = 0;
  53. #endif // _WIN32
  54. int_fast8_t InetdMode = 0;
  55. #else
  56. #ifndef _WIN32
  57. int_fast8_t nodaemon = 1;
  58. #endif // _WIN32
  59. int_fast8_t InetdMode = 1;
  60. #endif
  61. #ifndef NO_RANDOM_EPID
  62. int_fast8_t RandomizationLevel = 1;
  63. uint16_t Lcid = 0;
  64. #endif
  65. #ifndef NO_SOCKETS
  66. #ifdef SIMPLE_SOCKETS
  67. SOCKET s_server;
  68. #else
  69. SOCKET *SocketList;
  70. int numsockets = 0;
  71. #endif
  72. #if !defined(NO_LIMIT) && !__minix__
  73. #ifndef _WIN32 // Posix
  74. sem_t *Semaphore;
  75. #else // _WIN32
  76. HANDLE Semaphore;
  77. #endif // _WIN32
  78. #endif // !defined(NO_LIMIT) && !__minix__
  79. #endif // NO_SOCKETS
  80. #ifdef _NTSERVICE
  81. int_fast8_t IsNTService = TRUE;
  82. int_fast8_t ServiceShutdown = FALSE;
  83. #endif // _NTSERVICE
  84. #ifndef NO_LOG
  85. #ifdef USE_THREADS
  86. #if !defined(_WIN32) && !defined(__CYGWIN__)
  87. pthread_mutex_t logmutex = PTHREAD_MUTEX_INITIALIZER;
  88. #else
  89. CRITICAL_SECTION logmutex;
  90. #endif // !defined(_WIN32) && !defined(__CYGWIN__)
  91. #endif // USE_THREADS
  92. #endif // NO_LOG
  93. #if HAVE_FREEBIND
  94. int_fast8_t freebind = FALSE;
  95. #endif // HAVE_FREEBIND