From ff38d42bf1fae2c7f76b518d54d4c2142daa8c19 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Sat, 18 Feb 2012 15:01:48 +0530 Subject: [PATCH] code cleanup - replace SigMatchAppendTag with SigMatchAppendSMToList --- src/detect-mark.c | 2 +- src/detect-parse.c | 27 --------------------------- src/detect-parse.h | 1 - src/detect-tag.c | 2 +- 4 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/detect-mark.c b/src/detect-mark.c index bdd99f45a9..0e24e10fc1 100644 --- a/src/detect-mark.c +++ b/src/detect-mark.c @@ -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 diff --git a/src/detect-parse.c b/src/detect-parse.c index 32792a0ff5..5011fb642f 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -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]) { diff --git a/src/detect-parse.h b/src/detect-parse.h index e84185a864..dabe638387 100644 --- a/src/detect-parse.h +++ b/src/detect-parse.h @@ -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 *); diff --git a/src/detect-tag.c b/src/detect-tag.c index 218253f746..eb523d575c 100644 --- a/src/detect-tag.c +++ b/src/detect-tag.c @@ -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; -- 2.47.2