Source
static int get_interval_option(const char *fping, ZBX_FPING_HOST *hosts, int hosts_count, int *value, char *error,
/*
** Zabbix
** Copyright (C) 2001-2023 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.
**/
static const zbx_config_icmpping_t *config_icmpping;
/* old official fping (2.4b2_to_ipv6) did not support source IP address */
/* old patched versions (2.4b2_to_ipv6) provided either -I or -S options */
/* since fping 3.x it provides -I option for binding to an interface and -S option for source IP address */
static unsigned char source_ip_checked;
static const char *source_ip_option;
static unsigned char source_ip6_checked;
static const char *source_ip6_option;
static int packet_interval;
static int packet_interval6;
static int fping_ipv6_supported;
static time_t fping_check_reset_at; /* time of the last fping options expiration */
static void get_source_ip_option(const char *fping, const char **option, unsigned char *checked)
{
FILE *f;
char *p, tmp[MAX_STRING_LEN];
zbx_snprintf(tmp, sizeof(tmp), "%s -h 2>&1", fping);
if (NULL == (f = popen(tmp, "r")))
return;