shared_globals.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. #ifndef USE_MSRPC
  15. int_fast8_t UseMultiplexedRpc = TRUE;
  16. int_fast8_t UseRpcNDR64 = TRUE;
  17. int_fast8_t UseRpcBTFN = TRUE;
  18. #endif // USE_MSRPC
  19. #ifndef NO_SOCKETS
  20. const char *defaultport = "1688";
  21. #endif // NO_SOCKETS
  22. #if !defined(NO_PRIVATE_IP_DETECT)
  23. uint32_t PublicIPProtectionLevel = 0;
  24. #endif
  25. KmsResponseParam_t KmsResponseParameters[MAX_KMSAPPS];
  26. #if !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)
  27. int_fast8_t IsRestarted = FALSE;
  28. #endif // !defined(NO_SOCKETS) && !defined(NO_SIGHUP) && !defined(_WIN32)
  29. #if !defined(NO_TIMEOUT) && !__minix__
  30. DWORD ServerTimeout = 30;
  31. #endif // !defined(NO_TIMEOUT) && !__minix__
  32. #if !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__
  33. #ifdef USE_MSRPC
  34. uint32_t MaxTasks = RPC_C_LISTEN_MAX_CALLS_DEFAULT;
  35. #else // !USE_MSRPC
  36. uint32_t MaxTasks = SEM_VALUE_MAX;
  37. #endif // !USE_MSRPC
  38. #endif // !defined(NO_LIMIT) && !defined (NO_SOCKETS) && !__minix__
  39. #ifndef NO_LOG
  40. int_fast8_t LogDateAndTime = TRUE;
  41. char *fn_log = NULL;
  42. int_fast8_t logstdout = 0;
  43. #ifndef NO_VERBOSE_LOG
  44. int_fast8_t logverbose = 0;
  45. #endif // NO_VERBOSE_LOG
  46. #endif // NO_LOG
  47. #ifndef NO_SOCKETS
  48. #ifndef _WIN32
  49. int_fast8_t nodaemon = 0;
  50. #endif // _WIN32
  51. int_fast8_t InetdMode = 0;
  52. #else
  53. #ifndef _WIN32
  54. int_fast8_t nodaemon = 1;
  55. #endif // _WIN32
  56. int_fast8_t InetdMode = 1;
  57. #endif
  58. #ifndef NO_RANDOM_EPID
  59. int_fast8_t RandomizationLevel = 1;
  60. uint16_t Lcid = 0;
  61. #endif
  62. #ifndef NO_SOCKETS
  63. #ifdef SIMPLE_SOCKETS
  64. SOCKET s_server;
  65. #else
  66. SOCKET *SocketList;
  67. int numsockets = 0;
  68. #endif
  69. #if !defined(NO_LIMIT) && !__minix__
  70. #ifndef _WIN32 // Posix
  71. sem_t *Semaphore;
  72. #else // _WIN32
  73. HANDLE Semaphore;
  74. #endif // _WIN32
  75. #endif // !defined(NO_LIMIT) && !__minix__
  76. #endif // NO_SOCKETS
  77. #ifdef _NTSERVICE
  78. int_fast8_t IsNTService = TRUE;
  79. int_fast8_t ServiceShutdown = FALSE;
  80. #endif // _NTSERVICE
  81. #ifndef NO_LOG
  82. #ifdef USE_THREADS
  83. #if !defined(_WIN32) && !defined(__CYGWIN__)
  84. pthread_mutex_t logmutex = PTHREAD_MUTEX_INITIALIZER;
  85. #else
  86. CRITICAL_SECTION logmutex;
  87. #endif // !defined(_WIN32) && !defined(__CYGWIN__)
  88. #endif // USE_THREADS
  89. #endif // NO_LOG
  90. #if HAVE_FREEBIND
  91. int_fast8_t freebind = FALSE;
  92. #endif // HAVE_FREEBIND