#include "suricata-common.h"
#include "stream.h"
+#include "conf.h"
#include "util-unittest.h"
{
char *proto_name = "template";
+ /* TEMPLATE_START_REMOVE */
+ if (ConfGetNode("app-layer.protocols.template") == NULL) {
+ return;
+ }
+ /* TEMPLATE_END_REMOVE */
+
/* Check if Template TCP detection is enabled. If it does not exist in
* the configuration file then it will be enabled by default. */
if (AppLayerProtoDetectConfProtoDetectionEnabled("tcp", proto_name)) {
STREAM_TOSERVER, TemplateParseRequest);
/* Register response parser for parsing frames from server to client. */
- AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_TEMPLATE, STREAM_TOCLIENT,
- TemplateParseResponse);
+ AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_TEMPLATE,
+ STREAM_TOCLIENT, TemplateParseResponse);
/* Register a function to be called by the application layer
* when a transaction is to be freed. */
TemplateStateTxFree);
/* Register a function to return the current transaction count. */
- AppLayerParserRegisterGetTxCnt(IPPROTO_TCP, ALPROTO_TEMPLATE, TemplateGetTxCnt);
+ AppLayerParserRegisterGetTxCnt(IPPROTO_TCP, ALPROTO_TEMPLATE,
+ TemplateGetTxCnt);
/* Transaction handling. */
AppLayerParserRegisterGetStateProgressCompletionStatus(IPPROTO_TCP,
*/
#include "suricata-common.h"
+#include "conf.h"
#include "detect.h"
#include "app-layer-template.h"
void DetectTemplateBufferRegister(void)
{
+ if (ConfGetNode("app-layer.protocols.template") == NULL) {
+ return;
+ }
+
sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template_buffer";
sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].desc =
"Template content modififier to match on the template buffers";
void TmModuleJsonTemplateLogRegister(void)
{
+ if (ConfGetNode("app-layer.protocols.template") == NULL) {
+ return;
+ }
+
tmm_modules[TMM_JSONTEMPLATELOG].name = "JsonTemplateLog";
tmm_modules[TMM_JSONTEMPLATELOG].ThreadInit = JsonTemplateLogThreadInit;
tmm_modules[TMM_JSONTEMPLATELOG].ThreadDeinit = JsonTemplateLogThreadDeinit;