]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
code cleanup - replace SigMatchAppendTag with SigMatchAppendSMToList
authorAnoop Saldanha <poonaatsoc@gmail.com>
Sat, 18 Feb 2012 09:31:48 +0000 (15:01 +0530)
committerVictor Julien <victor@inliniac.net>
Sat, 18 Feb 2012 16:57:06 +0000 (17:57 +0100)
src/detect-mark.c
src/detect-parse.c
src/detect-parse.h
src/detect-tag.c

index bdd99f45a946aa5e5a9a4dcca99743e0d127551a..0e24e10fc160275cf87aba330bad1a5afacacf25 100644 (file)
@@ -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
index 32792a0ff5160610bbfb75c1571dcc3c93513677..5011fb642f5c6c85e4c25cb77addb216a6847446 100644 (file)
@@ -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]) {
index e84185a8643e0bfcc20ef056b3440e75b35c42bf..dabe638387859679fe586dad049bc20610420bd7 100644 (file)
@@ -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 *);
index 218253f746b523dd1e52193ff8ce9684a756ee33..eb523d575c8e611cd65a48f6ed9cca165d21b7ac 100644 (file)
@@ -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;