ipfixReceiver->authHosts = 0; ipfixReceiver->authCount = 0;
IpfixReceiver* createIpfixReceiver(uint16_t port) {	IpfixReceiver* ipfixReceiver;	struct sockaddr_in serverAddress;		if(!(ipfixReceiver=(IpfixReceiver*)malloc(sizeof(IpfixReceiver)))) {		fatal("Ran out of memory");		goto out0;		}	ipfixReceiver->callbackInfo = 0;	ipfixReceiver->callbackCount = 0;		if(!(ipfixReceiver->templateBuffer = createTemplateBuffer(ipfixReceiver))) {		fatal("Could not create template Buffer");		goto out1;		}	if (pthread_mutex_init(&ipfixReceiver->mutex, NULL) != 0) {		fatal("Could not init mutex");		goto out2;		}			if (pthread_mutex_lock(&ipfixReceiver->mutex) != 0) {		fatal("Could not lock mutex");		goto out2;		}	ipfixReceiver->socket = socket(AF_INET, SOCK_DGRAM, 0);	if(ipfixReceiver->socket < 0) {		perror("Could not create socket");		goto out2;		}	serverAddress.sin_family = AF_INET;	serverAddress.sin_addr.s_addr = htonl(INADDR_ANY);	serverAddress.sin_port = htons(port);	if(bind(ipfixReceiver->socket, (struct sockaddr*)&serverAddress, sizeof(struct sockaddr_in)) < 0) {		perror("Could not bind socket");		goto out3;		}	if(pthread_create(&(ipfixReceiver->thread), 0, listenerUdpIpv4, ipfixReceiver) != 0) {		fatal("Could not create listener thread");		goto out3;		}	//listenerUdpIpv4(ipfixReceiver); //debug - single-threaded		return ipfixReceiver;out3:	close(ipfixReceiver->socket);out2:	destroyTemplateBuffer(ipfixReceiver->templateBuffer);out1:	free(ipfixReceiver);out0:	return NULL;	}