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:
authorAleksejs Sestakovs <aleksejs.sestakovs@zabbix.com>2020-05-14 14:23:19 +0300
committerAleksejs Sestakovs <aleksejs.sestakovs@zabbix.com>2020-05-14 19:32:44 +0300
commite9c77c3ac92b778d11ddfa5332d902444520c59c (patch)
treed68e8a6c1bca2cc144126cf48f00d31604698bdc /include/module.h
parenta9b4dd47298560d5bbcacf11d44145b3a50e3b48 (diff)
........S. [ZBX-17109] fixed agent request parameter type parsing
* commit '74f8cf0064f9412d1372c3badd99c58caab97702': ........S. [ZBX-17109] fixed windows agent build ........S. [ZBX-17109] minor review comments: type casts and error messages ........S. [ZBX-17109] fixed agent request parameter type parsing (cherry picked from commit 4c1f38468834a18defe5aeb1be6ea7c70b08a58f) (cherry picked from commit 6d132d978996ee2b1b566a3e0bdba875ce5e9d57) (cherry picked from commit d8cc869c8312f70bba24f2bf4af87908aaae7667)
Diffstat (limited to 'include/module.h')
-rw-r--r--include/module.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/include/module.h b/include/module.h
index 4cf6772157a..a8c8c070122 100644
--- a/include/module.h
+++ b/include/module.h
@@ -39,20 +39,31 @@
#define get_rkey(request) (request)->key
#define get_rparams_num(request) (request)->nparam
#define get_rparam(request, num) ((request)->nparam > num ? (request)->params[num] : NULL)
+#define get_rparam_type(request, num) ((request)->nparam > num ? (request)->types[num] : \
+ REQUEST_PARAMETER_TYPE_UNDEFINED)
/* flags for command */
#define CF_HAVEPARAMS 0x01 /* item accepts either optional or mandatory parameters */
#define CF_MODULE 0x02 /* item is defined in a loadable module */
#define CF_USERPARAMETER 0x04 /* item is defined as user parameter */
+typedef enum
+{
+ REQUEST_PARAMETER_TYPE_UNDEFINED = 0,
+ REQUEST_PARAMETER_TYPE_STRING,
+ REQUEST_PARAMETER_TYPE_ARRAY
+}
+zbx_request_parameter_type_t;
+
/* agent request structure */
typedef struct
{
- char *key;
- int nparam;
- char **params;
- zbx_uint64_t lastlogsize;
- int mtime;
+ char *key;
+ int nparam;
+ char **params;
+ zbx_uint64_t lastlogsize;
+ int mtime;
+ zbx_request_parameter_type_t *types;
}
AGENT_REQUEST;