mirror of
https://github.com/Wind4/vlmcsd.git
synced 2026-08-03 13:52:50 +08:00
vlmcsd-svn906-2016-06-05-Hotbird64
This commit is contained in:
@@ -94,25 +94,35 @@ int logger(const char *const fmt, ...)
|
||||
// Output to stderr if it is available or to log otherwise (e.g. if running as daemon/service)
|
||||
void printerrorf(const char *const fmt, ...)
|
||||
{
|
||||
int error = errno;
|
||||
va_list arglist;
|
||||
|
||||
va_start(arglist, fmt);
|
||||
|
||||
#ifndef NO_LOG
|
||||
#ifdef _NTSERVICE
|
||||
# ifdef IS_LIBRARY
|
||||
|
||||
snprintf(ErrorMessage, MESSAGE_BUFFER_SIZE, fmt, arglist);
|
||||
|
||||
# else // !IS_LIBRARY
|
||||
|
||||
# ifndef NO_LOG
|
||||
# ifdef _NTSERVICE
|
||||
if (InetdMode || IsNTService)
|
||||
#else // !_NTSERVICE
|
||||
# else // !_NTSERVICE
|
||||
if (InetdMode)
|
||||
#endif // NTSERVIICE
|
||||
# endif // NTSERVIICE
|
||||
vlogger(fmt, arglist);
|
||||
else
|
||||
#endif //NO_LOG
|
||||
# endif //NO_LOG
|
||||
|
||||
# endif // IS_LIBRARY
|
||||
{
|
||||
vfprintf(stderr, fmt, arglist);
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
va_end(arglist);
|
||||
errno = error;
|
||||
}
|
||||
|
||||
|
||||
@@ -130,10 +140,12 @@ int errorout(const char* fmt, ...)
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_VERBOSE_LOG
|
||||
static const char *LicenseStatusText[] =
|
||||
{
|
||||
"Unlicensed", "Licensed", "OOB grace", "OOT grace", "Non-Genuine", "Notification", "Extended grace"
|
||||
};
|
||||
#endif // NO_VERBOSE_LOG
|
||||
|
||||
|
||||
void uuid2StringLE(const GUID *const guid, char *const string)
|
||||
@@ -152,7 +164,7 @@ void uuid2StringLE(const GUID *const guid, char *const string)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_VERBOSE_LOG
|
||||
void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p)
|
||||
{
|
||||
char guidBuffer[GUID_STRING_LENGTH + 1];
|
||||
@@ -208,7 +220,6 @@ void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p)
|
||||
p("N count policy (minimum clients): %u\n", (uint32_t)LE32(Request->N_Policy));
|
||||
}
|
||||
|
||||
|
||||
void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RESPONSE *const response, const PRINTFUNC p)
|
||||
{
|
||||
char guidBuffer[GUID_STRING_LENGTH + 1];
|
||||
@@ -237,4 +248,374 @@ void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RE
|
||||
p("Renewal interval policy : %u\n", (uint32_t)LE32(response->VLRenewalInterval));
|
||||
p("Activation interval policy : %u\n", (uint32_t)LE32(response->VLActivationInterval));
|
||||
}
|
||||
#endif // NO_VERBOSE_LOG
|
||||
|
||||
|
||||
#ifndef NO_VERSION_INFORMATION
|
||||
void printPlatform()
|
||||
{
|
||||
int testNumber = 0x1234;
|
||||
|
||||
# ifdef VLMCSD_COMPILER
|
||||
printf
|
||||
(
|
||||
"Compiler: %s\n", VLMCSD_COMPILER
|
||||
# ifdef __VERSION__
|
||||
" " __VERSION__
|
||||
# endif // __VERSION__
|
||||
);
|
||||
# endif // VLMCSD_COMPILER
|
||||
|
||||
printf
|
||||
(
|
||||
"Intended platform:%s %s\n", ""
|
||||
|
||||
# if __i386__ || _M_IX86
|
||||
" Intel x86"
|
||||
# endif
|
||||
|
||||
# if __x86_64__ || __amd64__ || _M_X64 || _M_AMD64
|
||||
" Intel x86_64"
|
||||
# endif
|
||||
|
||||
# if _M_ARM || __arm__
|
||||
" ARM"
|
||||
# endif
|
||||
|
||||
# if __thumb__
|
||||
" thumb"
|
||||
# endif
|
||||
|
||||
# if __aarch64__
|
||||
" ARM64"
|
||||
# endif
|
||||
|
||||
# if __hppa__
|
||||
" HP/PA RISC"
|
||||
# endif
|
||||
|
||||
# if __ia64__
|
||||
" Intel Itanium"
|
||||
# endif
|
||||
|
||||
# if __mips__
|
||||
" MIPS"
|
||||
# endif
|
||||
|
||||
# if defined(_MIPS_ARCH)
|
||||
" " _MIPS_ARCH
|
||||
# endif
|
||||
|
||||
# if __mips16
|
||||
" mips16"
|
||||
# endif
|
||||
|
||||
# if __mips_micromips
|
||||
" micromips"
|
||||
# endif
|
||||
|
||||
# if __ppc__ || __powerpc__
|
||||
" PowerPC"
|
||||
# endif
|
||||
|
||||
# if __powerpc64__ || __ppc64__
|
||||
" PowerPC64"
|
||||
# endif
|
||||
|
||||
# if __sparc__
|
||||
" SPARC"
|
||||
# endif
|
||||
|
||||
# if defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)
|
||||
" IBM S/390"
|
||||
# endif
|
||||
|
||||
# if __zarch__ || __s390x__
|
||||
" IBM z/Arch (S/390x)"
|
||||
# endif
|
||||
|
||||
# if __m68k__
|
||||
" Motorola 68k"
|
||||
# endif
|
||||
|
||||
# if __ANDROID__
|
||||
" Android"
|
||||
# endif
|
||||
|
||||
# if __ANDROID_API__
|
||||
" (API level " ANDROID_API_LEVEL ")"
|
||||
# endif
|
||||
|
||||
# if __FreeBSD__ || __FreeBSD_kernel__
|
||||
" FreeBSD"
|
||||
# endif
|
||||
|
||||
# if __NetBSD__
|
||||
" NetBSD"
|
||||
# endif
|
||||
|
||||
# if __OpenBSD__
|
||||
" OpenBSD"
|
||||
# endif
|
||||
|
||||
# if __DragonFly__
|
||||
" DragonFly BSD"
|
||||
# endif
|
||||
|
||||
# if defined(__CYGWIN__) && !defined(_WIN64)
|
||||
" Cygwin32"
|
||||
# endif
|
||||
|
||||
# if defined(__CYGWIN__) && defined(_WIN64)
|
||||
" Cygwin64"
|
||||
# endif
|
||||
|
||||
# if __GNU__
|
||||
" GNU"
|
||||
# endif
|
||||
|
||||
# if __gnu_hurd__
|
||||
" Hurd"
|
||||
# endif
|
||||
|
||||
# if __MACH__
|
||||
" Mach"
|
||||
# endif
|
||||
|
||||
# if __linux__
|
||||
" Linux"
|
||||
# endif
|
||||
|
||||
# if __APPLE__ && __MACH__
|
||||
" Darwin"
|
||||
# endif
|
||||
|
||||
# if __minix__
|
||||
" Minix"
|
||||
# endif
|
||||
|
||||
# if __QNX__
|
||||
" QNX"
|
||||
# endif
|
||||
|
||||
# if __svr4__ || __SVR4
|
||||
" SYSV R4"
|
||||
# endif
|
||||
|
||||
# if (defined(__sun__) || defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
|
||||
" Solaris"
|
||||
# endif
|
||||
|
||||
# if (defined(__sun__) || defined(sun) || defined(__sun)) && !defined(__SVR4) && !defined(__svr4__)
|
||||
" SunOS"
|
||||
# endif
|
||||
|
||||
# if defined(_WIN32) && !defined(_WIN64)
|
||||
" Windows32"
|
||||
# endif
|
||||
|
||||
# if defined(_WIN32) && defined(_WIN64)
|
||||
" Windows64"
|
||||
# endif
|
||||
|
||||
# if __MVS__ || __TOS_MVS__
|
||||
" z/OS"
|
||||
# endif
|
||||
|
||||
# if defined(__GLIBC__) && !defined(__UCLIBC__)
|
||||
" glibc"
|
||||
# endif
|
||||
|
||||
# if __UCLIBC__
|
||||
" uclibc"
|
||||
# endif
|
||||
|
||||
# if defined(__linux__) && !defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__ANDROID__) && !defined(__BIONIC__)
|
||||
" musl"
|
||||
# endif
|
||||
|
||||
//# if _MIPSEL || __MIPSEL__ || __ARMEL__ || __THUMBEL__
|
||||
// " little-endian"
|
||||
//# endif
|
||||
//
|
||||
//# if _MIPSEB || __MIPSEB__ || __ARMEB__ || __THUMBEB__
|
||||
// " big-endian"
|
||||
//# endif
|
||||
|
||||
# if __PIE__ || __pie__
|
||||
" PIE"
|
||||
# endif
|
||||
,
|
||||
*((uint8_t*)&testNumber) == 0x34 ? "little-endian" : "big-endian"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void printCommonFlags()
|
||||
{
|
||||
printf
|
||||
(
|
||||
"Common flags:%s\n",""
|
||||
|
||||
# ifdef NO_EXTENDED_PRODUCT_LIST
|
||||
" NO_EXTENDED_PRODUCT_LIST"
|
||||
# endif // NO_EXTENDED_PRODUCT_LIST
|
||||
|
||||
# ifdef NO_BASIC_PRODUCT_LIST
|
||||
" NO_BASIC_PRODUCT_LIST"
|
||||
# endif // NO_BASIC_PRODUCT_LIST
|
||||
|
||||
# ifdef USE_MSRPC
|
||||
" USE_MSRPC"
|
||||
# endif // USE_MSRPC
|
||||
|
||||
# ifdef _CRYPTO_OPENSSL
|
||||
" _CRYPTO_OPENSSL"
|
||||
# endif // _CRYPTO_OPENSSL
|
||||
|
||||
# ifdef _CRYPTO_POLARSSL
|
||||
" _CRYPTO_POLARSSL"
|
||||
# endif // _CRYPTO_POLARSSL
|
||||
|
||||
# ifdef _CRYPTO_WINDOWS
|
||||
" _CRYPTO_WINDOWS"
|
||||
# endif // _CRYPTO_WINDOWS
|
||||
|
||||
# if defined(_OPENSSL_SOFTWARE) && defined(_CRYPTO_OPENSSL)
|
||||
" _OPENSSL_SOFTWARE"
|
||||
# endif // _OPENSSL_SOFTWARE
|
||||
|
||||
# if defined(_USE_AES_FROM_OPENSSL) && defined(_CRYPTO_OPENSSL)
|
||||
" _USE_AES_FROM_OPENSSL"
|
||||
# endif // _USE_AES_FROM_OPENSSL
|
||||
|
||||
# if defined(_OPENSSL_NO_HMAC) && defined(_CRYPTO_OPENSSL)
|
||||
" OPENSSL_HMAC=0"
|
||||
# endif // _OPENSSL_NO_HMAC
|
||||
|
||||
# ifdef _PEDANTIC
|
||||
" _PEDANTIC"
|
||||
# endif // _PEDANTIC
|
||||
|
||||
# ifdef INCLUDE_BETAS
|
||||
" INCLUDE_BETAS"
|
||||
# endif // INCLUDE_BETAS
|
||||
|
||||
# if __minix__ || defined(NO_TIMEOUT)
|
||||
" NO_TIMEOUT=1"
|
||||
# endif // __minix__ || defined(NO_TIMEOUT)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void printClientFlags()
|
||||
{
|
||||
printf
|
||||
(
|
||||
"vlmcs flags:%s\n",""
|
||||
|
||||
# ifdef NO_DNS
|
||||
" NO_DNS=1"
|
||||
# endif
|
||||
|
||||
# if !defined(NO_DNS)
|
||||
# if defined(DNS_PARSER_INTERNAL) && !defined(_WIN32)
|
||||
" DNS_PARSER=internal"
|
||||
# else // !defined(DNS_PARSER_INTERNAL) || defined(_WIN32)
|
||||
" DNS_PARSER=OS"
|
||||
# endif // !defined(DNS_PARSER_INTERNAL) || defined(_WIN32)
|
||||
# endif // !defined(NO_DNS)
|
||||
|
||||
# if defined(DISPLAY_WIDTH)
|
||||
" TERMINAL_WIDTH=" DISPLAY_WIDTH
|
||||
# endif
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void printServerFlags()
|
||||
{
|
||||
printf
|
||||
(
|
||||
"vlmcsd flags:%s\n",""
|
||||
|
||||
# ifdef NO_LOG
|
||||
" NO_LOG"
|
||||
# endif // NO_LOG
|
||||
|
||||
# ifdef NO_RANDOM_EPID
|
||||
" NO_RANDOM_EPID"
|
||||
# endif // NO_RANDOM_EPID
|
||||
|
||||
# ifdef NO_INI_FILE
|
||||
" NO_INI_FILE"
|
||||
# endif // NO_INI_FILE
|
||||
|
||||
# if !defined(NO_INI_FILE) && defined(INI_FILE)
|
||||
" INI=" INI_FILE
|
||||
# endif // !defined(NO_INI_FILE)
|
||||
|
||||
# ifdef NO_PID_FILE
|
||||
" NO_PID_FILE"
|
||||
# endif // NO_PID_FILE
|
||||
|
||||
# ifdef NO_USER_SWITCH
|
||||
" NO_USER_SWITCH"
|
||||
# endif // NO_USER_SWITCH
|
||||
|
||||
# ifdef NO_HELP
|
||||
" NO_HELP"
|
||||
# endif // NO_HELP
|
||||
|
||||
# ifdef NO_CUSTOM_INTERVALS
|
||||
" NO_CUSTOM_INTERVALS"
|
||||
# endif // NO_CUSTOM_INTERVALS
|
||||
|
||||
# ifdef NO_SOCKETS
|
||||
" NO_SOCKETS"
|
||||
# endif // NO_SOCKETS
|
||||
|
||||
# ifdef NO_CL_PIDS
|
||||
" NO_CL_PIDS"
|
||||
# endif // NO_CL_PIDS
|
||||
|
||||
# ifdef NO_LIMIT
|
||||
" NO_LIMIT"
|
||||
# endif // NO_LIMIT
|
||||
|
||||
# ifdef NO_SIGHUP
|
||||
" NO_SIGHUP"
|
||||
# endif // NO_SIGHUP
|
||||
|
||||
# ifdef NO_PROCFS
|
||||
" NOPROCFS=1"
|
||||
# endif // NO_PROCFS
|
||||
|
||||
# ifdef USE_THREADS
|
||||
" THREADS=1"
|
||||
# endif // USE_THREADS
|
||||
|
||||
# ifdef USE_AUXV
|
||||
" AUXV=1"
|
||||
# endif // USE_AUXV
|
||||
|
||||
# if defined(CHILD_HANDLER) || __minix__
|
||||
" CHILD_HANDLER=1"
|
||||
# endif // defined(CHILD_HANDLER) || __minix__
|
||||
|
||||
# if !defined(NO_SOCKETS) && defined(SIMPLE_SOCKETS)
|
||||
" SIMPLE_SOCKETS"
|
||||
# endif // !defined(NO_SOCKETS) && defined(SIMPLE_SOCKETS)
|
||||
|
||||
# if (_WIN32 || __CYGWIN__) && (!defined(USE_MSRPC) || defined(SUPPORT_WINE))
|
||||
" SUPPORT_WINE"
|
||||
# endif // (_WIN32 || __CYGWIN__) && (!defined(USE_MSRPC) || defined(SUPPORT_WINE))
|
||||
|
||||
# if !HAVE_FREEBIND
|
||||
" NO_FREEBIND"
|
||||
# endif //!HAVE_FREEBIND
|
||||
|
||||
);
|
||||
}
|
||||
#endif // NO_VERSION_INFORMATION
|
||||
|
||||
Reference in New Issue
Block a user