ret = ipfix_reset_sendbuffer (exporter->data_sendbuffer); ret = ipfix_reset_sendbuffer (exporter->template_sendbuffer);
int ipfix_deinit_exporter(ipfix_exporter *exporter){	// cleanup processes	int ret;	// lock this exporter... 	ret = ipfix_lock_mutex (exporter, EXPORTER);	if (ret != 0) {		fprintf (stderr, "ipfix_deinit_exporter: Locking exporter failed!\n");		return -1;	} 	#ifdef IPFIX_THREADED	/* 	 * get the other mutexes	 */	ret = pthread_mutex_lock (&(exporter->collector_array_mutex));	DPRINTF ("DEINIT: locking collector with res %i\n", ret);	pthread_mutex_lock (&(exporter->data_sendbuffer_mutex));	DPRINTF ("DEINIT: locking data with res %i\n", ret);	pthread_mutex_lock (&(exporter-> template_sendbuffer_mutex));	DPRINTF ("DEINIT: locking template with res %i\n", ret);#endif	// close sockets etc.	// (currently, nothing to do)	// FIXME: Really nothing to do?	// free all children	// deinitialize array to hold the templates.	ret=ipfix_deinit_template_array(exporter);	/*   free ( (**exporter).template_arr); */	/*   (**exporter).template_arr = NULL; */	// deinitialize the sendbuffers	ret=ipfix_deinit_sendbuffer(&(exporter->data_sendbuffer));	ret=ipfix_deinit_sendbuffer(&(exporter->template_sendbuffer));	// deinitialize the collectors	ret=ipfix_deinit_collector_array(&(exporter->collector_arr));#ifdef IPFIX_THREADED	// destroy all mutexes	pthread_mutex_unlock (&(exporter->data_sendbuffer_mutex));	pthread_mutex_destroy (&(exporter->data_sendbuffer_mutex));	pthread_mutex_unlock (&(exporter-> template_sendbuffer_mutex));	pthread_mutex_destroy (&(exporter-> template_sendbuffer_mutex));	pthread_mutex_unlock (&(exporter->collector_array_mutex));	pthread_mutex_destroy (&(exporter->collector_array_mutex));	pthread_mutex_unlock (&(exporter->exporter_mutex));	pthread_mutex_destroy (&(exporter->exporter_mutex));#endif	// free own memory	free(exporter);	exporter=NULL;	return 0;}