#include "audit/zbxaudit_httptest.h"
#include "audit/zbxaudit.h"
void zbx_audit_httptest_create_entry(int audit_context_mode, int audit_action, zbx_uint64_t httptestid,
zbx_audit_entry_t local_audit_httptest_entry, **found_audit_httptest_entry;
zbx_audit_entry_t *local_audit_httptest_entry_x = &local_audit_httptest_entry;
RETURN_IF_AUDIT_OFF(audit_context_mode);
local_audit_httptest_entry.id = httptestid;
local_audit_httptest_entry.cuid = NULL;
local_audit_httptest_entry.id_table = AUDIT_HTTPTEST_ID;
found_audit_httptest_entry = (zbx_audit_entry_t**)zbx_hashset_search(zbx_get_audit_hashset(),
&(local_audit_httptest_entry_x));
if (NULL == found_audit_httptest_entry)
zbx_audit_entry_t *local_audit_httptest_entry_insert;
local_audit_httptest_entry_insert = zbx_audit_entry_init(httptestid, AUDIT_HTTPTEST_ID, name,
audit_action, ZBX_AUDIT_RESOURCE_SCENARIO);
zbx_hashset_insert(zbx_get_audit_hashset(), &local_audit_httptest_entry_insert,
sizeof(local_audit_httptest_entry_insert));
void zbx_audit_httptest_update_json_add_data(int audit_context_mode, zbx_uint64_t httptestid,
zbx_uint64_t templateid, const char *name, const char *delay, unsigned char status, const char *agent,
unsigned char authentication, const char *httpuser, const char *http_proxy, int retries,
const char *ssl_cert_file, const char *ssl_key_file, int verify_peer, int verify_host,
char audit_key_templateid[AUDIT_DETAILS_KEY_LEN], audit_key_name[AUDIT_DETAILS_KEY_LEN],
audit_key_delay[AUDIT_DETAILS_KEY_LEN], audit_key_status[AUDIT_DETAILS_KEY_LEN],
audit_key_agent[AUDIT_DETAILS_KEY_LEN], audit_key_authentication[AUDIT_DETAILS_KEY_LEN],
audit_key_httpuser[AUDIT_DETAILS_KEY_LEN], audit_key_http_proxy[AUDIT_DETAILS_KEY_LEN],
audit_key_retries[AUDIT_DETAILS_KEY_LEN], audit_key_ssl_cert_file[AUDIT_DETAILS_KEY_LEN],
audit_key_ssl_key_file[AUDIT_DETAILS_KEY_LEN], audit_key_verify_peer[AUDIT_DETAILS_KEY_LEN],
audit_key_verify_host[AUDIT_DETAILS_KEY_LEN], audit_key_hostid[AUDIT_DETAILS_KEY_LEN];
RETURN_IF_AUDIT_OFF(audit_context_mode);
#define AUDIT_KEY_SNPRINTF(r) zbx_snprintf(audit_key_##r, sizeof(audit_key_##r), "httptest."#r);
#define AUDIT_TABLE_NAME "httptest"
zbx_audit_update_json_append_uint64(httptestid, AUDIT_HTTPTEST_ID, AUDIT_DETAILS_ACTION_ADD,
"httptest.httptestid", httptestid, AUDIT_TABLE_NAME, "httptestid");
AUDIT_KEY_SNPRINTF(templateid)
AUDIT_KEY_SNPRINTF(delay)
AUDIT_KEY_SNPRINTF(status)
AUDIT_KEY_SNPRINTF(agent)
AUDIT_KEY_SNPRINTF(authentication)
AUDIT_KEY_SNPRINTF(httpuser)
AUDIT_KEY_SNPRINTF(http_proxy)
AUDIT_KEY_SNPRINTF(retries)
AUDIT_KEY_SNPRINTF(ssl_cert_file)
AUDIT_KEY_SNPRINTF(ssl_key_file)
AUDIT_KEY_SNPRINTF(verify_peer)
AUDIT_KEY_SNPRINTF(verify_host)
AUDIT_KEY_SNPRINTF(hostid)
#undef AUDIT_KEY_SNPRINTF
#define ADD_STR(r, t, f) zbx_audit_update_json_append_string(httptestid, AUDIT_HTTPTEST_ID, AUDIT_DETAILS_ACTION_ADD, \
#define ADD_UINT64(r, t, f) zbx_audit_update_json_append_uint64(httptestid, AUDIT_HTTPTEST_ID, \
AUDIT_DETAILS_ACTION_ADD, audit_key_##r, r, t, f);
#define ADD_INT(r, t, f) zbx_audit_update_json_append_int(httptestid, AUDIT_HTTPTEST_ID, AUDIT_DETAILS_ACTION_ADD, \