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 Kozlovs <andrejs.kozlovs@zabbix.com>2022-11-09 10:54:18 +0300
committerAndrejs Kozlovs <andrejs.kozlovs@zabbix.com>2022-11-09 10:54:18 +0300
commit39d00691a0a0af2b4de3dfc33a2509e773478f8e (patch)
tree861173b9f07cb6c4c562a6f2fa3190b01d4895b2 /include
parent5887066f5624d9a8d4af3f836fae505569ad8aad (diff)
parentd136fbbbe6cd01ae26c017e4750ce2b830a907ee (diff)
.......... [DEV-2135] updated from branch 'master' of ssh://git.zabbix.com:7999/zbx/zabbix into feature/DEV-2135-6.3-1
Diffstat (limited to 'include')
-rw-r--r--include/disk.h31
-rw-r--r--include/version.h4
-rw-r--r--include/zbxcommon.h1
-rw-r--r--include/zbxjson.h46
-rw-r--r--include/zbxwin32.h (renamed from include/perfmon.h)37
-rw-r--r--include/zbxwinservice.h7
6 files changed, 74 insertions, 52 deletions
diff --git a/include/disk.h b/include/disk.h
deleted file mode 100644
index e544863e612..00000000000
--- a/include/disk.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-** Zabbix
-** Copyright (C) 2001-2022 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_DISK_H
-#define ZABBIX_DISK_H
-
-#include "config.h"
-
-#if !defined(_WINDOWS) && !defined(__MINGW32__)
-# error "This module is only available for Windows OS"
-#endif
-
-zbx_uint64_t get_cluster_size(const char *path, char **error);
-
-#endif /* ZABBIX_DISK_H */
diff --git a/include/version.h b/include/version.h
index 58d48bd2281..24140d612fc 100644
--- a/include/version.h
+++ b/include/version.h
@@ -24,7 +24,7 @@
#define ZBX_STR(str) ZBX_STR2(str)
#define APPLICATION_NAME "Zabbix Agent"
-#define ZABBIX_REVDATE "27 October 2022"
+#define ZABBIX_REVDATE "8 November 2022"
#define ZABBIX_VERSION_MAJOR 6
#define ZABBIX_VERSION_MINOR 4
#define ZABBIX_VERSION_PATCH 0
@@ -36,7 +36,7 @@
# define ZABBIX_VERSION_RC_NUM {ZABBIX_RC_NUM}
# endif
#endif
-#define ZABBIX_VERSION_RC "beta3"
+#define ZABBIX_VERSION_RC "beta4"
#define ZABBIX_VERSION ZBX_STR(ZABBIX_VERSION_MAJOR) "." ZBX_STR(ZABBIX_VERSION_MINOR) "." \
ZBX_STR(ZABBIX_VERSION_PATCH) ZABBIX_VERSION_RC
#define ZABBIX_REVISION ZBX_STR(ZABBIX_VERSION_REVISION)
diff --git a/include/zbxcommon.h b/include/zbxcommon.h
index a950e280195..284cffb1286 100644
--- a/include/zbxcommon.h
+++ b/include/zbxcommon.h
@@ -834,6 +834,7 @@ void zbx_version(void);
const char *get_program_name(const char *path);
typedef unsigned char (*zbx_get_program_type_f)(void);
+typedef const char *(*zbx_get_progname_f)(void);
typedef enum
{
diff --git a/include/zbxjson.h b/include/zbxjson.h
index 28ed6fd68a6..e5c91376b14 100644
--- a/include/zbxjson.h
+++ b/include/zbxjson.h
@@ -21,6 +21,7 @@
#define ZABBIX_ZJSON_H
#include "zbxtypes.h"
+#include "zbxalgo.h"
#define ZBX_PROTO_TAG_CLOCK "clock"
#define ZBX_PROTO_TAG_NS "ns"
@@ -250,7 +251,8 @@ typedef enum
ZBX_JSON_TYPE_OBJECT,
ZBX_JSON_TYPE_NULL,
ZBX_JSON_TYPE_TRUE,
- ZBX_JSON_TYPE_FALSE
+ ZBX_JSON_TYPE_FALSE,
+ ZBX_JSON_TYPE_NUMBER
}
zbx_json_type_t;
@@ -330,11 +332,51 @@ typedef struct
/* set to 1 when jsonpath points at single location */
unsigned char definite;
+ unsigned char first_match; /* set to 1 if first match must be returned */
}
zbx_jsonpath_t;
-void zbx_jsonpath_clear(zbx_jsonpath_t *jsonpath);
+typedef struct zbx_jsonobj zbx_jsonobj_t;
+
+ZBX_PTR_VECTOR_DECL(jsonobj_ptr, zbx_jsonobj_t *)
+
+typedef union
+{
+ char *string;
+ double number;
+ zbx_hashset_t object;
+ zbx_vector_jsonobj_ptr_t array;
+}
+zbx_jsonobj_data_t;
+
+typedef struct
+{
+ char *path; /* the path that was indexed - for example @.a.b.c */
+ zbx_hashset_t objects;
+}
+zbx_jsonobj_index_t;
+
+struct zbx_jsonobj
+{
+ zbx_json_type_t type;
+ zbx_jsonobj_data_t data;
+ zbx_jsonobj_index_t *index;
+};
+
+typedef struct
+{
+ char *name;
+ zbx_jsonobj_t value;
+}
+zbx_jsonobj_el_t;
+
int zbx_jsonpath_compile(const char *path, zbx_jsonpath_t *jsonpath);
int zbx_jsonpath_query(const struct zbx_json_parse *jp, const char *path, char **output);
+void zbx_jsonpath_clear(zbx_jsonpath_t *jsonpath);
+
+int zbx_jsonobj_open(const char *data, zbx_jsonobj_t *obj);
+void zbx_jsonobj_clear(zbx_jsonobj_t *obj);
+int zbx_jsonobj_query(zbx_jsonobj_t *obj, const char *path, char **output);
+int zbx_jsonobj_to_string(char **str, size_t *str_alloc, size_t *str_offset, zbx_jsonobj_t *obj);
#endif /* ZABBIX_ZJSON_H */
diff --git a/include/perfmon.h b/include/zbxwin32.h
index c52c85a2f9b..a8382c38d17 100644
--- a/include/perfmon.h
+++ b/include/zbxwin32.h
@@ -17,15 +17,21 @@
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
-#ifndef ZABBIX_PERFMON_H
-#define ZABBIX_PERFMON_H
+#ifndef ZABBIX_WIN32_H
+#define ZABBIX_WIN32_H
+#include "config.h"
#include "zbxsysinc.h"
+#include "zbxtypes.h"
+#include "zbxcommon.h"
#if !defined(_WINDOWS) && !defined(__MINGW32__)
# error "This module is only available for Windows OS"
#endif
+#define zbx_get_builtin_object_name(ctr) zbx_get_counter_name(zbx_get_builtin_object_index(ctr))
+#define zbx_get_builtin_counter_name(ctr) zbx_get_counter_name(zbx_get_builtin_counter_index(ctr))
+
/* this struct must be only modified along with mapping builtin_counter_ref[] in perfmon.c */
typedef enum
{
@@ -80,22 +86,27 @@ typedef struct perf_counter_data
}
zbx_perf_counter_data_t;
+zbx_uint64_t zbx_get_cluster_size(const char *path, char **error);
+
PDH_STATUS zbx_PdhMakeCounterPath(const char *function, PDH_COUNTER_PATH_ELEMENTS *cpe, char *counterpath);
PDH_STATUS zbx_PdhOpenQuery(const char *function, PDH_HQUERY query);
PDH_STATUS zbx_PdhAddCounter(const char *function, zbx_perf_counter_data_t *counter, PDH_HQUERY query,
const char *counterpath, zbx_perf_counter_lang_t lang, PDH_HCOUNTER *handle);
PDH_STATUS zbx_PdhCollectQueryData(const char *function, const char *counterpath, PDH_HQUERY query);
-PDH_STATUS zbx_PdhGetRawCounterValue(const char *function, const char *counterpath, PDH_HCOUNTER handle, PPDH_RAW_COUNTER value);
+PDH_STATUS zbx_PdhGetRawCounterValue(const char *function, const char *counterpath, PDH_HCOUNTER handle,
+ PPDH_RAW_COUNTER value);
+
+PDH_STATUS zbx_calculate_counter_value(const char *function, const char *counterpath,
+ zbx_perf_counter_lang_t lang, double *value);
+wchar_t *zbx_get_counter_name(DWORD pdhIndex);
+int zbx_check_counter_path(char *counterPath, int convert_from_numeric);
+int zbx_init_builtin_counter_indexes(void);
+DWORD zbx_get_builtin_object_index(zbx_builtin_counter_ref_t counter_ref);
+DWORD zbx_get_builtin_counter_index(zbx_builtin_counter_ref_t counter_ref);
+wchar_t *zbx_get_all_counter_names(HKEY reg_key, wchar_t *reg_value_name);
-PDH_STATUS calculate_counter_value(const char *function, const char *counterpath, zbx_perf_counter_lang_t lang, double *value);
-wchar_t *get_counter_name(DWORD pdhIndex);
-int check_counter_path(char *counterPath, int convert_from_numeric);
-int init_builtin_counter_indexes(void);
-DWORD get_builtin_object_index(zbx_builtin_counter_ref_t counter_ref);
-DWORD get_builtin_counter_index(zbx_builtin_counter_ref_t counter_ref);
-wchar_t *get_all_counter_names(HKEY reg_key, wchar_t *reg_value_name);
+int zbx_win_exception_filter(struct _EXCEPTION_POINTERS *ep);
-#define get_builtin_object_name(ctr) get_counter_name(get_builtin_object_index(ctr))
-#define get_builtin_counter_name(ctr) get_counter_name(get_builtin_counter_index(ctr))
+void zbx_init_library_win32(zbx_get_progname_f get_progname);
-#endif /* ZABBIX_PERFMON_H */
+#endif /* ZABBIX_WIN32_H */
diff --git a/include/zbxwinservice.h b/include/zbxwinservice.h
index 9ac2e3b866f..4313b585ec0 100644
--- a/include/zbxwinservice.h
+++ b/include/zbxwinservice.h
@@ -26,17 +26,16 @@
#include "zbxthreads.h"
-extern ZBX_THREAD_HANDLE *threads;
+typedef void (*zbx_on_exit_t)(int);
-void service_start(int flags);
+void zbx_service_start(int flags);
int ZabbixCreateService(const char *path, int multiple_agents, const char *config_file);
int ZabbixRemoveService(void);
int ZabbixStartService(void);
int ZabbixStopService(void);
-typedef void (*zbx_on_exit_t)(int);
-void set_parent_signal_handler(zbx_on_exit_t zbx_on_exit_cb_arg);
+void zbx_set_parent_signal_handler(zbx_on_exit_t zbx_on_exit_cb_arg);
int ZBX_IS_RUNNING(void);
void ZBX_DO_EXIT(void);