From a7f4fd12d5d4e6f8c7f987cd6cdc9b79f8847735 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Wed, 5 Mar 2025 17:26:49 +0100 Subject: [PATCH] detect: remove never set SIGMATCH_NOT_BUILT --- src/detect-engine-register.c | 17 +---------------- src/detect.h | 5 +++-- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/detect-engine-register.c b/src/detect-engine-register.c index cb3d1bf4c4..00644e1e97 100644 --- a/src/detect-engine-register.c +++ b/src/detect-engine-register.c @@ -361,10 +361,6 @@ static void SigMultilinePrint(int i, const char *prefix) bool SigTableHasKeyword(const char *keyword) { for (int i = 0; i < DETECT_TBLSIZE; i++) { - if (sigmatch_table[i].flags & SIGMATCH_NOT_BUILT) { - continue; - } - const char *name = sigmatch_table[i].name; if (name == NULL || strlen(name) == 0) { @@ -392,11 +388,7 @@ int SigTableList(const char *keyword) if (name[0] == '_' || strcmp(name, "template") == 0) continue; - if (sigmatch_table[i].flags & SIGMATCH_NOT_BUILT) { - printf("- %s (not built-in)\n", name); - } else { - printf("- %s\n", name); - } + printf("- %s\n", name); } } } else if (strcmp("csv", keyword) == 0) { @@ -404,9 +396,6 @@ int SigTableList(const char *keyword) for (i = 0; i < size; i++) { const char *name = sigmatch_table[i].name; if (name != NULL && strlen(name) > 0) { - if (sigmatch_table[i].flags & SIGMATCH_NOT_BUILT) { - continue; - } if (name[0] == '_' || strcmp(name, "template") == 0) continue; @@ -440,10 +429,6 @@ int SigTableList(const char *keyword) if ((sigmatch_table[i].name != NULL) && strcmp(sigmatch_table[i].name, keyword) == 0) { printf("= %s =\n", sigmatch_table[i].name); - if (sigmatch_table[i].flags & SIGMATCH_NOT_BUILT) { - printf("Not built-in\n"); - return TM_ECODE_FAILED; - } SigMultilinePrint(i, ""); return TM_ECODE_DONE; } diff --git a/src/detect.h b/src/detect.h index a663bf07fa..e84c4ba90d 100644 --- a/src/detect.h +++ b/src/detect.h @@ -1594,8 +1594,9 @@ typedef struct SigGroupHead_ { #define SIGMATCH_IPONLY_COMPAT BIT_U16(1) /** sigmatch is compatible with a decode event only rule */ #define SIGMATCH_DEONLY_COMPAT BIT_U16(2) -/**< Flag to indicate that the signature is not built-in */ -#define SIGMATCH_NOT_BUILT BIT_U16(3) + +// vacancy + /** sigmatch may have options, so the parser should be ready to * deal with both cases */ #define SIGMATCH_OPTIONAL_OPT BIT_U16(4) -- 2.47.3