int ipfix_find_template(ipfix_exporter *exporter, uint16_t template_id, enum ipfix_validity cleanness)
static int ipfix_find_template(ipfix_exporter *exporter, uint16_t template_id, enum ipfix_validity cleanness)
int ipfix_find_template(ipfix_exporter *exporter, uint16_t template_id, enum ipfix_validity cleanness){	int i=0;	int searching;	// first, some safety checks:	if (exporter == NULL) {		fprintf (stderr, "Exporter is NULL! Cannot search it for a template!\n");		return -1;	}	if ( exporter->template_arr == NULL ) {		fprintf (stderr, "Template store not initialized! Cannot search it for a template!\n");		return -1;	}	// do we already have a template with this ID?	// -> update it!	searching = TRUE;	while (searching && ( i< exporter->ipfix_lo_template_maxsize) ) {		if ( (*exporter).template_arr[i].valid == cleanness) {			// if we are searching for an existing template, compare the template_id too:			if ( ( cleanness == COMMITED) || (cleanness = UNCLEAN) ) {				if ( (*exporter).template_arr[i].template_id == template_id) {					return i;					searching = FALSE;				}			} else {				// we found an unused slot; return the index:				return i;			}		}		i++;	}	return -1;}