Source
zbx_uint32_t zbx_preprocessor_pack_diag_stats(unsigned char **data, int total, int queued, int processing, int done,
/*
** 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.
**/
/* packed field data description */
typedef struct
{
const void *value; /* value to be packed */
zbx_uint32_t size; /* size of a value (can be 0 for strings) */
unsigned char type; /* field type */
}
zbx_packed_field_t;
static zbx_ipc_message_t cached_message;
static int cached_values;
/******************************************************************************
* *
* Function: message_pack_data *
* *
* Purpose: helper for data packing based on defined format *
* *
* Parameters: message - [OUT] IPC message, can be NULL for buffer size *
* calculations *
* fields - [IN] the definition of data to be packed *
* count - [IN] field count *
* *
* Return value: size of packed data or 0 if the message size would exceed *
* 4GB limit *
* *