int process_proxy_history_data(const DC_PROXY *proxy, struct zbx_json_parse *jp, zbx_timespec_t *ts, char **info);
#define ZBX_PROXYMODE_ACTIVE 0
#define ZBX_PROXYMODE_PASSIVE 1
#define ZBX_MAX_HRECORDS 1000
#define ZBX_MAX_HRECORDS_TOTAL 10000
#define ZBX_PROXY_DATA_DONE 0
#define ZBX_PROXY_DATA_MORE 1
#define ZBX_PROXY_UPLOAD_UNDEFINED 0
#define ZBX_PROXY_UPLOAD_DISABLED 1
#define ZBX_PROXY_UPLOAD_ENABLED 2
int get_active_proxy_from_request(struct zbx_json_parse *jp, DC_PROXY *proxy, char **error);
int zbx_proxy_check_permissions(const DC_PROXY *proxy, const zbx_socket_t *sock, char **error);
int check_access_passive_proxy(zbx_socket_t *sock, int send_response, const char *req);
void update_proxy_lastaccess(const zbx_uint64_t hostid, time_t last_access);
int get_proxyconfig_data(zbx_uint64_t proxy_hostid, struct zbx_json *j, char **error);
int process_proxyconfig(struct zbx_json_parse *jp_data, struct zbx_json_parse *jp_kvs_paths);
int get_interface_availability_data(struct zbx_json *json, int *ts);
int proxy_get_hist_data(struct zbx_json *j, zbx_uint64_t *lastid, int *more);
int proxy_get_dhis_data(struct zbx_json *j, zbx_uint64_t *lastid, int *more);
int proxy_get_areg_data(struct zbx_json *j, zbx_uint64_t *lastid, int *more);
void proxy_set_hist_lastid(const zbx_uint64_t lastid);
void proxy_set_dhis_lastid(const zbx_uint64_t lastid);
void proxy_set_areg_lastid(const zbx_uint64_t lastid);
void calc_timestamp(const char *line, int *timestamp, const char *format);
int process_history_data(DC_ITEM *items, zbx_agent_value_t *values, int *errcodes, size_t values_num,
zbx_proxy_suppress_t *nodata_win);
int lld_process_discovery_rule(zbx_uint64_t lld_ruleid, const char *value, char **error);