tmp->last_template_transmition_time=0; tmp->template_transmition_timer=IPFIX_DEFAULT_TEMPLATE_TIMER;
tmp->last_template_transmission_time=0; tmp->template_transmission_timer=IPFIX_DEFAULT_TEMPLATE_TIMER;
int ipfix_init_exporter(uint32_t source_id, ipfix_exporter **exporter){        ipfix_exporter *tmp;        int ret;        if(!(tmp=(ipfix_exporter *)malloc(sizeof(ipfix_exporter)))) {                goto out;        }        tmp->source_id=source_id;        tmp->sequence_number = 0;        tmp->collector_num = 0; // valgrind kindly asked me to inititalize this value JanP        tmp->collector_max_num = 0;        // TODO        // initialize the sendbuffers        ret=ipfix_init_sendbuffer(&(tmp->data_sendbuffer), IPFIX_MAX_SENDBUFSIZE);        if (ret != 0) {                msg(MSG_FATAL, "IPFIX: initializing data sendbuffer failed");                goto out1;        }        ret=ipfix_init_sendbuffer(&(tmp->template_sendbuffer), IPFIX_MAX_SENDBUFSIZE);        if (ret != 0) {                msg(MSG_FATAL, "IPFIX: initializing template sendbuffer failed");                goto out2;        }        // intialize the collectors to zero        ret=ipfix_init_collector_array( &(tmp->collector_arr), IPFIX_MAX_COLLECTORS);        if (ret !=0) {                msg(MSG_FATAL, "IPFIX: initializing collectors failed");                goto out3;        }        tmp->collector_max_num = IPFIX_MAX_COLLECTORS;        // initialize an array to hold the templates.        // TODO: own function:        if(ipfix_init_template_array(tmp, IPFIX_MAX_TEMPLATES)) {                goto out4;        }        /*   (**exporter).ipfix_lo_template_maxsize  = IPFIX_MAX_TEMPLATES; */        /*   (**exporter).ipfix_lo_template_current_count = 0 ; */        /*   (**exporter).template_arr =  (ipfix_lo_template*) malloc (IPFIX_MAX_TEMPLATES * sizeof(ipfix_lo_template) ); */        // we have not transmitted any templates yet!        tmp->last_template_transmition_time=0;        tmp->template_transmition_timer=IPFIX_DEFAULT_TEMPLATE_TIMER;        /* finally attach new exporter to the pointer we were given */        *exporter=tmp;        return 0;out4:        ipfix_deinit_collector_array(&(tmp->collector_arr));out3:        ipfix_deinit_sendbuffer(&(tmp->data_sendbuffer));out2:        ipfix_deinit_sendbuffer(&(tmp->template_sendbuffer));out1:        free(tmp);out:        /* we have nothing to free */        return -1;}