zabbix-4.2.1/src/zabbix_server/ipmi/checks_ipmi.c
/******************************************************************************
 *                                                                            *
 * Function: zbx_get_ipmi_host                                                *
 *                                                                            *
 * Purpose: Find element in the global list 'hosts' using parameters as       *
 *          search criteria                                                   *
 *                                                                            *
 * Return value: pointer to list element with host data                       *
 *               NULL if not found                                            *
 *                                                                            *
 ******************************************************************************/


Find element in the global list 'hosts' using parameters as
search criteria

Return value: pointer to list element with host data
NULL if not found
Find element in the global list ' hosts ' using parameters as search criteria Return value : pointer to list element with host data NULL if not found
static zbx_ipmi_host_t	*zbx_get_ipmi_host(const char *ip, const int port, int authtype, int privilege,
		const char *username, const char *password)
{
	zbx_ipmi_host_t	*h;
	zabbix_log(LOG_LEVEL_DEBUG, "In %s() host:'[%s]:%d'", __func__, ip, port);
	h = hosts;
	while (NULL != h)
	{
		if (0 == strcmp(ip, h->ip) && port == h->port && authtype == h->authtype &&
				privilege == h->privilege && 0 == strcmp(username, h->username) &&
				0 == strcmp(password, h->password))
		{
			break;
		}
		h = h->next;
	}
	zabbix_log(LOG_LEVEL_DEBUG, "End of %s():%p", __func__, (void *)h);
	return h;
}
static zbx_ipmi_host_t * zbx_get_ipmi_host ( const char * ip , const int port , int authtype , int privilege , const char * username , const char * password ) { zbx_ipmi_host_t * h ; zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ , ip , port ) ; h = hosts ; while ( NULL != h ) { if ( 0 == strcmp ( ip , h -> ip ) && port == h -> port && authtype == h -> authtype && privilege == h -> privilege && 0 == strcmp ( username , h -> username ) && 0 == strcmp ( password , h -> password ) ) { break ; } h = h -> next ; } zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ , ( void * ) h ) ; return h ; }
Function: zbx_get_ipmi_host
Function : zbx_get_ipmi_host