export_state_data_get!(rs_template_get_state_data, TemplateState);
// Parser name as a C style string.
-const PARSER_NAME: &[u8] = b"template-rust\0";
+const PARSER_NAME: &[u8] = b"template\0";
#[no_mangle]
pub unsafe extern "C" fn rs_template_register_parser() {
/* TEMPLATE_START_REMOVE */
- if crate::conf::conf_get_node("app-layer.protocols.template-rust").is_none() {
+ if crate::conf::conf_get_node("app-layer.protocols.template").is_none() {
return;
}
/* TEMPLATE_END_REMOVE */
-/* Copyright (C) 2007-2021 Open Information Security Foundation
+/* Copyright (C) 2007-2022 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
printf(" alproto: ALPROTO_SNMP\n");
else if (pp_pe->alproto == ALPROTO_SIP)
printf(" alproto: ALPROTO_SIP\n");
- else if (pp_pe->alproto == ALPROTO_TEMPLATE_RUST)
- printf(" alproto: ALPROTO_TEMPLATE_RUST\n");
+ else if (pp_pe->alproto == ALPROTO_TEMPLATE)
+ printf(" alproto: ALPROTO_TEMPLATE\n");
else if (pp_pe->alproto == ALPROTO_RFB)
printf(" alproto: ALPROTO_RFB\n");
else if (pp_pe->alproto == ALPROTO_MQTT)
printf(" alproto: ALPROTO_SNMP\n");
else if (pp_pe->alproto == ALPROTO_SIP)
printf(" alproto: ALPROTO_SIP\n");
- else if (pp_pe->alproto == ALPROTO_TEMPLATE_RUST)
- printf(" alproto: ALPROTO_TEMPLATE_RUST\n");
+ else if (pp_pe->alproto == ALPROTO_TEMPLATE)
+ printf(" alproto: ALPROTO_TEMPLATE\n");
else if (pp_pe->alproto == ALPROTO_RFB)
printf(" alproto: ALPROTO_RFB\n");
else if (pp_pe->alproto == ALPROTO_MQTT)
-/* Copyright (C) 2007-2021 Open Information Security Foundation
+/* Copyright (C) 2007-2022 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
case ALPROTO_TELNET:
proto_name = "telnet";
break;
- case ALPROTO_TEMPLATE_RUST:
- proto_name = "template-rust";
+ case ALPROTO_TEMPLATE:
+ proto_name = "template";
break;
case ALPROTO_RDP:
proto_name = "rdp";
return ALPROTO_PGSQL;
if (strcmp(proto_name, "telnet") == 0)
return ALPROTO_TELNET;
- if (strcmp(proto_name, "template-rust") == 0)
- return ALPROTO_TEMPLATE_RUST;
+ if (strcmp(proto_name, "template") == 0)
+ return ALPROTO_TEMPLATE;
if (strcmp(proto_name,"rdp")==0) return ALPROTO_RDP;
if (strcmp(proto_name,"http2")==0) return ALPROTO_HTTP2;
if (strcmp(proto_name, "bittorrent-dht") == 0)
ALPROTO_MQTT,
ALPROTO_PGSQL,
ALPROTO_TELNET,
- ALPROTO_TEMPLATE_RUST,
+ ALPROTO_TEMPLATE,
ALPROTO_RDP,
ALPROTO_HTTP2,
ALPROTO_BITTORRENT_DHT,
DETECT_TCPMSS,
DETECT_FTPDATA,
DETECT_TARGET,
- DETECT_AL_TEMPLATE_RUST_BUFFER,
+ DETECT_AL_TEMPLATE_BUFFER,
DETECT_AL_DHCP_LEASETIME,
DETECT_AL_DHCP_REBINDING_TIME,
DETECT_AL_DHCP_RENEWAL_TIME,
-/* Copyright (C) 2015-2017 Open Information Security Foundation
+/* Copyright (C) 2015-2022 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
return;
}
/* TEMPLATE_END_REMOVE */
- sigmatch_table[DETECT_AL_TEMPLATE_RUST_BUFFER].name =
- "template_rust_buffer";
- sigmatch_table[DETECT_AL_TEMPLATE_RUST_BUFFER].desc =
+ sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template_rust_buffer";
+ sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].desc =
"Template content modifier to match on the template buffers";
- sigmatch_table[DETECT_AL_TEMPLATE_RUST_BUFFER].Setup =
- DetectTemplateRustBufferSetup;
+ sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].Setup = DetectTemplateRustBufferSetup;
#ifdef UNITTESTS
- sigmatch_table[DETECT_AL_TEMPLATE_RUST_BUFFER].RegisterTests =
- DetectTemplateRustBufferRegisterTests;
+ sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].RegisterTests = DetectTemplateRustBufferRegisterTests;
#endif
- sigmatch_table[DETECT_AL_TEMPLATE_RUST_BUFFER].flags |= SIGMATCH_NOOPT;
+ sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].flags |= SIGMATCH_NOOPT;
/* register inspect engines */
- DetectAppLayerInspectEngineRegister2("template_rust_buffer", ALPROTO_TEMPLATE_RUST,
- SIG_FLAG_TOSERVER, 0, DetectEngineInspectTemplateRustBuffer, NULL);
- DetectAppLayerInspectEngineRegister2("template_rust_buffer", ALPROTO_TEMPLATE_RUST,
- SIG_FLAG_TOCLIENT, 0, DetectEngineInspectTemplateRustBuffer, NULL);
+ DetectAppLayerInspectEngineRegister2("template_buffer", ALPROTO_TEMPLATE, SIG_FLAG_TOSERVER, 0,
+ DetectEngineInspectTemplateRustBuffer, NULL);
+ DetectAppLayerInspectEngineRegister2("template_buffer", ALPROTO_TEMPLATE, SIG_FLAG_TOCLIENT, 0,
+ DetectEngineInspectTemplateRustBuffer, NULL);
- g_template_rust_id = DetectBufferTypeGetByName("template_rust_buffer");
+ g_template_rust_id = DetectBufferTypeGetByName("template_buffer");
SCLogNotice("Template application layer detect registered.");
}
{
s->init_data->list = g_template_rust_id;
- if (DetectSignatureSetAppProto(s, ALPROTO_TEMPLATE_RUST) != 0)
+ if (DetectSignatureSetAppProto(s, ALPROTO_TEMPLATE) != 0)
return -1;
return 0;
memset(&tv, 0, sizeof(ThreadVars));
p = UTHBuildPacket(request, sizeof(request), IPPROTO_TCP);
FLOW_INITIALIZE(&f);
- f.alproto = ALPROTO_TEMPLATE_RUST;
+ f.alproto = ALPROTO_TEMPLATE;
f.protoctx = (void *)&tcp;
f.proto = IPPROTO_TCP;
f.flags |= FLOW_IPV4;
DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx);
AppLayerParserParse(
- NULL, alp_tctx, &f, ALPROTO_TEMPLATE_RUST, STREAM_TOSERVER, request, sizeof(request));
+ NULL, alp_tctx, &f, ALPROTO_TEMPLATE, STREAM_TOSERVER, request, sizeof(request));
/* Check that we have app-layer state. */
FAIL_IF_NULL(f.alstate);
-/* Copyright (C) 2018-2021 Open Information Security Foundation
+/* Copyright (C) 2018-2022 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
SCLogNotice("JsonTemplateLogger");
LogTemplateLogThread *thread = thread_data;
- JsonBuilder *js = CreateEveHeader(
- p, LOG_DIR_PACKET, "template-rust", NULL, thread->templatelog_ctx->eve_ctx);
+ JsonBuilder *js =
+ CreateEveHeader(p, LOG_DIR_PACKET, "template", NULL, thread->templatelog_ctx->eve_ctx);
if (unlikely(js == NULL)) {
return TM_ECODE_FAILED;
}
SCLogNotice("Template log sub-module initialized.");
- AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_TEMPLATE_RUST);
+ AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_TEMPLATE);
result.ctx = output_ctx;
result.ok = true;
void JsonTemplateRustLogRegister(void)
{
/* TEMPLATE_START_REMOVE */
- if (ConfGetNode("app-layer.protocols.template-rust") == NULL) {
+ if (ConfGetNode("app-layer.protocols.template") == NULL) {
return;
}
/* TEMPLATE_END_REMOVE */
/* Register as an eve sub-module. */
- OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTemplateRustLog",
- "eve-log.template-rust", OutputTemplateLogInitSub, ALPROTO_TEMPLATE_RUST,
- JsonTemplateLogger, JsonTemplateLogThreadInit, JsonTemplateLogThreadDeinit, NULL);
+ OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTemplateLog", "eve-log.template",
+ OutputTemplateLogInitSub, ALPROTO_TEMPLATE, JsonTemplateLogger,
+ JsonTemplateLogThreadInit, JsonTemplateLogThreadDeinit, NULL);
SCLogNotice("Template JSON logger registered.");
}