Source
void zbx_deactivate_item_interface(zbx_timespec_t *ts, zbx_dc_interface_t *interface, zbx_uint64_t itemid, int type,
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/******************************************************************************
* *
* Purpose: writes interface availability changes into database *
* *
* Parameters: data - [IN/OUT] serialized availability data *
* data_alloc - [IN/OUT] serialized availability data size *
* data_offset - [IN/OUT] serialized availability data offset *
* ia - [IN] interface availability data *
* *
* Return value: SUCCEED - availability changes were written into db *
* FAIL - no changes in availability data were detected *
* *
******************************************************************************/
static int update_interface_availability(unsigned char **data, size_t *data_alloc, size_t *data_offset,
const zbx_interface_availability_t *ia)
{
if (FAIL == zbx_interface_availability_is_set(ia))
return FAIL;
zbx_availability_serialize_interface(data, data_alloc, data_offset, ia);
return SUCCEED;
}
/******************************************************************************
* *
* Parameters: dc_interface - [IN] interface *
* ia - [OUT] interface availability data *
* *
******************************************************************************/
static void interface_get_availability(const zbx_dc_interface_t *dc_interface, zbx_interface_availability_t *ia)
{
zbx_agent_availability_t *availability = &ia->agent;
availability->flags = ZBX_FLAGS_AGENT_STATUS;
availability->available = dc_interface->available;
availability->error = zbx_strdup(NULL, dc_interface->error);
availability->errors_from = dc_interface->errors_from;
availability->disable_until = dc_interface->disable_until;