{
const char *proto_name = "template";
- /* TEMPLATE_START_REMOVE */
-#ifndef UNITTESTS
- /* Ensure template registration for unittests */
- if (ConfGetNode("app-layer.protocols.template") == NULL) {
- return;
- }
-#endif
- /* 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)) {
+ * the configuration file then it will be disabled by default. */
+ if (AppLayerProtoDetectConfProtoDetectionEnabledDefault("tcp", proto_name, false)) {
- SCLogNotice("Template TCP protocol detection enabled.");
+ SCLogDebug("Template TCP protocol detection enabled.");
AppLayerProtoDetectRegisterProtocol(ALPROTO_TEMPLATE, proto_name);
if (!AppLayerProtoDetectPPParseConfPorts("tcp", IPPROTO_TCP,
proto_name, ALPROTO_TEMPLATE, 0, TEMPLATE_MIN_FRAME_LEN,
TemplateProbingParserTs, TemplateProbingParserTc)) {
- SCLogNotice("No template app-layer configuration, enabling echo"
- " detection TCP detection on port %s.",
- TEMPLATE_DEFAULT_PORT);
+ SCLogDebug("No template app-layer configuration, enabling echo"
+ " detection TCP detection on port %s.",
+ TEMPLATE_DEFAULT_PORT);
AppLayerProtoDetectPPRegister(IPPROTO_TCP,
TEMPLATE_DEFAULT_PORT, ALPROTO_TEMPLATE, 0,
TEMPLATE_MIN_FRAME_LEN, STREAM_TOSERVER,
}
else {
- SCLogNotice("Protocol detector and parser disabled for Template.");
+ SCLogDebug("Protocol detector and parser disabled for Template.");
return;
}
APP_LAYER_PARSER_OPT_ACCEPT_GAPS);
}
else {
- SCLogNotice("Template protocol parsing disabled.");
+ SCLogDebug("Template protocol parsing disabled.");
}
#ifdef UNITTESTS
void DetectTemplateBufferRegister(void)
{
/* TEMPLATE_START_REMOVE */
-#ifndef UNITTESTS
- /* Ensure registration when running unittests */
- if (ConfGetNode("app-layer.protocols.template") == NULL) {
- return;
+ /* Prevent registration of this buffer unless explicitly enabled or when
+ * running unittests. This will be removed during code generation from this
+ * template. */
+ if (!RunmodeIsUnittests()) {
+ if (ConfGetNode("app-layer.protocols.template") == NULL) {
+ return;
+ }
}
-#endif
/* TEMPLATE_END_REMOVE */
sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template_buffer";
sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].desc =
g_template_buffer_id = DetectBufferTypeGetByName("template_buffer");
- SCLogNotice("Template application layer detect registered.");
+ /* NOTE: You may want to change this to SCLogNotice during development. */
+ SCLogDebug("Template application layer detect registered.");
}
static int DetectTemplateBufferSetup(DetectEngineCtx *de_ctx, Signature *s,