rust: remove all HAVE_RUST guards

pull/4295/head
Victor Julien 5 years ago
parent 6921608673
commit 5e9714e384

@ -25,16 +25,11 @@
#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);

@ -25,8 +25,6 @@
#include "util-unittest.h"
#ifdef HAVE_RUST
#include "app-layer-dns-tcp-rust.h"
#include "rust-dns-dns-gen.h"
@ -310,5 +308,3 @@ static void RustDNSTCPParserRegisterTests(void)
}
#endif /* UNITTESTS */
#endif /* HAVE_RUST */

@ -25,8 +25,6 @@
#include "util-unittest.h"
#ifdef HAVE_RUST
#include "app-layer-dns-udp-rust.h"
#include "rust-dns-dns-gen.h"
@ -376,5 +374,3 @@ static void RustDNSUDPParserRegisterTests(void)
}
#endif
#endif /* HAVE_RUST */

@ -34,8 +34,6 @@
#include "app-layer-krb5.h"
#ifdef HAVE_RUST
#include "rust-krb-krb5-gen.h"
void RegisterKRB5Parsers(void)
@ -56,11 +54,3 @@ void KRB5ParserRegisterTests(void)
#ifdef UNITTESTS
#endif
}
#else /* HAVE_RUST */
void RegisterKRB5Parsers(void)
{
}
#endif /* HAVE_RUST */

@ -37,13 +37,6 @@
#include "app-layer-nfs-tcp.h"
#ifndef HAVE_RUST
void RegisterNFSTCPParsers(void)
{
}
#else
#include "rust.h"
#include "rust-nfs-nfs-gen.h"
@ -416,5 +409,3 @@ void NFSTCPParserRegisterTests(void)
#ifdef UNITTESTS
#endif
}
#endif /* HAVE_RUST */

@ -34,13 +34,6 @@
#include "app-layer-nfs-udp.h"
#ifndef HAVE_RUST
void RegisterNFSUDPParsers(void)
{
}
#else
#include "rust.h"
#include "rust-nfs-nfs-gen.h"
@ -375,5 +368,3 @@ void NFSUDPParserRegisterTests(void)
#ifdef UNITTESTS
#endif
}
#endif /* HAVE_RUST */

@ -34,8 +34,6 @@
#include "app-layer-ntp.h"
#if defined(HAVE_RUST)
#include "rust-ntp-ntp-gen.h"
void RegisterNTPParsers(void)
@ -56,11 +54,3 @@ void NTPParserRegisterTests(void)
#ifdef UNITTESTS
#endif
}
#else /* HAVE_RUST */
void RegisterNTPParsers(void)
{
}
#endif /* HAVE_RUST */

@ -44,13 +44,10 @@
#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) {
@ -59,7 +56,6 @@ void RegisterTemplateRustParsers(void)
/* TEMPLATE_END_REMOVE */
SCLogNotice("Registring Rust template parser.");
rs_template_register_parser();
#endif
#ifdef UNITTESTS
AppLayerParserRegisterProtocolUnittests(IPPROTO_TCP, ALPROTO_TEMPLATE_RUST,
TemplateRustParserRegisterTests);

@ -97,14 +97,12 @@ void DetectFiledataRegister(void)
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,
@ -114,14 +112,12 @@ void DetectFiledataRegister(void)
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");

@ -29,8 +29,6 @@
#include "detect-krb5-errcode.h"
#ifdef HAVE_RUST
#include "app-layer-krb5.h"
#include "rust-krb-detect-gen.h"
@ -264,11 +262,3 @@ static void DetectKrb5ErrCodeRegisterTests(void) {
DetectKrb5ErrCodeSignatureTest01);
#endif /* UNITTESTS */
}
#else /* HAVE_RUST */
void DetectKrb5ErrCodeRegister(void)
{
}
#endif /* HAVE_RUST */

@ -29,8 +29,6 @@
#include "detect-krb5-msgtype.h"
#ifdef HAVE_RUST
#include "app-layer-krb5.h"
#include "rust-krb-detect-gen.h"
@ -261,11 +259,3 @@ static void DetectKrb5MsgTypeRegisterTests(void) {
DetectKrb5MsgTypeSignatureTest01);
#endif /* UNITTESTS */
}
#else /* HAVE_RUST */
void DetectKrb5MsgTypeRegister(void)
{
}
#endif /* HAVE_RUST */

@ -38,15 +38,6 @@
#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 *,
@ -222,5 +213,3 @@ static void DetectTemplateRustBufferRegisterTests(void)
DetectTemplateRustBufferTest);
#endif /* UNITTESTS */
}
#endif

