unsigned short addcount(unsigned int ip) {
	char **val=NULL;
	struct c_node *node=NULL;
	int c;

#ifdef DEBUG
	twalk(current, cur_action);
#endif

	node=(struct c_node *)xmalloc(sizeof(struct c_node));
	node->ip = ip;
	node->count=0;
	pthread_mutex_lock(&m_current);
	val = (void *)tsearch((void *)node, &current, compare);
	if ((struct c_node *)*val != node)
		free(node);
	node = (struct c_node *)(*val);
	printf("Connection: %u - %d\n",node->ip,node->count);
	node->count++;
	c = node->count;
	pthread_mutex_unlock(&m_current);
	return c;
}


....


	count = addcount(ip);

	if (count > global.maxallowed)	{
		delete_ip(NULL,ip);
		add_ip(NULL,ip,IP_VIOLATION);
		error(fd,IP_VIOLATION,IP_VIOLATION_ERROR);
		return;
	}
