From: Victor Julien Date: Thu, 16 Aug 2018 20:15:09 +0000 (+0200) Subject: detect: clean up sgh flags and add cocci check X-Git-Tag: suricata-4.1.0-rc2~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f4cd75f051394291cc0b17b66fea4b3fe31169b;p=thirdparty%2Fsuricata.git detect: clean up sgh flags and add cocci check --- diff --git a/src/detect.h b/src/detect.h index 1bbb9a8cdb..93d5898d83 100644 --- a/src/detect.h +++ b/src/detect.h @@ -1176,14 +1176,14 @@ enum { FILE_DECODER_EVENT_LZMA_UNKNOWN_ERROR, }; -#define SIG_GROUP_HEAD_HAVERAWSTREAM (1 << 0) +#define SIG_GROUP_HEAD_HAVERAWSTREAM BIT_U32(0) #ifdef HAVE_MAGIC -#define SIG_GROUP_HEAD_HAVEFILEMAGIC (1 << 20) +#define SIG_GROUP_HEAD_HAVEFILEMAGIC BIT_U32(20) #endif -#define SIG_GROUP_HEAD_HAVEFILEMD5 (1 << 21) -#define SIG_GROUP_HEAD_HAVEFILESIZE (1 << 22) -#define SIG_GROUP_HEAD_HAVEFILESHA1 (1 << 23) -#define SIG_GROUP_HEAD_HAVEFILESHA256 (1 << 24) +#define SIG_GROUP_HEAD_HAVEFILEMD5 BIT_U32(21) +#define SIG_GROUP_HEAD_HAVEFILESIZE BIT_U32(22) +#define SIG_GROUP_HEAD_HAVEFILESHA1 BIT_U32(23) +#define SIG_GROUP_HEAD_HAVEFILESHA256 BIT_U32(24) enum MpmBuiltinBuffers { MPMB_TCP_PKT_TS, @@ -1285,6 +1285,8 @@ typedef struct SigGroupHeadInitData_ { /** \brief Container for matching data for a signature group */ typedef struct SigGroupHead_ { uint32_t flags; + /* coccinelle: SigGroupHead:flags:SIG_GROUP_HEAD_ */ + /* number of sigs in this head */ SigIntId sig_cnt;