ret = ipfix_unlock_mutex (exporter, DATA);  DPRINTF("end_data_set: end, (*(*exporter).data_sendbuffer).current %i\n", (*(*exporter).data_sendbuffer).current); if (ret != 0) { fprintf (stderr, "ipfix_start_template_set: Locking templates failed!\n"); return -1; }
int ipfix_end_data_set(ipfix_exporter *exporter){	// write the correct header data:	char *p_base = exporter->data_sendbuffer->set_manager->set_header_store;	char *p_pos = p_base;	char *p_end = p_base + exporter->data_sendbuffer->set_manager->set_header_capacity;	// calculate the total lenght of the record:	uint16_t record_length = exporter->data_sendbuffer->set_manager->data_length;	record_length += IPFIX_MAX_SET_HEADER_LENGTH;	// we already wrote the set id:	p_pos += 2;	// write the length field:	write_unsigned16( &p_pos, p_end, record_length);	// update the sendbuffer	exporter->data_sendbuffer->commited_data_length += record_length;	// commit the header to the iovec	exporter->data_sendbuffer->set_manager->header_iovec->iov_base = p_base;	exporter->data_sendbuffer->set_manager->header_iovec->iov_len = IPFIX_MAX_SET_HEADER_LENGTH;	return 0;}