From: Victor Julien Date: Tue, 27 Oct 2015 12:34:55 +0000 (+0100) Subject: detect: assign id to sgh X-Git-Tag: suricata-3.1RC1~330 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e310a033be69d40026cb6ae9f605da78699d37c8;p=thirdparty%2Fsuricata.git detect: assign id to sgh --- diff --git a/src/detect.c b/src/detect.c index 404dac4d53..2293f69b11 100644 --- a/src/detect.c +++ b/src/detect.c @@ -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); diff --git a/src/detect.h b/src/detect.h index 6535be6d2a..02728200c1 100644 --- a/src/detect.h +++ b/src/detect.h @@ -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;