From 8a0bea872c8d73e4fa2ae4bd3c7e123fbb15c5ef Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 23 Sep 2016 09:35:53 +0200 Subject: [PATCH] template_buffer: register inspect engine from keyword --- src/detect-engine.c | 11 ++--------- src/detect-template-buffer.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/detect-engine.c b/src/detect-engine.c index 6e9c6a78ae..e83f3ee533 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -47,7 +47,6 @@ #include "detect-engine-uri.h" #include "detect-engine-hrhd.h" #include "detect-engine-file.h" -#include "detect-engine-template.h" #include "detect-engine.h" #include "detect-engine-state.h" @@ -115,17 +114,11 @@ void DetectEngineRegisterAppInspectionEngines(void) }; struct tmp_t data_toserver[] = { - /* Template. */ - { ALPROTO_TEMPLATE, - DETECT_SM_LIST_TEMPLATE_BUFFER_MATCH, - DetectEngineInspectTemplateBuffer }, + {0,0,NULL}, }; struct tmp_t data_toclient[] = { - /* Template. */ - { ALPROTO_TEMPLATE, - DETECT_SM_LIST_TEMPLATE_BUFFER_MATCH, - DetectEngineInspectTemplateBuffer }, + {0,0,NULL}, }; size_t i; diff --git a/src/detect-template-buffer.c b/src/detect-template-buffer.c index 65debf5ecb..83b55765a0 100644 --- a/src/detect-template-buffer.c +++ b/src/detect-template-buffer.c @@ -33,7 +33,9 @@ #include "suricata-common.h" #include "conf.h" #include "detect.h" +#include "detect-engine.h" #include "app-layer-template.h" +#include "detect-engine-template.h" static int DetectTemplateBufferSetup(DetectEngineCtx *, Signature *, char *); static void DetectTemplateBufferRegisterTests(void); @@ -55,6 +57,14 @@ void DetectTemplateBufferRegister(void) sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].flags |= SIGMATCH_PAYLOAD; + /* register inspect engines */ + DetectAppLayerInspectEngineRegister(ALPROTO_TEMPLATE, SIG_FLAG_TOSERVER, + DETECT_SM_LIST_TEMPLATE_BUFFER_MATCH, + DetectEngineInspectTemplateBuffer); + DetectAppLayerInspectEngineRegister(ALPROTO_TEMPLATE, SIG_FLAG_TOCLIENT, + DETECT_SM_LIST_TEMPLATE_BUFFER_MATCH, + DetectEngineInspectTemplateBuffer); + SCLogNotice("Template application layer detect registered."); }