@ -64,24 +64,38 @@
# include "tm-threads.h"
/**
* \ brief Check if a certain signature has threshold option
* \ brief Return next DetectThresholdData for signature
*
* \ param sig Signature pointer
* \ param p Packet structure
* \ param sm Pointer to a Signature Match pointer
*
* \ retval tsh Return the threshold data from signature or NULL if not found
*
*
*/
DetectThresholdData * SigGetThresholdType ( Signature * sig , Packet * p )
DetectThresholdData * SigGetThresholdType Iter ( Signature * sig , Packet * p , SigMatch * * psm )
{
SigMatch * sm = sig - > sm_lists_tail [ DETECT_SM_LIST_MATCH ] ;
SigMatch * sm = NULL ;
DetectThresholdData * tsh = NULL ;
if ( sig = = NULL )
return NULL ;
if ( * psm = = NULL ) {
sm = sig - > sm_lists_tail [ DETECT_SM_LIST_MATCH ] ;
} else {
/* Iteration in progress, using provided value */
sm = * psm ;
}
if ( p = = NULL )
return NULL ;
while ( sm ! = NULL ) {
if ( sm - > type = = DETECT_THRESHOLD | | sm - > type = = DETECT_DETECTION_FILTER ) {
tsh = ( DetectThresholdData * ) sm - > ctx ;
* psm = sm - > prev ;
return tsh ;
}
@ -91,6 +105,19 @@ DetectThresholdData *SigGetThresholdType(Signature *sig, Packet *p)
return NULL ;
}
/**
* \ brief Check if a certain signature has threshold option
*
* \ param sig Signature pointer
* \ param p Packet structure
*
* \ retval tsh Return the threshold data from signature or NULL if not found
*/
DetectThresholdData * SigGetThresholdType ( Signature * sig , Packet * p )
{
return SigGetThresholdTypeIter ( sig , p , NULL ) ;
}
/**
* \ brief Search for a threshold data into threshold hash table
*