]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: assign id to sgh
authorVictor Julien <victor@inliniac.net>
Tue, 27 Oct 2015 12:34:55 +0000 (13:34 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 5 Apr 2016 07:30:12 +0000 (09:30 +0200)
src/detect.c
src/detect.h

index 404dac4d53095b140e2d106ecf1c868e418123c6..2293f69b11fc2599d6086b19748274f62bd55c13 100644 (file)
@@ -2978,6 +2978,8 @@ json_t *RulesGroupPrintSghStats(const SigGroupHead *sgh)
     if (unlikely(js == NULL))
         return NULL;
 
+    json_object_set_new(js, "id", json_integer(sgh->id));
+
     json_t *js_array = json_array();
 
     const Signature *s;
@@ -4070,6 +4072,8 @@ int SigAddressPrepareStage4(DetectEngineCtx *de_ctx)
 
         sgh->mpm_uricontent_minlen = SigGroupHeadGetMinMpmSize(de_ctx, sgh, DETECT_SM_LIST_UMATCH);
         SCLogDebug("http_uri content min mpm len: %u", sgh->mpm_uricontent_minlen);
+
+        sgh->id = idx;
         cnt++;
     }
     SCLogInfo("Unique rule groups: %u", cnt);
index 6535be6d2a14a19178517b8524c88eeb1b6ce176..02728200c108493da5d7de3ce6a512f2d5590cc2 100644 (file)
@@ -989,6 +989,8 @@ typedef struct SigGroupHead_ {
      *  set. */
     uint16_t filestore_cnt;
 
+    uint32_t id; /**< unique id used to index sgh_array for stats */
+
     /* pattern matcher instances */
     const MpmCtx *mpm_proto_other_ctx;