Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrejs Tumilovics <andrejs.tumilovics@zabbix.com>2019-12-11 11:58:27 +0300
committerAndrejs Tumilovics <andrejs.tumilovics@zabbix.com>2019-12-11 11:58:27 +0300
commitb2489e1ecae5260f34ff5025c6e25438ab8d1a82 (patch)
tree32bff7f20ac617a79275e05ef5a0c6769c159523 /include
parent22ce36a46da278cc87052c3e28f03962fe6e1f45 (diff)
parent72a569f0928fb8676bebc4c99c9acc2c0cb96a46 (diff)
.......... [ZBXNEXT-1085] merge from source branch (fixed .gitignore conflicts)
Diffstat (limited to 'include')
-rw-r--r--include/common.h12
-rw-r--r--include/dbcache.h1
-rw-r--r--include/perfmon.h2
-rw-r--r--include/symbols.h2
-rw-r--r--include/sysinfo.h8
-rw-r--r--include/threads.h4
-rw-r--r--include/zbxcrypto.h44
-rw-r--r--include/zbxtypes.h31
8 files changed, 77 insertions, 27 deletions
diff --git a/include/common.h b/include/common.h
index f82f5d98e7e..b17d1b3de58 100644
--- a/include/common.h
+++ b/include/common.h
@@ -25,6 +25,11 @@
#include "version.h"
#include "md5.h"
+#if defined(__MINGW32__)
+# define __try
+# define __except(x) if (0)
+#endif
+
#ifndef va_copy
# if defined(__va_copy)
# define va_copy(d, s) __va_copy(d, s)
@@ -1181,7 +1186,7 @@ void uint64_array_remove(zbx_uint64_t *values, int *num, const zbx_uint64_t *rm_
const char *zbx_event_value_string(unsigned char source, unsigned char object, unsigned char value);
-#ifdef _WINDOWS
+#if defined(_WINDOWS) || defined(__MINGW32__)
const OSVERSIONINFOEX *zbx_win_getversion(void);
void zbx_wmi_get(const char *wmi_namespace, const char *wmi_query, char **utf8_value);
wchar_t *zbx_acp_to_unicode(const char *acp_string);
@@ -1194,7 +1199,7 @@ int _wis_uint(const wchar_t *wide_string);
#endif
void zbx_strlower(char *str);
void zbx_strupper(char *str);
-#if defined(_WINDOWS) || defined(HAVE_ICONV)
+#if defined(_WINDOWS) || defined(__MINGW32__) || defined(HAVE_ICONV)
char *convert_to_utf8(char *in, size_t in_size, const char *encoding);
#endif /* HAVE_ICONV */
#define ZBX_MAX_BYTES_IN_UTF8_CHAR 4
@@ -1342,6 +1347,7 @@ int zbx_strcmp_natural(const char *s1, const char *s2);
#define ZBX_TOKEN_XPATH 0x080000
#define ZBX_TOKEN_REGEXP_OUTPUT 0x100000
#define ZBX_TOKEN_PROMETHEUS 0x200000
+#define ZBX_TOKEN_JSONPATH 0x400000
/* location of a substring */
typedef struct
@@ -1558,7 +1564,7 @@ char *zbx_create_token(zbx_uint64_t seed);
int zbx_variant_to_value_type(zbx_variant_t *value, unsigned char value_type, char **errmsg);
-#ifdef _WINDOWS
+#if defined(_WINDOWS) || defined(__MINGW32__)
#define ZBX_PCRE_RECURSION_LIMIT 2000 /* assume ~1 MB stack and ~500 bytes per recursion */
#endif
diff --git a/include/dbcache.h b/include/dbcache.h
index 7e3e9c891ff..e581684a787 100644
--- a/include/dbcache.h
+++ b/include/dbcache.h
@@ -710,6 +710,7 @@ int DCget_host_inventory_value_by_hostid(zbx_uint64_t hostid, char **replace_to,
void *DCconfig_get_stats(int request);
int DCconfig_get_last_sync_time(void);
+void DCconfig_wait_sync(void);
int DCconfig_get_proxypoller_hosts(DC_PROXY *proxies, int max_hosts);
int DCconfig_get_proxypoller_nextcheck(void);
diff --git a/include/perfmon.h b/include/perfmon.h
index 128e4ed13c8..e45a706177b 100644
--- a/include/perfmon.h
+++ b/include/perfmon.h
@@ -20,7 +20,7 @@
#ifndef ZABBIX_PERFMON_H
#define ZABBIX_PERFMON_H
-#ifndef _WINDOWS
+#if !defined(_WINDOWS) && !defined(__MINGW32__)
# error "This module is only available for Windows OS"
#endif
diff --git a/include/symbols.h b/include/symbols.h
index 6863b45aca9..600e825c043 100644
--- a/include/symbols.h
+++ b/include/symbols.h
@@ -20,7 +20,7 @@
#ifndef ZABBIX_SYMBOLS_H
#define ZABBIX_SYMBOLS_H
-#if defined(_WINDOWS)
+#if defined(_WINDOWS) || defined(__MINGW32__)
/* some definitions which are not available on older MS Windows versions */
typedef enum {
diff --git a/include/sysinfo.h b/include/sysinfo.h
index 2e9a0c36f7d..32128c331fd 100644
--- a/include/sysinfo.h
+++ b/include/sysinfo.h
@@ -141,7 +141,7 @@ extern int CONFIG_UNSAFE_USER_PARAMETERS;
#define ZBX_AVG15 2
#define ZBX_AVG_COUNT 3
-#ifdef _WINDOWS
+#if defined(_WINDOWS)
# define MAX_COLLECTOR_PERIOD (15 * SEC_PER_MIN)
#endif
@@ -283,7 +283,7 @@ int VFS_FS_SIZE(AGENT_REQUEST *request, AGENT_RESULT *result);
int VFS_FS_DISCOVERY(AGENT_REQUEST *request, AGENT_RESULT *result);
int VM_MEMORY_SIZE(AGENT_REQUEST *request, AGENT_RESULT *result);
-#ifdef _WINDOWS
+#if defined(_WINDOWS) || defined(__MINGW32__)
int USER_PERF_COUNTER(AGENT_REQUEST *request, AGENT_RESULT *result);
int PERF_COUNTER(AGENT_REQUEST *request, AGENT_RESULT *result);
int PERF_COUNTER_EN(AGENT_REQUEST *request, AGENT_RESULT *result);
@@ -302,7 +302,7 @@ int VM_VMEMORY_SIZE(AGENT_REQUEST *request, AGENT_RESULT *result);
int SYSTEM_STAT(AGENT_REQUEST *request, AGENT_RESULT *result);
#endif
-#ifdef _WINDOWS
+#if defined(_WINDOWS) || defined(__MINGW32__)
typedef int (*zbx_metric_func_t)(AGENT_REQUEST *request, AGENT_RESULT *result, HANDLE timeout_event);
#else
typedef int (*zbx_metric_func_t)(AGENT_REQUEST *request, AGENT_RESULT *result);
@@ -324,7 +324,7 @@ int zbx_execute_threaded_metric(zbx_metric_func_t metric_func, AGENT_REQUEST *re
#define ZBX_SYSINFO_PROC_CMDLINE 0x0004
#define ZBX_SYSINFO_PROC_USER 0x0008
-#ifdef _WINDOWS
+#if defined(_WINDOWS) || defined(__MINGW32__)
#define ZBX_MUTEX_ALL_ALLOW 0
#define ZBX_MUTEX_THREAD_DENIED 1
#define ZBX_MUTEX_LOGGING_DENIED 2
diff --git a/include/threads.h b/include/threads.h
index c3b6d451ead..304cca93ecd 100644
--- a/include/threads.h
+++ b/include/threads.h
@@ -22,7 +22,7 @@
#include "common.h"
-#if defined(_WINDOWS)
+#if defined(_WINDOWS) || defined(__MINGW32__)
/* the ZBXEndThread function is implemented in service.c file */
void CALLBACK ZBXEndThread(ULONG_PTR dwParam);
@@ -82,7 +82,7 @@ typedef struct
int process_num;
unsigned char process_type;
void *args;
-#ifdef _WINDOWS
+#if defined(_WINDOWS) || defined(__MINGW32__)
ZBX_THREAD_ENTRY_POINTER(entry);
#endif
}
diff --git a/include/zbxcrypto.h b/include/zbxcrypto.h
new file mode 100644
index 00000000000..1916e7b83ad
--- /dev/null
+++ b/include/zbxcrypto.h
@@ -0,0 +1,44 @@
+/*
+** Zabbix
+** Copyright (C) 2001-2019 Zabbix SIA
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+**/
+
+#ifndef ZABBIX_ZBXCRYPTO_H
+#define ZABBIX_ZBXCRYPTO_H
+
+#if defined(HAVE_POLARSSL) || defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
+
+#if defined(_WINDOWS)
+
+typedef struct zbx_thread_sendval_tls_args ZBX_THREAD_SENDVAL_TLS_ARGS;
+
+void zbx_tls_pass_vars(ZBX_THREAD_SENDVAL_TLS_ARGS *args);
+void zbx_tls_take_vars(ZBX_THREAD_SENDVAL_TLS_ARGS *args);
+
+#endif /* #if defined(_WINDOWS) */
+
+void zbx_tls_validate_config(void);
+void zbx_tls_library_deinit(void);
+void zbx_tls_init_parent(void);
+void zbx_tls_init_child(void);
+void zbx_tls_free(void);
+void zbx_tls_free_on_signal(void);
+void zbx_tls_version(void);
+
+#endif /* #if defined(HAVE_POLARSSL) || defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL) */
+
+#endif /* ZABBIX_DISK_H */
diff --git a/include/zbxtypes.h b/include/zbxtypes.h
index 4007906c095..230c898d3a5 100644
--- a/include/zbxtypes.h
+++ b/include/zbxtypes.h
@@ -23,23 +23,28 @@
#if defined(_WINDOWS)
# define ZBX_THREAD_LOCAL __declspec(thread)
#else
-# if defined(__GNUC__) || defined(__clang__)
+# if defined(HAVE_THREAD_LOCAL) && (defined(__GNUC__) || defined(__clang__) || defined(__MINGW32__))
# define ZBX_THREAD_LOCAL __thread
# else
# define ZBX_THREAD_LOCAL
# endif
#endif
-#define ZBX_FS_DBL "%lf"
-#define ZBX_FS_DBL_EXT(p) "%." #p "lf"
-
-#define ZBX_PTR_SIZE sizeof(void *)
+#if defined(_WINDOWS)
+# define zbx_open(pathname, flags) __zbx_open(pathname, flags | O_BINARY)
+# define PATH_SEPARATOR '\\'
+#elif defined(__MINGW32__)
+# define zbx_open(pathname, flags) open(pathname, flags | O_BINARY)
+# define PATH_SEPARATOR '\\'
+#else
+# define zbx_open(pathname, flags) open(pathname, flags)
+# define PATH_SEPARATOR '/'
+#endif
#if defined(_WINDOWS)
# include <strsafe.h>
# define zbx_stat(path, buf) __zbx_stat(path, buf)
-# define zbx_open(pathname, flags) __zbx_open(pathname, flags | O_BINARY)
# ifndef __UINT64_C
# define __UINT64_C(x) x
@@ -69,19 +74,13 @@ typedef unsigned __int32 zbx_uint32_t;
typedef uint32_t zbx_uint32_t;
# endif
-# ifndef PATH_SEPARATOR
-# define PATH_SEPARATOR '\\'
-# endif
-
# define strcasecmp lstrcmpiA
typedef __int64 zbx_offset_t;
# define zbx_lseek(fd, offset, whence) _lseeki64(fd, (zbx_offset_t)(offset), whence)
#else /* _WINDOWS */
-
# define zbx_stat(path, buf) stat(path, buf)
-# define zbx_open(pathname, flags) open(pathname, flags)
# ifndef __UINT64_C
# ifdef UINT64_C
@@ -147,15 +146,15 @@ typedef __int64 zbx_offset_t;
typedef uint32_t zbx_uint32_t;
-# ifndef PATH_SEPARATOR
-# define PATH_SEPARATOR '/'
-# endif
-
typedef off_t zbx_offset_t;
# define zbx_lseek(fd, offset, whence) lseek(fd, (zbx_offset_t)(offset), whence)
#endif /* _WINDOWS */
+#define ZBX_FS_DBL "%lf"
+#define ZBX_FS_DBL_EXT(p) "%." #p "lf"
+
+#define ZBX_PTR_SIZE sizeof(void *)
#define ZBX_FS_SIZE_T ZBX_FS_UI64
#define ZBX_FS_SSIZE_T ZBX_FS_I64
#define ZBX_FS_TIME_T ZBX_FS_I64