return 0;
ret =  ipfix_unlock_mutex(exporter, COLLECTOR); if (ret != 0 ) { fprintf (stderr, "ipfix_remove_collector: Freeing mutex failed!\n"); return -1; } return 0; out:  ret =  ipfix_unlock_mutex(exporter, COLLECTOR); if (ret != 0 ) { fprintf (stderr, "ipfix_remove_collector: Freeing mutex failed!\n"); return -1; } return -1;
int ipfix_remove_collector(ipfix_exporter *exporter, char *coll_ip4_addr, int coll_port){	// find the collector in the exporter	int i=0;	int searching = TRUE;	while(searching && ( i< exporter->collector_max_num) ) {		if( ( strcmp( (*exporter).collector_arr[i].ipv4address, coll_ip4_addr) == 0 )		    && (*exporter).collector_arr[i].port_number == coll_port		  )  {			// are template and data socket the same?			if ( (*exporter).collector_arr[i].template_socket ==  (*exporter).collector_arr[i].data_socket ) {				close ( (*exporter).collector_arr[i].data_socket );			} else { //close both connections:				close ( (*exporter).collector_arr[i].data_socket );				close ( (*exporter).collector_arr[i].template_socket );			}			(*exporter).collector_arr[i].valid = FALSE;			searching = FALSE;		}		i++;	}	if (searching) {		fprintf (stderr, "Exporter %s not found, removing exporter failed!\n", coll_ip4_addr);		return -1;	}        exporter->collector_num--;        return 0;}