diff options
author | Andrejs Kozlovs <andrejs.kozlovs@zabbix.com> | 2021-08-16 16:45:31 +0300 |
---|---|---|
committer | Andrejs Kozlovs <andrejs.kozlovs@zabbix.com> | 2021-08-16 16:45:31 +0300 |
commit | 8062e5ab0b7a8fde2a6fba289029dd5510bb0bf1 (patch) | |
tree | 2194e4baca4d81002c7bf5d26a87deb4c999be0b /src/libs/zbxaudit/audit_host.h | |
parent | 01bccf90f2882280eaff1cfe75400208af4d4be3 (diff) | |
parent | 6b144379fcbaed9351cbb14fe8da30301440c96c (diff) |
........S. [ZBXNEXT-6810] Update from branch 'feature/ZBXNEXT-6802-5.5' of https://git.zabbix.com/scm/zbx/zabbix into feature/ZBXNEXT-6810-5.5-test
Diffstat (limited to 'src/libs/zbxaudit/audit_host.h')
-rw-r--r-- | src/libs/zbxaudit/audit_host.h | 94 |
1 files changed, 60 insertions, 34 deletions
diff --git a/src/libs/zbxaudit/audit_host.h b/src/libs/zbxaudit/audit_host.h index 9787b99c468..6f177230cf8 100644 --- a/src/libs/zbxaudit/audit_host.h +++ b/src/libs/zbxaudit/audit_host.h @@ -24,12 +24,12 @@ #include "dbcache.h" #include "audit.h" -#define PREPARE_AUDIT_SNMP_INTERFACE_H(resource) \ -void zbx_audit_##resource##_update_json_add_snmp_interface(zbx_uint64_t hostid, zbx_uint64_t version, \ +#define PREPARE_AUDIT_SNMP_INTERFACE_H(funcname) \ +void zbx_audit_##funcname##_update_json_add_snmp_interface(zbx_uint64_t hostid, zbx_uint64_t version, \ zbx_uint64_t bulk, const char *community, const char *securityname, zbx_uint64_t securitylevel, \ const char *authpassphrase, const char *privpassphrase, zbx_uint64_t authprotocol, \ zbx_uint64_t privprotocol, const char *contextname, zbx_uint64_t interfaceid); \ -void zbx_audit_##resource##_update_json_update_snmp_interface(zbx_uint64_t hostid, zbx_uint64_t version_old, \ +void zbx_audit_##funcname##_update_json_update_snmp_interface(zbx_uint64_t hostid, zbx_uint64_t version_old, \ zbx_uint64_t version_new, zbx_uint64_t bulk_old, zbx_uint64_t bulk_new, \ const char *community_old, const char *community_new, const char *securityname_old, \ const char *securityname_new, zbx_uint64_t securitylevel_old, zbx_uint64_t securitylevel_new, \ @@ -51,32 +51,32 @@ void zbx_audit_host_update_json_update_inventory_mode(zbx_uint64_t hostid, int i void zbx_audit_host_update_json_update_host_status(zbx_uint64_t hostid, int host_status_old, int host_status_new); -#define PREPARE_AUDIT_HOST_INTERFACE_H(resource, interface_resource, type1, type2) \ -void zbx_audit_##resource##_update_json_update_interface_##interface_resource(zbx_uint64_t hostid, \ +#define PREPARE_AUDIT_HOST_INTERFACE_H(funcname, interface_resource, type1) \ +void zbx_audit_##funcname##_update_json_update_interface_##interface_resource(zbx_uint64_t hostid, \ zbx_uint64_t interfaceid, type1 interface_resource##_old, type1 interface_resource##_new); \ -#define PREPARE_AUDIT_HOST_H(resource, audit_resource_flag) \ -void zbx_audit_##resource##_create_entry(int audit_action, zbx_uint64_t hostid, const char *name); \ -void zbx_audit_##resource##_update_json_add_interfaces(zbx_uint64_t hostid, zbx_uint64_t interfaceid, \ +#define PREPARE_AUDIT_HOST_H(funcname, audit_resource_flag) \ +void zbx_audit_##funcname##_create_entry(int audit_action, zbx_uint64_t hostid, const char *name); \ +void zbx_audit_##funcname##_update_json_add_interfaces(zbx_uint64_t hostid, zbx_uint64_t interfaceid, \ zbx_uint64_t main_, zbx_uint64_t type, zbx_uint64_t useip, const char *ip, const char *dns, \ int port); \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, useip, zbx_uint64_t, uint64) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, main, zbx_uint64_t, uint64) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, type, zbx_uint64_t, uint64) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, ip, const char*, string) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, dns, const char*, string) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, port, int, int) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, useip, zbx_uint64_t) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, main, zbx_uint64_t) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, type, zbx_uint64_t) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, ip, const char*) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, dns, const char*) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, port, int) \ /* snmp */ \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, version, zbx_uint64_t, uint64) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, bulk, zbx_uint64_t, uint64) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, community, const char*, string) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, securityname, const char*, string) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, securitylevel, int, int) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, authpassphrase, const char*, string) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, privpassphrase, const char*, string) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, authprotocol, zbx_uint64_t, uint64) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, privprotocol, zbx_uint64_t, uint64) \ -PREPARE_AUDIT_HOST_INTERFACE_H(resource, contextname, const char*, string) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, version, zbx_uint64_t) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, bulk, zbx_uint64_t) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, community, const char*) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, securityname, const char*) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, securitylevel, int) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, authpassphrase, const char*) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, privpassphrase, const char*) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, authprotocol, zbx_uint64_t) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, privprotocol, zbx_uint64_t) \ +PREPARE_AUDIT_HOST_INTERFACE_H(funcname, contextname, const char*) \ PREPARE_AUDIT_HOST_H(host, AUDIT_RESOURCE_HOST) PREPARE_AUDIT_HOST_H(host_prototype, AUDIT_RESOURCE_HOST_PROTOTYPE) @@ -114,14 +114,14 @@ void zbx_audit_host_prototype_update_json_add_details(zbx_uint64_t hostid, zbx_u int status, int discover, int custom_interfaces); void zbx_audit_host_prototype_update_json_add_templateid(zbx_uint64_t hostid, zbx_uint64_t templateid); -#define PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(resource, type1, type2) \ +#define PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(resource, type1) \ void zbx_audit_host_prototype_update_json_update_##resource(zbx_uint64_t hostid, type1 old_##resource, \ type1 new_##resource); \ -PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(name, const char*, string) -PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(status, int, int) -PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(discover, int, int) -PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(custom_interfaces, int, int) +PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(name, const char*) +PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(status, int) +PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(discover, int) +PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_H(custom_interfaces, int) void zbx_audit_host_prototype_update_json_add_group_details(zbx_uint64_t hostid, const char* name, zbx_uint64_t groupid, zbx_uint64_t templateid); @@ -129,11 +129,37 @@ void zbx_audit_host_prototype_update_json_add_group_details(zbx_uint64_t hostid, void zbx_audit_host_prototype_update_json_update_group_links(zbx_uint64_t hostid, zbx_uint64_t groupid, zbx_uint64_t templateid_old, zbx_uint64_t templateid_new); -#define PREPARE_AUDIT_TEMPLATE_OP_H(op1, op2) \ -void zbx_audit_host_update_json_##op1##_parent_template(zbx_uint64_t hostid, zbx_uint64_t templateid); \ +#define PREPARE_AUDIT_TEMPLATE_OP_H(funcname, op1) \ +void zbx_audit_##funcname##_update_json_##op1##_parent_template(zbx_uint64_t hostid, \ + zbx_uint64_t templateid); -PREPARE_AUDIT_TEMPLATE_OP_H(attach, AUDIT_DETAILS_ACTION_ATTACH) -PREPARE_AUDIT_TEMPLATE_OP_H(detach, AUDIT_DETAILS_ACTION_DETACH) +PREPARE_AUDIT_TEMPLATE_OP_H(host, attach) +PREPARE_AUDIT_TEMPLATE_OP_H(host, detach) +PREPARE_AUDIT_TEMPLATE_OP_H(host_prototype, attach) +PREPARE_AUDIT_TEMPLATE_OP_H(host_prototype, detach) -void zbx_audit_host_prototype_update_json_add_templates(zbx_uint64_t hostid, zbx_vector_uint64_t *templateids); +void zbx_audit_host_prototype_update_json_delete_interface(zbx_uint64_t hostid, zbx_uint64_t interfaceid); + +void zbx_audit_host_prototype_update_json_add_hostmacro(zbx_uint64_t hostid, zbx_uint64_t macroid, + const char *macro, const char *value, const char *description, int type); + +#define PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_HOSTMACRO_H(resource, type1) \ +void zbx_audit_host_prototype_update_json_update_hostmacro_##resource(zbx_uint64_t hostid, \ + zbx_uint64_t hostmacroid, type1 old_##resource, type1 new_##resource); +PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_HOSTMACRO_H(value, const char*) +PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_HOSTMACRO_H(description, const char*) +PREPARE_AUDIT_HOST_PROTOTYPE_UPDATE_HOSTMACRO_H(type, int) + +void zbx_audit_host_prototype_update_json_delete_hostmacro(zbx_uint64_t hostid, zbx_uint64_t hostmacroid); + +void zbx_audit_host_prototype_update_json_add_tag(zbx_uint64_t hostid, zbx_uint64_t tagid, const char* tag, + const char* value); + +void zbx_audit_host_prototype_update_json_update_tag_tag(zbx_uint64_t hostid, zbx_uint64_t tagid, + const char* tag_old, const char *tag_new); + +void zbx_audit_host_prototype_update_json_update_tag_value(zbx_uint64_t hostid, zbx_uint64_t tagid, + const char* value_old, const char *value_new); + +void zbx_audit_host_prototype_update_json_delete_tag(zbx_uint64_t hostid, zbx_uint64_t tagid); #endif /* ZABBIX_AUDIT_HOST_H */ |