#include "util-unittest.h"
#include "app-layer-parser.h"
#include "app-layer-dhcp.h"
-
-#ifdef HAVE_RUST
#include "rust-dhcp-dhcp-gen.h"
-#endif /* HAVE_RUST */
void RegisterDHCPParsers(void)
{
-#ifdef HAVE_RUST
rs_dhcp_register_parser();
-#endif /* HAVE_RUST */
#ifdef UNITTESTS
AppLayerParserRegisterProtocolUnittests(IPPROTO_TCP, ALPROTO_DHCP,
DHCPParserRegisterTests);
#include "util-unittest.h"
-#ifdef HAVE_RUST
-
#include "app-layer-dns-tcp-rust.h"
#include "rust-dns-dns-gen.h"
}
#endif /* UNITTESTS */
-
-#endif /* HAVE_RUST */
#include "util-unittest.h"
-#ifdef HAVE_RUST
-
#include "app-layer-dns-udp-rust.h"
#include "rust-dns-dns-gen.h"
}
#endif
-
-#endif /* HAVE_RUST */
#include "app-layer-krb5.h"
-#ifdef HAVE_RUST
-
#include "rust-krb-krb5-gen.h"
void RegisterKRB5Parsers(void)
#ifdef UNITTESTS
#endif
}
-
-#else /* HAVE_RUST */
-
-void RegisterKRB5Parsers(void)
-{
-}
-
-#endif /* HAVE_RUST */
#include "app-layer-nfs-tcp.h"
-#ifndef HAVE_RUST
-void RegisterNFSTCPParsers(void)
-{
-}
-
-#else
-
#include "rust.h"
#include "rust-nfs-nfs-gen.h"
#ifdef UNITTESTS
#endif
}
-
-#endif /* HAVE_RUST */
#include "app-layer-nfs-udp.h"
-#ifndef HAVE_RUST
-void RegisterNFSUDPParsers(void)
-{
-}
-
-#else
-
#include "rust.h"
#include "rust-nfs-nfs-gen.h"
#ifdef UNITTESTS
#endif
}
-
-#endif /* HAVE_RUST */
#include "app-layer-ntp.h"
-#if defined(HAVE_RUST)
-
#include "rust-ntp-ntp-gen.h"
void RegisterNTPParsers(void)
#ifdef UNITTESTS
#endif
}
-
-#else /* HAVE_RUST */
-
-void RegisterNTPParsers(void)
-{
-}
-
-#endif /* HAVE_RUST */
#include "app-layer-template-rust.h"
-#ifdef HAVE_RUST
#include "rust-applayertemplate-template-gen.h"
-#endif
void RegisterTemplateRustParsers(void)
{
-#ifdef HAVE_RUST
/* TEMPLATE_START_REMOVE */
/* Only register if enabled in config. */
if (ConfGetNode("app-layer.protocols.template-rust") == NULL) {
/* TEMPLATE_END_REMOVE */
SCLogNotice("Registring Rust template parser.");
rs_template_register_parser();
-#endif
#ifdef UNITTESTS
AppLayerParserRegisterProtocolUnittests(IPPROTO_TCP, ALPROTO_TEMPLATE_RUST,
TemplateRustParserRegisterTests);
PrefilterGenericMpmRegister,
HttpServerBodyGetDataCallback,
ALPROTO_HTTP, HTP_RESPONSE_BODY);
-#ifdef HAVE_RUST
DetectAppLayerMpmRegister2("file_data", SIG_FLAG_TOSERVER, 2,
PrefilterMpmFiledataRegister, NULL,
ALPROTO_SMB, 0);
DetectAppLayerMpmRegister2("file_data", SIG_FLAG_TOCLIENT, 2,
PrefilterMpmFiledataRegister, NULL,
ALPROTO_SMB, 0);
-#endif
DetectAppLayerInspectEngineRegister2("file_data",
ALPROTO_HTTP, SIG_FLAG_TOCLIENT, HTP_RESPONSE_BODY,
DetectEngineInspectFiledata, NULL);
DetectBufferTypeRegisterSetupCallback("file_data",
DetectFiledataSetupCallback);
-#ifdef HAVE_RUST
DetectAppLayerInspectEngineRegister2("file_data",
ALPROTO_SMB, SIG_FLAG_TOSERVER, 0,
DetectEngineInspectFiledata, NULL);
DetectAppLayerInspectEngineRegister2("file_data",
ALPROTO_SMB, SIG_FLAG_TOCLIENT, 0,
DetectEngineInspectFiledata, NULL);
-#endif
DetectBufferTypeSetDescriptionByName("file_data",
"http response body, smb files or smtp attachments data");
#include "detect-krb5-errcode.h"
-#ifdef HAVE_RUST
-
#include "app-layer-krb5.h"
#include "rust-krb-detect-gen.h"
DetectKrb5ErrCodeSignatureTest01);
#endif /* UNITTESTS */
}
-
-#else /* HAVE_RUST */
-
-void DetectKrb5ErrCodeRegister(void)
-{
-}
-
-#endif /* HAVE_RUST */
#include "detect-krb5-msgtype.h"
-#ifdef HAVE_RUST
-
#include "app-layer-krb5.h"
#include "rust-krb-detect-gen.h"
DetectKrb5MsgTypeSignatureTest01);
#endif /* UNITTESTS */
}
-
-#else /* HAVE_RUST */
-
-void DetectKrb5MsgTypeRegister(void)
-{
-}
-
-#endif /* HAVE_RUST */
#include "detect-engine-content-inspection.h"
#include "detect-template-rust-buffer.h"
#include "app-layer-parser.h"
-
-#ifndef HAVE_RUST
-
-void DetectTemplateRustBufferRegister(void)
-{
-}
-
-#else
-
#include "rust-applayertemplate-template-gen.h"
static int DetectTemplateRustBufferSetup(DetectEngineCtx *, Signature *,
DetectTemplateRustBufferTest);
#endif /* UNITTESTS */
}
-
-#endif
}
}
-#ifdef HAVE_RUST
if (proto == ALPROTO_NFS) {
hjs = JsonNFSAddMetadataRPC(p->flow, pa->tx_id);
if (hjs)
if (hjs)
json_object_set_new(js, "sip", hjs);
}
-#endif
if (proto == ALPROTO_FTPDATA) {
hjs = JsonFTPDataAddMetadata(p->flow);
if (hjs)
#include "app-layer-dhcp.h"
#include "output-json-dhcp.h"
-#if defined(HAVE_LIBJANSSON) && defined(HAVE_RUST)
-
#include "rust-dhcp-logger-gen.h"
typedef struct LogDHCPFileCtx_ {
JsonDHCPLogger, JsonDHCPLogThreadInit,
JsonDHCPLogThreadDeinit, NULL);
}
-
-#else /* No JSON support. */
-
-void JsonDHCPLogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
#include "app-layer-ikev2.h"
#include "output-json-ikev2.h"
-#ifdef HAVE_RUST
#ifdef HAVE_LIBJANSSON
#include "rust.h"
}
#endif /* HAVE_LIBJANSSON */
-#else /* No rust support. */
-
-void JsonIKEv2LogRegister(void)
-{
-}
-
-#endif /* HAVE_RUST */
#include "app-layer-krb5.h"
#include "output-json-krb5.h"
-#ifdef HAVE_RUST
#ifdef HAVE_LIBJANSSON
#include "rust.h"
}
#endif /* HAVE_LIBJANSSON */
-#else /* No rust support. */
-
-void JsonKRB5LogRegister(void)
-{
-}
-
-#endif /* HAVE_RUST */
#include "output-json-nfs.h"
-#ifdef HAVE_RUST
#ifdef HAVE_LIBJANSSON
#include "rust.h"
#include "rust-nfs-log-gen.h"
}
#endif /* HAVE_LIBJANSSON */
-
-#else /* no rust */
-
-void JsonNFSLogRegister(void)
-{
-}
-
-#endif /* HAVE_RUST */
#define __OUTPUT_JSON_NFS_H__
void JsonNFSLogRegister(void);
-#ifdef HAVE_RUST
json_t *JsonNFSAddMetadataRPC(const Flow *f, uint64_t tx_id);
json_t *JsonNFSAddMetadata(const Flow *f, uint64_t tx_id);
-#endif /* HAVE_RUST */
#endif /* __OUTPUT_JSON_NFS_H__ */
#include "app-layer-snmp.h"
#include "output-json-snmp.h"
-#ifdef HAVE_RUST
#ifdef HAVE_LIBJANSSON
#include "rust.h"
}
#endif /* HAVE_LIBJANSSON */
-#else /* No rust support. */
-
-void JsonSNMPLogRegister(void)
-{
-}
-
-#endif /* HAVE_RUST */
#include "app-layer-template-rust.h"
#include "output-json-template-rust.h"
-#if defined(HAVE_LIBJANSSON) && defined(HAVE_RUST)
-
#include "rust-applayertemplate-logger-gen.h"
typedef struct LogTemplateFileCtx_ {
SCLogNotice("Template JSON logger registered.");
}
-
-#else /* No JSON support. */
-
-void JsonTemplateRustLogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
#include "app-layer-tftp.h"
#include "output-json-tftp.h"
-#ifdef HAVE_RUST
-
#include "rust.h"
#include "rust-tftp-log-gen.h"
SCLogDebug("TFTP JSON logger registered.");
}
-#else /* HAVE_RUST */
-
-void JsonTFTPLogRegister(void)
-{
-}
-
-#endif /* HAVE_RUST */
#else /* HAVE_LIBJANSSON */
#include "util-lua.h"
-#ifdef HAVE_RUST
#include "rust.h"
#include "rust-core-gen.h"
-#endif
/*
* we put this here, because we only use it here in main.
#ifdef HAVE_MAGIC
strlcat(features, "MAGIC ", sizeof(features));
#endif
-#if defined(HAVE_RUST)
strlcat(features, "RUST ", sizeof(features));
-#endif
if (strlen(features) == 0) {
strlcat(features, "none", sizeof(features));
}
{
SCInstanceInit(&suricata, argv[0]);
-#ifdef HAVE_RUST
SuricataContext context;
context.SCLogMessage = SCLogMessage;
context.DetectEngineStateFree = DetectEngineStateFree;
context.FileSetTx = FileContainerSetTx;
rs_init(&context);
-#endif
SC_ATOMIC_INIT(engine_stage);
#include "util-unittest.h"
#include "util-syslog.h"
-#ifdef HAVE_RUST
#include "rust-log-gen.h"
-#endif
#include "conf.h"
//SCOutputPrint(sc_did->startup_message);
-#ifdef HAVE_RUST
rs_log_set_level(sc_log_global_log_level);
-#endif
-
return;
}