code cleanup - replace SigMatchAppendTag with SigMatchAppendSMToList

remotes/origin/master
Anoop Saldanha 14 years ago committed by Victor Julien
parent ac68c3f893
commit ff38d42bf1

@ -221,7 +221,7 @@ static int DetectMarkSetup (DetectEngineCtx *de_ctx, Signature *s, char *rawstr)
sm->ctx = (void *)data;
/* Append it to the list of tags */
SigMatchAppendTag(s, sm);
SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_TMATCH);
return 0;
}
#else

@ -173,33 +173,6 @@ void SigMatchAppendSMToList(Signature *s, SigMatch *new, int list)
s->sm_cnt++;
}
/** \brief Append a sig match to the signatures tag match list
* This is done on other list because the tag keyword
* should be always the last inspected (never ordered)
*
* \param s signature
* \param new sigmatch to append
*/
void SigMatchAppendTag(Signature *s, SigMatch *new) {
if (s->sm_lists[DETECT_SM_LIST_TMATCH] == NULL) {
s->sm_lists[DETECT_SM_LIST_TMATCH] = new;
s->sm_lists_tail[DETECT_SM_LIST_TMATCH] = new;
new->next = NULL;
new->prev = NULL;
} else {
SigMatch *cur = s->sm_lists_tail[DETECT_SM_LIST_TMATCH];
cur->next = new;
new->prev = cur;
new->next = NULL;
s->sm_lists_tail[DETECT_SM_LIST_TMATCH] = new;
}
new->idx = s->sm_cnt;
s->sm_cnt++;
return;
}
void SigMatchRemoveSMFromList(Signature *s, SigMatch *sm, int sm_list)
{
if (sm == s->sm_lists[sm_list]) {

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

@ -377,7 +377,7 @@ int DetectTagSetup (DetectEngineCtx *de_ctx, Signature *s, char *tagstr)
sm->ctx = (void *)td;
/* Append it to the list of tags */
SigMatchAppendTag(s, sm);
SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_TMATCH);
return 0;

Loading…
Cancel
Save