shared_globals.c 2.4 KB

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