zabbix-agent2/src/libs/zbxdbupgrade/dbupgrade_4050.c
/******************************************************************************
 *                                                                            *
 * Function: DBpatch_4050047                                                  *
 *                                                                            *
 * Purpose: recovery links between the interfaceid of discovered host and     *
 *          parent interfaceid from parent host                               *
 *                                                                            *
 * Return value: SUCCEED - the operation has completed successfully           *
 *               FAIL    - the operation has failed                           *
 *                                                                            *
 ******************************************************************************/
DBpatch_4050047

Purpose: recovery links between the interfaceid of discovered host and
parent interfaceid from parent host

Return value: SUCCEED - the operation has completed successfully
FAIL    - the operation has failed
DBpatch_4050047 Purpose : recovery links between the interfaceid of discovered host and parent interfaceid from parent host Return value : SUCCEED - the operation has completed successfully FAIL - the operation has failed
static int	DBpatch_4050047(void)
{
	zbx_vector_dbu_interface_t	new_ifs;
	zbx_vector_dbu_snmp_if_t	snmp_new_ifs;
	zbx_vector_uint64_pair_t	if_links;
	int				ret = FAIL;
	zbx_vector_dbu_snmp_if_create(&snmp_new_ifs);
	zbx_vector_dbu_interface_create(&new_ifs);
	zbx_vector_uint64_pair_create(&if_links);
	DBpatch_if_load_data(&new_ifs, &snmp_new_ifs, &if_links);
	while (1)
	{
		if (0 < new_ifs.values_num && SUCCEED != DBpatch_interface_create(&new_ifs))
			break;
		if (0 < snmp_new_ifs.values_num && SUCCEED != DBpatch_snmp_if_save(&snmp_new_ifs))
			break;
		if (0 < if_links.values_num && SUCCEED != DBpatch_interface_discovery_save(&if_links))
			break;
		ret = SUCCEED;
		break;
	}
	zbx_vector_uint64_pair_destroy(&if_links);
	zbx_vector_dbu_interface_clear_ext(&new_ifs, db_interface_free);
	zbx_vector_dbu_interface_destroy(&new_ifs);
	zbx_vector_dbu_snmp_if_clear_ext(&snmp_new_ifs, db_snmpinterface_free);
	zbx_vector_dbu_snmp_if_destroy(&snmp_new_ifs);
	return ret;
}
static int DBpatch_4050047 ( void ) { zbx_vector_dbu_interface_t new_ifs ; zbx_vector_dbu_snmp_if_t snmp_new_ifs ; zbx_vector_uint64_pair_t if_links ; int ret = FAIL ; zbx_vector_dbu_snmp_if_create ( & snmp_new_ifs ) ; zbx_vector_dbu_interface_create ( & new_ifs ) ; zbx_vector_uint64_pair_create ( & if_links ) ; DBpatch_if_load_data ( & new_ifs , & snmp_new_ifs , & if_links ) ; while ( 1 ) { if ( 0 < new_ifs . values_num && SUCCEED != DBpatch_interface_create ( & new_ifs ) ) break ; if ( 0 < snmp_new_ifs . values_num && SUCCEED != DBpatch_snmp_if_save ( & snmp_new_ifs ) ) break ; if ( 0 < if_links . values_num && SUCCEED != DBpatch_interface_discovery_save ( & if_links ) ) break ; ret = SUCCEED ; break ; } zbx_vector_uint64_pair_destroy ( & if_links ) ; zbx_vector_dbu_interface_clear_ext ( & new_ifs , db_interface_free ) ; zbx_vector_dbu_interface_destroy ( & new_ifs ) ; zbx_vector_dbu_snmp_if_clear_ext ( & snmp_new_ifs , db_snmpinterface_free ) ; zbx_vector_dbu_snmp_if_destroy ( & snmp_new_ifs ) ; return ret ; }
Function: DBpatch_4050047                                                  
                                                                            
 Purpose: recovery links between the interfaceid of discovered host and     
          parent interfaceid from parent host                               
                                                                            
 Return value: SUCCEED - the operation has completed successfully           
               FAIL    - the operation has failed
Function : DBpatch_4050047 Purpose : recovery links between the interfaceid of discovered host and parent interfaceid from parent host Return value : SUCCEED - the operation has completed successfully FAIL - the operation has failed