Source
static int get_addr_info(const char *addr_in, const char *port_in, struct addrinfo *hints, net_count_info_t *info,
/*
** 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/>.
**/
typedef struct
{
zbx_uint64_t ibytes;
zbx_uint64_t ipackets;
zbx_uint64_t ierr;
zbx_uint64_t idrop;
zbx_uint64_t ififo;
zbx_uint64_t iframe;
zbx_uint64_t icompressed;
zbx_uint64_t imulticast;
zbx_uint64_t obytes;
zbx_uint64_t opackets;
zbx_uint64_t oerr;
zbx_uint64_t odrop;
zbx_uint64_t ocolls;
zbx_uint64_t ofifo;
zbx_uint64_t ocarrier;
zbx_uint64_t ocompressed;
}
net_stat_t;
typedef struct
{
struct addrinfo *ai;
unsigned short port;
unsigned int prefix_sz;
unsigned char mapped;
}
net_count_info_t;
enum
{
STATE_UNKNOWN = 0,
STATE_ESTABLISHED,