@ -464,7 +464,6 @@ static int AlertJson(ThreadVars *tv, JsonAlertLogThread *aft, const Packet *p)
}
}
#ifdef HAVE_RUST
if (proto == ALPROTO_NFS) {
hjs = JsonNFSAddMetadataRPC(p->flow, pa->tx_id);
if (hjs)
@ -481,7 +480,6 @@ static int AlertJson(ThreadVars *tv, JsonAlertLogThread *aft, const Packet *p)
if (hjs)
json_object_set_new(js, "sip", hjs);
}
#endif
if (proto == ALPROTO_FTPDATA) {
hjs = JsonFTPDataAddMetadata(p->flow);
if (hjs)

@ -51,8 +51,6 @@
#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_ {
@ -179,11 +177,3 @@ void JsonDHCPLogRegister(void)
JsonDHCPLogger, JsonDHCPLogThreadInit,
JsonDHCPLogThreadDeinit, NULL);
}
#else /* No JSON support. */
void JsonDHCPLogRegister(void)
{
}
#endif /* HAVE_LIBJANSSON */

@ -47,7 +47,6 @@
#include "app-layer-ikev2.h"
#include "output-json-ikev2.h"
#ifdef HAVE_RUST
#ifdef HAVE_LIBJANSSON
#include "rust.h"
@ -187,10 +186,3 @@ void JsonIKEv2LogRegister(void)
}
#endif /* HAVE_LIBJANSSON */
#else /* No rust support. */
void JsonIKEv2LogRegister(void)
{
}
#endif /* HAVE_RUST */

@ -47,7 +47,6 @@
#include "app-layer-krb5.h"
#include "output-json-krb5.h"
#ifdef HAVE_RUST
#ifdef HAVE_LIBJANSSON
#include "rust.h"
@ -188,10 +187,3 @@ void JsonKRB5LogRegister(void)
}
#endif /* HAVE_LIBJANSSON */
#else /* No rust support. */
void JsonKRB5LogRegister(void)
{
}
#endif /* HAVE_RUST */

@ -46,7 +46,6 @@
#include "output-json-nfs.h"
#ifdef HAVE_RUST
#ifdef HAVE_LIBJANSSON
#include "rust.h"
#include "rust-nfs-log-gen.h"
@ -142,11 +141,3 @@ void JsonNFSLogRegister(void)
}
#endif /* HAVE_LIBJANSSON */
#else /* no rust */
void JsonNFSLogRegister(void)
{
}
#endif /* HAVE_RUST */

@ -25,8 +25,6 @@
#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__ */

@ -47,7 +47,6 @@
#include "app-layer-snmp.h"
#include "output-json-snmp.h"
#ifdef HAVE_RUST
#ifdef HAVE_LIBJANSSON
#include "rust.h"
@ -187,10 +186,3 @@ void JsonSNMPLogRegister(void)
}
#endif /* HAVE_LIBJANSSON */
#else /* No rust support. */
void JsonSNMPLogRegister(void)
{
}
#endif /* HAVE_RUST */

@ -53,8 +53,6 @@
#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_ {
@ -185,11 +183,3 @@ void JsonTemplateRustLogRegister(void)
SCLogNotice("Template JSON logger registered.");
}
#else /* No JSON support. */
void JsonTemplateRustLogRegister(void)
{
}
#endif /* HAVE_LIBJANSSON */

@ -48,8 +48,6 @@
#include "app-layer-tftp.h"
#include "output-json-tftp.h"
#ifdef HAVE_RUST
#include "rust.h"
#include "rust-tftp-log-gen.h"
@ -179,13 +177,6 @@ void JsonTFTPLogRegister(void)
SCLogDebug("TFTP JSON logger registered.");
}
#else /* HAVE_RUST */
void JsonTFTPLogRegister(void)
{
}
#endif /* HAVE_RUST */
#else /* HAVE_LIBJANSSON */

@ -176,10 +176,8 @@
#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.
@ -767,9 +765,7 @@ static void PrintBuildInfo(void)
#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));
}
@ -2946,7 +2942,6 @@ int main(int argc, char **argv)
{
SCInstanceInit(&suricata, argv[0]);
#ifdef HAVE_RUST
SuricataContext context;
context.SCLogMessage = SCLogMessage;
context.DetectEngineStateFree = DetectEngineStateFree;
@ -2963,7 +2958,6 @@ int main(int argc, char **argv)
context.FileSetTx = FileContainerSetTx;
rs_init(&context);
#endif
SC_ATOMIC_INIT(engine_stage);

@ -43,9 +43,7 @@
#include "util-unittest.h"
#include "util-syslog.h"
#ifdef HAVE_RUST
#include "rust-log-gen.h"
#endif
#include "conf.h"
@ -1286,10 +1284,7 @@ void SCLogInitLogModule(SCLogInitData *sc_lid)
//SCOutputPrint(sc_did->startup_message);
#ifdef HAVE_RUST
rs_log_set_level(sc_log_global_log_level);
#endif
return;
}

Loading…
Cancel
Save