Source
int get_value_internal(const zbx_dc_item_t *item, AGENT_RESULT *result, const zbx_config_comms_args_t *config_comms,
/*
** 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/>.
**/
static int compare_interfaces(const void *p1, const void *p2)
{
const zbx_dc_interface2_t *i1 = (const zbx_dc_interface2_t *)p1, *i2 = (const zbx_dc_interface2_t *)p2;
if (i1->type > i2->type) /* 1st criterion: 'type' in ascending order */
return 1;
if (i1->type < i2->type)
return -1;
if (i1->main > i2->main) /* 2nd criterion: 'main' in descending order */
return -1;
if (i1->main < i2->main)
return 1;
if (i1->interfaceid > i2->interfaceid) /* 3rd criterion: 'interfaceid' in ascending order */
return 1;
if (i1->interfaceid < i2->interfaceid)
return -1;
return 0;
}
/******************************************************************************
* *
* Purpose: Gets data of all network interfaces for a host from configuration *