code cleanup - replace SigMatchAppendPostMatch with SigMatchAppendSMToList

remotes/origin/HEAD
Anoop Saldanha 14 years ago committed by Victor Julien
parent a4638fb0ad
commit dd7e710f35

@ -264,7 +264,7 @@ int DetectFlowbitSetup (DetectEngineCtx *de_ctx, Signature *s, char *rawstr)
case DETECT_FLOWBITS_CMD_UNSET: case DETECT_FLOWBITS_CMD_UNSET:
case DETECT_FLOWBITS_CMD_TOGGLE: case DETECT_FLOWBITS_CMD_TOGGLE:
/* modifiers, only run when entire sig has matched */ /* modifiers, only run when entire sig has matched */
SigMatchAppendPostMatch(s, sm); SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_POSTMATCH);
break; break;
} }

@ -379,7 +379,7 @@ static int DetectFlowintSetup(DetectEngineCtx *de_ctx, Signature *s, char *rawst
case FLOWINT_MODIFIER_SET: case FLOWINT_MODIFIER_SET:
case FLOWINT_MODIFIER_ADD: case FLOWINT_MODIFIER_ADD:
case FLOWINT_MODIFIER_SUB: case FLOWINT_MODIFIER_SUB:
SigMatchAppendPostMatch(s, sm); SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_POSTMATCH);
break; break;
case FLOWINT_MODIFIER_LT: case FLOWINT_MODIFIER_LT:

@ -198,32 +198,6 @@ void SigMatchAppendThreshold(Signature *s, SigMatch *new) {
SigMatchAppendSMToList(s, new, DETECT_SM_LIST_THRESHOLD); SigMatchAppendSMToList(s, new, DETECT_SM_LIST_THRESHOLD);
} }
/** \brief Append a sig match to the signatures post-match list
*
* \param s signature
* \param new sigmatch to append
*/
void SigMatchAppendPostMatch(Signature *s, SigMatch *new) {
if (s->sm_lists[DETECT_SM_LIST_POSTMATCH] == NULL) {
s->sm_lists[DETECT_SM_LIST_POSTMATCH] = new;
s->sm_lists_tail[DETECT_SM_LIST_POSTMATCH] = new;
new->next = NULL;
new->prev = NULL;
} else {
SigMatch *cur = s->sm_lists[DETECT_SM_LIST_POSTMATCH];
for ( ; cur->next != NULL; cur = cur->next);
cur->next = new;
new->next = NULL;
new->prev = cur;
s->sm_lists_tail[DETECT_SM_LIST_POSTMATCH] = new;
}
new->idx = s->sm_cnt;
s->sm_cnt++;
}
/** \brief Pull a content 'old' from the pmatch list, append 'new' to amatch list. /** \brief Pull a content 'old' from the pmatch list, append 'new' to amatch list.
* Used for replacing contents that have http_cookie, etc modifiers. * Used for replacing contents that have http_cookie, etc modifiers.
*/ */

@ -58,7 +58,6 @@ void SigMatchReplaceContent(Signature *, SigMatch *, SigMatch *);
void SigMatchReplaceContentToUricontent(Signature *, SigMatch *, SigMatch *); void SigMatchReplaceContentToUricontent(Signature *, SigMatch *, SigMatch *);
void SigMatchAppendThreshold(Signature *, SigMatch *); void SigMatchAppendThreshold(Signature *, SigMatch *);
void SigMatchAppendPostMatch(Signature *, SigMatch *);
void SigMatchAppendSMToList(Signature *, SigMatch *, int); void SigMatchAppendSMToList(Signature *, SigMatch *, int);
void SigMatchRemoveSMFromList(Signature *, SigMatch *, int); void SigMatchRemoveSMFromList(Signature *, SigMatch *, int);
int SigMatchListSMBelongsTo(Signature *, SigMatch *); int SigMatchListSMBelongsTo(Signature *, SigMatch *);

Loading…
Cancel
Save