Added support for XNVCTRL on Linux to add support for --gpu-temp-retain for NVidia GPU
[hashcat.git] / include / common.h
index 680ddbe..be7ea98 100644 (file)
@@ -1,5 +1,7 @@
 /**
- * Author......: Jens Steube <jens.steube@gmail.com>
+ * Authors.....: Jens Steube <jens.steube@gmail.com>
+ *               magnum <john.magnum@hushmail.com>
+ *
  * License.....: MIT
  */
 
@@ -28,6 +30,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <search.h>
+#include <fcntl.h>
 
 #ifdef _POSIX
 #include <sys/time.h>
 #include <termios.h>
 #include <sys/ioctl.h>
 #include <mach-o/dyld.h>
+#include <mach/mach.h>
 #endif
 
 typedef void *OCL_LIB;
 
 #ifdef HAVE_HWMON
-typedef void *HM_LIB;
+typedef void *ADL_LIB;
+typedef void *NVAPI_LIB;
+typedef void *NVML_LIB;
+typedef void *XNVCTRL_LIB;
+#ifdef OSX
+#define __stdcall
+#endif
 #endif
 
 #endif // _POSIX
@@ -62,7 +72,6 @@ typedef void *HM_LIB;
 #include <tchar.h>
 #include <psapi.h>
 #include <io.h>
-#include <fcntl.h>
 
 typedef UINT8  uint8_t;
 typedef UINT16 uint16_t;
@@ -76,12 +85,15 @@ typedef INT64  int64_t;
 typedef UINT32 uint;
 typedef UINT64 uint64_t;
 
+typedef HINSTANCE OCL_LIB;
+
 #ifdef HAVE_HWMON
-typedef HINSTANCE HM_LIB;
+typedef HINSTANCE ADL_LIB;
+typedef HINSTANCE NVAPI_LIB;
+typedef HINSTANCE NVML_LIB;
+typedef HINSTANCE XNVCTRL_LIB;
 #endif
 
-typedef HINSTANCE OCL_LIB;
-
 #define mkdir(name,mode) mkdir (name)
 
 #endif // _WIN
@@ -93,11 +105,14 @@ typedef uint64_t u64;
 
 typedef uint32_t uint; // we need to get rid of this sooner or later, for consistency
 
-#define SPEED_CACHE  128
-#define SPEED_MAXAGE 4096
+#define EXEC_CACHE    128
+
+#define SPEED_CACHE   128
+#define SPEED_MAXAGE  4096
 
-#undef  BUFSIZ
-#define BUFSIZ 8192
+#define HCBUFSIZ      0x50000 // general large space buffer size in case the size is unknown at compile-time
+
+#define EXPECTED_ITERATIONS 10000
 
 /**
  * functions
@@ -114,4 +129,6 @@ void log_error (const char *fmt, ...);
 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
 
+#define CEIL(a) ((a - (int) (a)) > 0 ? a + 1 : a)
+
 #endif // COMMON_H