int ret; int header_length = 4* sizeof(uint32_t);
int header_length = 4 * sizeof(uint32_t);
static int ipfix_prepend_header(ipfix_exporter *p_exporter, int data_length, ipfix_sendbuffer *sendbuf){	ipfix_header header;	time_t export_time;	uint16_t total_length = 0;	int ret;	int header_length = 4* sizeof(uint32_t);	// did the user set the data_length field?	if (data_length != 0) {		total_length = header_length+data_length;	} else {		// compute it on our own:		// sum up all lengths in the iovecs:		int i;		// start the loop with 1, as 0 is reserved for the header!		for (i = 1; i< sendbuf->current;  i++) {			total_length += ((*sendbuf).entries[i]).iov_len;		}		// add the header lenght to the total length:		total_length += header_length;	}	// write the length into the header	header.length = total_length;	// write version number and source ID	header.version = IPFIX_VERSION_NUMBER;	header.source_id = p_exporter->source_id;	//  increment and write the sequence number:	header.sequence_number = p_exporter->sequence_number;	p_exporter->sequence_number++;	// get the export time:	export_time = time(NULL);	if (export_time == (time_t)-1) {		fprintf (stderr, "time failed!\n");		export_time=0; // just something to survive!	}	//  global_last_export_time = (uint32_t) export_time;	header.export_time = (uint32_t)export_time;	// write the header:	// first, get the buffer for the header	char* p_base = sendbuf->header_store;	char* p_pos = p_base;	char* p_end = p_pos + IPFIX_HEADER_LENGTH;	// write into that header	ret = write_ipfix_message_header(&header, &p_pos, p_end);	((*sendbuf).entries[0]).iov_len = IPFIX_HEADER_LENGTH;	((*sendbuf).entries[0]).iov_base = p_base;	return ret;}