src/Cedar/Listener.c
// Search the DOS attack list by the IP address

Search the DOS attack list by the IP address
Search the DOS attack list by the IP address
DOS *SearchDosList(LISTENER *r, IP *ip)
{
	DOS *d, t;
	if (r == NULL || ip == NULL)
	{
		return NULL;
	}
	Copy(&t.IpAddress, ip, sizeof(IP));
	d = Search(r->DosList, &t);
	if (d != NULL)
	{
		if ((d->LastConnectedTick + d->CurrentExpireSpan) <= Tick64() ||
			(d->DeleteEntryTick <= Tick64()))
		{
			Delete(r->DosList, d);
			Free(d);
			return NULL;
		}
	}
	return d;
}
DOS * SearchDosList ( LISTENER * r , IP * ip ) { DOS * d , t ; if ( r == NULL || ip == NULL ) { return NULL ; } Copy ( & t . IpAddress , ip , sizeof ( IP ) ) ; d = Search ( r -> DosList , & t ) ; if ( d != NULL ) { if ( ( d -> LastConnectedTick + d -> CurrentExpireSpan ) <= Tick64 ( ) || ( d -> DeleteEntryTick <= Tick64 ( ) ) ) { Delete ( r -> DosList , d ) ; Free ( d ) ; return NULL ; } } return d ; }
Search the DOS attack list by the IP address
Search the DOS attack list by the IP address
// Validate arguments
 // Delete old entries
