detect/fast-pattern: use registered buffers for check

pull/3182/head
Victor Julien 9 years ago
parent fdbcf948c1
commit 9182756891

@ -49,6 +49,37 @@ void DetectFastPatternRegisterTests(void);
* that has fp support */
SCFPSupportSMList *sm_fp_support_smlist_list = NULL;
/**
* \brief Checks if a particular list(Signature->sm_lists[]) is in the list
* of lists that need to be searched for a keyword that has fp support.
*
* \param list_id The list id.
*
* \retval 1 If supported.
* \retval 0 If not.
*/
int FastPatternSupportEnabledForSigMatchList(int list_id)
{
if (sm_fp_support_smlist_list == NULL)
return 0;
if (list_id == DETECT_SM_LIST_PMATCH)
return 1;
return DetectBufferTypeSupportsMpmGetById(list_id);
#if 0
SCFPSupportSMList *tmp_smlist_fp = sm_fp_support_smlist_list;
while (tmp_smlist_fp != NULL) {
if (tmp_smlist_fp->list_id == list_id)
return 1;
tmp_smlist_fp = tmp_smlist_fp->next;
}
#endif
return 0;
}
/**
* \brief Lets one add a sm list id to be searched for potential fp supported
* keywords later.

@ -34,32 +34,8 @@ typedef struct SCFPSupportSMList_ {
extern SCFPSupportSMList *sm_fp_support_smlist_list;
/**
* \brief Checks if a particular list(Signature->sm_lists[]) is in the list
* of lists that need to be searched for a keyword that has fp support.
*
* \param list_id The list id.
*
* \retval 1 If supported.
* \retval 0 If not.
*/
static inline int FastPatternSupportEnabledForSigMatchList(int list_id)
{
if (sm_fp_support_smlist_list == NULL)
return 0;
SCFPSupportSMList *tmp_smlist_fp = sm_fp_support_smlist_list;
while (tmp_smlist_fp != NULL) {
if (tmp_smlist_fp->list_id == list_id)
return 1;
tmp_smlist_fp = tmp_smlist_fp->next;
}
return 0;
}
void SupportFastPatternForSigMatchList(int list_id, int priority);
int FastPatternSupportEnabledForSigMatchList(int list_id);
void SupportFastPatternForSigMatchTypes(void);

Loading…
Cancel
Save