]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
jansson: remove HAVE_LIBJANSSON guards
authorVictor Julien <victor@inliniac.net>
Fri, 11 Oct 2019 10:06:59 +0000 (12:06 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 11 Oct 2019 12:56:22 +0000 (14:56 +0200)
51 files changed:
scripts/dnp3-gen/dnp3-gen.py
src/alert-prelude.c
src/detect-engine-build.c
src/detect-engine-profile.c
src/detect-flowbits.c
src/detect.c
src/output-json-alert.c
src/output-json-alert.h
src/output-json-anomaly.h
src/output-json-common.c
src/output-json-dnp3-objects.c
src/output-json-dnp3-objects.h
src/output-json-dnp3.c
src/output-json-dnp3.h
src/output-json-drop.c
src/output-json-email-common.c
src/output-json-email-common.h
src/output-json-flow.c
src/output-json-flow.h
src/output-json-ftp.c
src/output-json-http.c
src/output-json-http.h
src/output-json-ikev2.c
src/output-json-krb5.c
src/output-json-metadata.c
src/output-json-netflow.c
src/output-json-nfs.c
src/output-json-sip.c
src/output-json-sip.h
src/output-json-smb.c
src/output-json-smtp.c
src/output-json-smtp.h
src/output-json-snmp.c
src/output-json-ssh.c
src/output-json-ssh.h
src/output-json-stats.c
src/output-json-stats.h
src/output-json-template.c
src/output-json-tftp.c
src/output-json-tls.c
src/output-json-tls.h
src/output-json.c
src/output-json.h
src/runmodes.c
src/suricata-common.h
src/suricata.c
src/util-conf.c
src/util-debug.c
src/util-logopenfile.c
src/util-profiling-rulegroups.c
src/util-profiling-rules.c

index 261b347fe466adbbd3bc8cd91d010c20910e8d66..ae2fef7baa898d8a7fedd21ed4a3daf888f34c69 100755 (executable)
@@ -158,8 +158,6 @@ output_json_dnp3_objects_template = """/* Copyright (C) 2015 Open Information Se
 #include "app-layer-dnp3-objects.h"
 #include "output-json-dnp3-objects.h"
 
-#ifdef HAVE_LIBJANSSON
-
 void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
     DNP3Point *point)
 {
@@ -215,8 +213,6 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
 
 }
 
-#endif /* HAVE_LIBJANSSON */
-
 """
 
 def has_freeable_types(fields):
index b26ac4754ca215c6d8c4843df4398bca23a32b6d..81f8bf1d9acccc244a22f3d8fdd2a67b763e5ce7 100644 (file)
 #include "util-print.h"
 
 #include "output.h"
-
-#ifdef HAVE_LIBJANSSON
 #include "output-json.h"
 #include "output-json-http.h"
 #include "output-json-tls.h"
 #include "output-json-ssh.h"
 #include "output-json-smtp.h"
 #include "output-json-email-common.h"
-#include <jansson.h>
-#endif
 
 #include "util-privs.h"
 #include "util-optimize.h"
@@ -473,7 +469,6 @@ static int AddIntData(idmef_alert_t *alert, const char *meaning, uint32_t data)
     SCReturnInt(0);
 }
 
-#ifdef HAVE_LIBJANSSON
 /**
  * \brief Add string data, to be stored in the Additional Data
  * field of the IDMEF alert (see section 4.2.4.6 of RFC 4765).
@@ -568,7 +563,6 @@ static int AddRealData(idmef_alert_t *alert, const char *meaning, uint32_t data)
 
     SCReturnInt(0);
 }
-#endif
 
 /**
  * \brief Add IPv4 header data, to be stored in the Additional Data
@@ -618,7 +612,6 @@ static int PacketToDataV6(const Packet *p, const PacketAlert *pa, idmef_alert_t
     SCReturnInt(0);
 }
 
-#ifdef HAVE_LIBJANSSON
 /**
  * \brief Convert JSON object to Prelude additional data with
  * the right type of data. Browse the JSON object to get
@@ -798,8 +791,6 @@ static void PacketToDataProtoEmail(const Packet *p, const PacketAlert *pa, idmef
 
 }
 
-#endif
-
 /**
  * \brief Convert IP packet to an IDMEF alert (RFC 4765).
  * This function stores the alert SID (description and reference),
@@ -814,7 +805,6 @@ static int PacketToData(const Packet *p, const PacketAlert *pa, idmef_alert_t *a
     if (unlikely(p == NULL))
         SCReturnInt(0);
 
-#ifdef HAVE_LIBJANSSON
     if (p->flow != NULL) {
         uint16_t proto = FlowGetAppProtocol(p->flow);
         switch (proto) {
@@ -834,7 +824,6 @@ static int PacketToData(const Packet *p, const PacketAlert *pa, idmef_alert_t *a
                 break;
         }
     }
-#endif
 
     AddIntData(alert, "snort_rule_sid", pa->s->id);
     AddIntData(alert, "snort_rule_rev", pa->s->rev);
index a07644685c7078991a68e4ee0ee2fab0ada1fd30..71d103aa9b9e39d407751166380b43229680bb54 100644 (file)
@@ -617,7 +617,6 @@ static int RuleMpmIsNegated(const Signature *s)
     return (cd->flags & DETECT_CONTENT_NEGATED);
 }
 
-#ifdef HAVE_LIBJANSSON
 static json_t *RulesGroupPrintSghStats(const SigGroupHead *sgh,
                                 const int add_rules, const int add_mpm_stats)
 {
@@ -850,12 +849,10 @@ static json_t *RulesGroupPrintSghStats(const SigGroupHead *sgh,
 
     return js;
 }
-#endif /* HAVE_LIBJANSSON */
 
 static void RulesDumpGrouping(const DetectEngineCtx *de_ctx,
                        const int add_rules, const int add_mpm_stats)
 {
-#ifdef HAVE_LIBJANSSON
     json_t *js = json_object();
     if (unlikely(js == NULL))
         return;
@@ -930,7 +927,6 @@ static void RulesDumpGrouping(const DetectEngineCtx *de_ctx,
     fprintf(fp, "%s\n", js_s);
     free(js_s);
     fclose(fp);
-#endif
     return;
 }
 
@@ -1846,9 +1842,7 @@ static int SigMatchPrepare(DetectEngineCtx *de_ctx)
         DetectEnginePktInspectionSetup(s);
 
         if (rule_engine_analysis_set) {
-#ifdef HAVE_LIBJANSSON
             EngineAnalysisRules2(de_ctx, s);
-#endif
         }
         /* free lists. Ctx' are xferred to sm_arrays so won't get freed */
         uint32_t i;
index 3b1d5cd7826b0f4f24ab9a69a61fd15c91188fc4..fb2603234a7f7fbaafa5ecc8a69cd6a9194671c3 100644 (file)
@@ -33,7 +33,6 @@
 #include "detect-engine-profile.h"
 
 #ifdef PROFILING
-#ifdef HAVE_LIBJANSSON
 #if 0
 static void DumpFp(const SigMatch *sm, char *pat_orig, uint32_t pat_orig_sz, char *pat_chop, uint32_t pat_chop_sz)
 {
@@ -139,5 +138,4 @@ void RulesDumpMatchArray(const DetectEngineThreadCtx *det_ctx,
     json_object_clear(js);
     json_decref(js);
 }
-#endif /* HAVE_LIBJANSSON */
 #endif /* PROFILING */
index 651303bd0a4b8bdf68e74844329b4a9618a2f35e..921beeba27d97213048070fb87592dba9d15bb9b 100644 (file)
@@ -329,11 +329,9 @@ struct FBAnalyze {
     uint32_t toggle_sids_size;
 };
 #ifdef PROFILING
-#ifdef HAVE_LIBJANSSON
 static void DetectFlowbitsAnalyzeDump(const DetectEngineCtx *de_ctx,
         struct FBAnalyze *array, uint32_t elements);
 #endif
-#endif
 
 void DetectFlowbitsAnalyze(DetectEngineCtx *de_ctx)
 {
@@ -520,10 +518,8 @@ void DetectFlowbitsAnalyze(DetectEngineCtx *de_ctx)
         SCFree(varname);
     }
 #ifdef PROFILING
-#ifdef HAVE_LIBJANSSON
     DetectFlowbitsAnalyzeDump(de_ctx, array, array_size);
 #endif
-#endif
 
 end:
     for (uint32_t i = 0; i < array_size; i++) {
@@ -536,7 +532,6 @@ end:
 }
 
 #ifdef PROFILING
-#ifdef HAVE_LIBJANSSON
 #include "output-json.h"
 #include "util-buffer.h"
 SCMutex g_flowbits_dump_write_m = SCMUTEX_INITIALIZER;
@@ -664,7 +659,6 @@ static void DetectFlowbitsAnalyzeDump(const DetectEngineCtx *de_ctx,
     json_object_clear(js);
     json_decref(js);
 }
-#endif /* HAVE_LIBJANSSON */
 #endif /* PROFILING */
 
 #ifdef UNITTESTS
index 62f430dc0b530c4fcdee2313eab693004ce98b35..890c743f2b2ab4b64bb22de36a02fcc25ab03a66 100644 (file)
@@ -729,10 +729,8 @@ static inline void DetectRulePacketRules(
 
     SGH_PROFILING_RECORD(det_ctx, scratch->sgh);
 #ifdef PROFILING
-#ifdef HAVE_LIBJANSSON
     if (match_cnt >= de_ctx->profile_match_logging_threshold)
         RulesDumpMatchArray(det_ctx, scratch->sgh, p);
-#endif
 #endif
 
     uint32_t sflags, next_sflags = 0;
index c3bba04a8776fcb70edc8bd92c04106dbe2771ed..b70be12082d2d891893c1e68938ab472ddaf39ff 100644 (file)
@@ -80,8 +80,6 @@
 
 #define MODULE_NAME "JsonAlertLog"
 
-#ifdef HAVE_LIBJANSSON
-
 #define LOG_JSON_PAYLOAD           BIT_U16(0)
 #define LOG_JSON_PACKET            BIT_U16(1)
 #define LOG_JSON_PAYLOAD_BASE64    BIT_U16(2)
@@ -1005,12 +1003,3 @@ void JsonAlertLogRegister (void)
         JsonAlertLogCondition, JsonAlertLogThreadInit, JsonAlertLogThreadDeinit,
         NULL);
 }
-
-#else
-
-void JsonAlertLogRegister (void)
-{
-}
-
-#endif
-
index 379ec8bb4473fd3fbcadaceb0a2afba099a6d57f..c8d3f7f456af50b7172d24925680ba688746b155 100644 (file)
 #define __OUTPUT_JSON_ALERT_H__
 
 void JsonAlertLogRegister(void);
-#ifdef HAVE_LIBJANSSON
 void AlertJsonHeader(void *ctx, const Packet *p, const PacketAlert *pa, json_t *js,
                      uint16_t flags);
-#endif /* HAVE_LIBJANSSON */
 
 #endif /* __OUTPUT_JSON_ALERT_H__ */
 
index 2e58551b5d829a13e0220cc5624790bd8e42806d..d4b2249bd0abf4ad38962b682eb1c99fe38abc56 100644 (file)
 #define __OUTPUT_JSON_ANOMALY_H__
 
 void JsonAnomalyLogRegister(void);
-#ifdef HAVE_LIBJANSSON
 void AnomalyJsonHeader(void *ctx, const Packet *p, const PacketAlert *pa, json_t *js,
                      uint16_t flags);
-#endif /* HAVE_LIBJANSSON */
 
 #endif /* __OUTPUT_JSON_ALERT_H__ */
 
index d6c59b48dcadb0019002f51b28a928312503f5fc..8165a96077572ce847fe96b677e5dd244810eea4 100644 (file)
@@ -41,8 +41,6 @@
 #include "app-layer.h"
 #include "app-layer-parser.h"
 
-#ifdef HAVE_LIBJANSSON
-
 static void OutputJsonLogDeInitCtxSub(OutputCtx *output_ctx)
 {
     SCFree(output_ctx->data);
@@ -108,6 +106,3 @@ TmEcode JsonLogThreadDeinit(ThreadVars *t, void *data)
     SCFree(thread);
     return TM_ECODE_OK;
 }
-
-#endif /* HAVE_LIBJANSSON */
-
index 2d44aaf0eab2b6d8793059253600dbc5e2641254..67d05b645a72510f3be12fc3e961b6eadaca2b63 100644 (file)
@@ -31,8 +31,6 @@
 #include "output-json-dnp3-objects.h"
 #include "output-json.h"
 
-#ifdef HAVE_LIBJANSSON
-
 void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
     DNP3Point *point)
 {
@@ -2718,5 +2716,3 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
     }
 
 }
-
-#endif /* HAVE_LIBJANSSON */
index 6517d0631da1f0f16044de8d88fc8aa31bcbd2bb..5ff3c0ea309c79974e6125c5042e8aee87d13b99 100644 (file)
@@ -18,9 +18,7 @@
 #ifndef __OUTPUT_JSON_DNP3_OBJECTS_H__
 #define __OUTPUT_JSON_DNP3_OBJECTS_H__
 
-#ifdef HAVE_LIBJANSSON
 void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
     DNP3Point *item);
-#endif /* HAVE_LIBJANSSON */
 
 #endif /* __OUTPUT_JSON_DNP3_OBJECTS_H__ */
index 5830fc0e20c3619e768d82d09c89ec9efa1840fc..dfa6ba054b55d0910bad9f6cb590772356c4890f 100644 (file)
@@ -43,9 +43,6 @@
 #include "output-json-dnp3.h"
 #include "output-json-dnp3-objects.h"
 
-#ifdef HAVE_LIBJANSSON
-#include <jansson.h>
-
 typedef struct LogDNP3FileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t    flags;
@@ -449,11 +446,3 @@ void JsonDNP3LogRegister(void)
         JsonDNP3LoggerToClient, 1, 1, JsonDNP3LogThreadInit,
         JsonDNP3LogThreadDeinit, NULL);
 }
-
-#else
-
-void JsonDNP3LogRegister (void)
-{
-}
-
-#endif
index da1e0193007e7c25d6315edd7f0253e2b6909e22..6d1232eebf713ce4ead3bd0fdeeec3e68d45af8f 100644 (file)
 
 #include "app-layer-dnp3.h"
 
-#ifdef HAVE_LIBJANSSON
 json_t *JsonDNP3LogRequest(DNP3Transaction *);
 json_t *JsonDNP3LogResponse(DNP3Transaction *);
-#endif /* HAVE_LIBJANSSON */
 
 void JsonDNP3LogRegister(void);
 
index 6086267a21c3896b4d5bb41e870e51dd4b69dfe3..51e8ad41a4b248c2797200e236f56d67f7950c0a 100644 (file)
@@ -58,8 +58,6 @@
 
 #define MODULE_NAME "JsonDropLog"
 
-#ifdef HAVE_LIBJANSSON
-
 #define LOG_DROP_ALERTS 1
 
 typedef struct JsonDropOutputCtx_ {
@@ -447,11 +445,3 @@ void JsonDropLogRegister (void)
         JsonDropLogCondition, JsonDropLogThreadInit, JsonDropLogThreadDeinit,
         NULL);
 }
-
-#else
-
-void JsonDropLogRegister (void)
-{
-}
-
-#endif
index 85ae62331b72bbbd19f06a78b1b2e818b24bdee3..2f5620a510adb41f7f9e544a837033ded54816c4 100644 (file)
@@ -53,8 +53,6 @@
 #include "output-json.h"
 #include "output-json-email-common.h"
 
-#ifdef HAVE_LIBJANSSON
-
 #define LOG_EMAIL_DEFAULT       0
 #define LOG_EMAIL_EXTENDED      (1<<0)
 #define LOG_EMAIL_ARRAY         (1<<1) /* require array handling */
@@ -465,6 +463,3 @@ void OutputEmailInitConf(ConfNode *conf, OutputJsonEmailCtx *email_ctx)
     }
     return;
 }
-
-
-#endif
index 70deaf9e5724d770a48f1d78a68e8acd231e91c7..bf3de4692c0414ea923ccb00cc49e88b9dccdcad 100644 (file)
@@ -24,7 +24,6 @@
 #ifndef __OUTPUT_JSON_EMAIL_COMMON_H__
 #define __OUTPUT_JSON_EMAIL_COMMON_H__
 
-#ifdef HAVE_LIBJANSSON
 typedef struct OutputJsonEmailCtx_ {
     LogFileCtx *file_ctx;
     uint32_t flags; /** Store mode */
@@ -42,5 +41,4 @@ json_t *JsonEmailAddMetadata(const Flow *f, uint32_t tx_id);
 
 void OutputEmailInitConf(ConfNode *conf, OutputJsonEmailCtx *email_ctx);
 
-#endif /* HAVE_LIBJANSSON */
 #endif /* __OUTPUT_JSON_EMAIL_COMMON_H__ */
index 55f2b908e42929dfe2ed5f8d276a4b313f5fdcd5..171b9424d941d22b75a0ae9a7f39cd03cf9a6b81 100644 (file)
@@ -50,8 +50,6 @@
 #include "stream-tcp-private.h"
 #include "flow-storage.h"
 
-#ifdef HAVE_LIBJANSSON
-
 typedef struct LogJsonFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t flags; /** Store mode */
@@ -540,11 +538,3 @@ void JsonFlowLogRegister (void)
         "eve-log.flow", OutputFlowLogInitSub, JsonFlowLogger,
         JsonFlowLogThreadInit, JsonFlowLogThreadDeinit, NULL);
 }
-
-#else
-
-void JsonFlowLogRegister (void)
-{
-}
-
-#endif
index 0e105819c8cc7c51728c5d56d30a0cc655a15230..8af35ed0412507c2735fa3bab24bc140b1eda838 100644 (file)
@@ -25,8 +25,6 @@
 #define __OUTPUT_JSON_FLOW_H__
 
 void JsonFlowLogRegister(void);
-#ifdef HAVE_LIBJANSSON
 void JsonAddFlow(Flow *f, json_t *js, json_t *hjs);
-#endif /* HAVE_LIBJANSSON */
 
 #endif /* __OUTPUT_JSON_FLOW_H__ */
index 021c7d1a88acf5deb1d1abdb651a972da8661338..8d4a087bdab6e6352ba4070f3293e0cf9fcb6558 100644 (file)
@@ -49,8 +49,6 @@
 #include "app-layer-ftp.h"
 #include "output-json-ftp.h"
 
-#ifdef HAVE_LIBJANSSON
-
 typedef struct LogFTPFileCtx_ {
     LogFileCtx *file_ctx;
     OutputJsonCommonSettings cfg;
@@ -279,10 +277,3 @@ void JsonFTPLogRegister(void)
 
     SCLogDebug("FTP JSON logger registered.");
 }
-#else /* HAVE_LIBJANSSON */
-
-void JsonFTPLogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
index dc9d95c63e45e080cef0580009bce555bfbaf5d3..eb84e0b1babf80ce4ce7691262fde1253b7f144c 100644 (file)
@@ -55,8 +55,6 @@
 #include "output-json-http.h"
 #include "util-byte.h"
 
-#ifdef HAVE_LIBJANSSON
-
 typedef struct LogHttpFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t flags; /** Store mode */
@@ -813,11 +811,3 @@ void JsonHttpLogRegister (void)
         "eve-log.http", OutputHttpLogInitSub, ALPROTO_HTTP, JsonHttpLogger,
         JsonHttpLogThreadInit, JsonHttpLogThreadDeinit, NULL);
 }
-
-#else
-
-void JsonHttpLogRegister (void)
-{
-}
-
-#endif
index a37fe92fe6554cd6149496e905e5952cdd992f12..12b4046d5bda4c8d26555a929e8aea0d9b973d1d 100644 (file)
 
 void JsonHttpLogRegister(void);
 
-#ifdef HAVE_LIBJANSSON
 json_t *JsonHttpAddMetadata(const Flow *f, uint64_t tx_id);
 void JsonHttpLogJSONBodyPrintable(json_t *js, Flow *f, uint64_t tx_id);
 void JsonHttpLogJSONBodyBase64(json_t *js, Flow *f, uint64_t tx_id);
-#endif /* HAVE_LIBJANSSON */
 
 #endif /* __OUTPUT_JSON_HTTP_H__ */
 
index 26af90f9de78b8c3f7bb52c8bc89cf3023afe62b..c36525ba3ec326dd563faa4b1b78816e6a9dc3df 100644 (file)
@@ -47,8 +47,6 @@
 #include "app-layer-ikev2.h"
 #include "output-json-ikev2.h"
 
-#ifdef HAVE_LIBJANSSON
-
 #include "rust.h"
 #include "rust-ikev2-log-gen.h"
 
@@ -178,11 +176,3 @@ void JsonIKEv2LogRegister(void)
 
     SCLogDebug("IKEv2 JSON logger registered.");
 }
-
-#else /* No JSON support. */
-
-void JsonIKEv2LogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
index 0578809a58a430183ef8d03dd815c71e49bc9237..a6933c07ff0dd32fe71509b08b4b3b738cf398e3 100644 (file)
@@ -47,8 +47,6 @@
 #include "app-layer-krb5.h"
 #include "output-json-krb5.h"
 
-#ifdef HAVE_LIBJANSSON
-
 #include "rust.h"
 #include "rust-krb-log-gen.h"
 
@@ -179,11 +177,3 @@ void JsonKRB5LogRegister(void)
 
     SCLogDebug("KRB5 JSON logger registered.");
 }
-
-#else /* No JSON support. */
-
-void JsonKRB5LogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
index 25e71a3ea82d7ffd5466c9b7f68aefc1a1eb2a30..27d22233236032d4b72381654c13b4d458d3926f 100644 (file)
@@ -65,8 +65,6 @@
 
 #define MODULE_NAME "JsonMetadataLog"
 
-#ifdef HAVE_LIBJANSSON
-
 #define JSON_STREAM_BUFFER_SIZE 4096
 
 typedef struct MetadataJsonOutputCtx_ {
@@ -289,11 +287,3 @@ void JsonMetadataLogRegister (void)
         JsonMetadataLogCondition, JsonMetadataLogThreadInit,
         JsonMetadataLogThreadDeinit, NULL);
 }
-
-#else
-
-void JsonMetadataLogRegister (void)
-{
-}
-
-#endif
index 093135feb41b3058cf5d96d24d03a5b0f70a45fd..5b544b534cf2f0590536d0e098fb29247c7b5b23 100644 (file)
@@ -49,8 +49,6 @@
 
 #include "stream-tcp-private.h"
 
-#ifdef HAVE_LIBJANSSON
-
 typedef struct LogJsonFileCtx_ {
     LogFileCtx *file_ctx;
     OutputJsonCommonSettings cfg;
@@ -462,11 +460,3 @@ void JsonNetFlowLogRegister(void)
         "eve-log.netflow", OutputNetFlowLogInitSub, JsonNetFlowLogger,
         JsonNetFlowLogThreadInit, JsonNetFlowLogThreadDeinit, NULL);
 }
-
-#else
-
-void JsonNetFlowLogRegister (void)
-{
-}
-
-#endif
index e63495620c7b5e0c2d30e8b425dfb6d4a6f66737..7b5683b8613cf0b6a7bb83613f5fbdf377a96dd9 100644 (file)
@@ -46,7 +46,6 @@
 
 #include "output-json-nfs.h"
 
-#ifdef HAVE_LIBJANSSON
 #include "rust.h"
 #include "rust-nfs-log-gen.h"
 
@@ -133,11 +132,3 @@ void JsonNFSLogRegister(void)
 
     SCLogDebug("NFS JSON logger registered.");
 }
-
-#else /* No JSON support. */
-
-void JsonNFSLogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
index ab1ddce315c94286e346f801317a7274b4d72d93..aea820e600757212771ec70ea1c596d45efcf20f 100644 (file)
@@ -50,8 +50,6 @@
 #include "rust.h"
 #include "rust-sip-log-gen.h"
 
-#ifdef HAVE_LIBJANSSON
-
 typedef struct LogSIPFileCtx_ {
     LogFileCtx *file_ctx;
     OutputJsonCommonSettings cfg;
@@ -193,11 +191,3 @@ void JsonSIPLogRegister(void)
 
     SCLogDebug("SIP JSON logger registered.");
 }
-
-#else /* No JSON support. */
-
-void JsonSIPLogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
index 1cfde6c4bec233f2ab32b211592238efc605a26f..bc8836dad6b4f3c8fcab894f1b8852a0135f2b86 100644 (file)
@@ -26,8 +26,6 @@
 
 void JsonSIPLogRegister(void);
 
-#ifdef HAVE_LIBJANSSON
 json_t *JsonSIPAddMetadata(const Flow *f, uint64_t tx_id);
-#endif /* HAVE_LIBJANSSON */
 
 #endif /* __OUTPUT_JSON_SIP_H__ */
index e768c5f0253fbc85f1f8044bf530a89b46f91830..d5ada56d54ef07eedd53adea3b5ac7e1c3d713f7 100644 (file)
@@ -45,7 +45,6 @@
 
 #include "output-json-smb.h"
 
-#ifdef HAVE_LIBJANSSON
 #include "rust.h"
 #include "rust-smb-log-gen.h"
 
@@ -107,12 +106,3 @@ void JsonSMBLogRegister(void)
 
     SCLogDebug("SMB JSON logger registered.");
 }
-
-#else /* No JSON support. */
-
-void JsonSMBLogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
-
index 158e43a09ae34338cbb72a6144859423a1a8ff24..75e646d440ab3ce26c3e13d77bc3d4cc2b09a702 100644 (file)
@@ -52,8 +52,6 @@
 #include "output-json-smtp.h"
 #include "output-json-email-common.h"
 
-#ifdef HAVE_LIBJANSSON
-
 static json_t *JsonSmtpDataLogger(const Flow *f, void *state, void *vtx, uint64_t tx_id)
 {
     json_t *sjs = json_object();
@@ -276,11 +274,3 @@ void JsonSmtpLogRegister (void) {
         "eve-log.smtp", OutputSmtpLogInitSub, ALPROTO_SMTP, JsonSmtpLogger,
         JsonSmtpLogThreadInit, JsonSmtpLogThreadDeinit, NULL);
 }
-
-#else
-
-void JsonSmtpLogRegister (void)
-{
-}
-
-#endif
index 24d3f8c22de850c4b0458b14d02350d3ed2b8063..8a8e1bf7bde928e67b093489154781e7cfbed64b 100644 (file)
@@ -25,8 +25,6 @@
 #define __OUTPUT_JSON_SMTP_H__
 
 void JsonSmtpLogRegister(void);
-#ifdef HAVE_LIBJANSSON
 json_t *JsonSMTPAddMetadata(const Flow *f, uint64_t tx_id);
-#endif
 
 #endif /* __OUTPUT_JSON_SMTP_H__ */
index 9f07d5cebab5fef50f23d9e4b14ac490bca95c8a..b584a1c9afa92c4c4691e5d96db05ce19595b8a9 100644 (file)
@@ -47,8 +47,6 @@
 #include "app-layer-snmp.h"
 #include "output-json-snmp.h"
 
-#ifdef HAVE_LIBJANSSON
-
 #include "rust.h"
 #include "rust-snmp-log-gen.h"
 
@@ -178,11 +176,3 @@ void JsonSNMPLogRegister(void)
 
     SCLogDebug("SNMP JSON logger registered.");
 }
-
-#else /* No JSON support. */
-
-void JsonSNMPLogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
index 3d64e196780a7d94876ad35cdcad25ebdb58ca77..348cae8359284c94d182d137bec1967d9f9a4aef 100644 (file)
@@ -50,8 +50,6 @@
 #include "output-json.h"
 #include "output-json-ssh.h"
 
-#ifdef HAVE_LIBJANSSON
-
 #define MODULE_NAME "LogSshLog"
 
 typedef struct OutputSshCtx_ {
@@ -273,11 +271,3 @@ void JsonSshLogRegister (void)
         SSH_STATE_BANNER_DONE, SSH_STATE_BANNER_DONE,
         JsonSshLogThreadInit, JsonSshLogThreadDeinit, NULL);
 }
-
-#else
-
-void JsonSshLogRegister (void)
-{
-}
-
-#endif
index 68a7f974c679a1fdc1dfbc674a31d0b7803741de..aa939b09346fc57b9a8113877e57343749067c63 100644 (file)
 
 void JsonSshLogRegister(void);
 
-#ifdef HAVE_LIBJANSSON
 #include "app-layer-ssh.h"
 
 void JsonSshLogJSON(json_t *js, SshState *tx);
-#endif
 
 #endif /* __OUTPUT_JSON_SSH_H__ */
index f890f22e3bd8200ddb9d7b3def57620f2b2cf94d..188a3311a9e3550645ae344c2926cbb764bc0efd 100644 (file)
@@ -50,8 +50,6 @@
 
 #define MODULE_NAME "JsonStatsLog"
 
-#ifdef HAVE_LIBJANSSON
-
 extern bool stats_decoder_events;
 const char *stats_decoder_events_prefix;
 
@@ -536,11 +534,3 @@ void JsonStatsLogRegister(void) {
         "eve-log.stats", OutputStatsLogInitSub, JsonStatsLogger,
         JsonStatsLogThreadInit, JsonStatsLogThreadDeinit, NULL);
 }
-
-#else
-
-void JsonStatsLogRegister (void)
-{
-}
-
-#endif
index 6cdec99e07a95626dc46edcf905576f53dd1c4ab..9b96d5001298fe1cac408dd090d78950d4e31e2a 100644 (file)
 #define JSON_STATS_THREADS (1<<1)
 #define JSON_STATS_DELTAS  (1<<2)
 
-#ifdef HAVE_LIBJANSSON
 json_t *StatsToJSON(const StatsTable *st, uint8_t flags);
 TmEcode OutputEngineStatsReloadTime(json_t **jdata);
 TmEcode OutputEngineStatsRuleset(json_t **jdata);
-#endif
 void JsonStatsLogRegister(void);
 
 #endif /* __OUTPUT_JSON_COUNTERS_H__ */
index 2f09e6282649c29dd1654b6798b8ddff49253032..c91563307a2b26838bb4a52b23d181a5f5ee58bf 100644 (file)
@@ -53,8 +53,6 @@
 #include "app-layer-template.h"
 #include "output-json-template.h"
 
-#ifdef HAVE_LIBJANSSON
-
 typedef struct LogTemplateFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t    flags;
@@ -203,11 +201,3 @@ void JsonTemplateLogRegister(void)
 
     SCLogNotice("Template JSON logger registered.");
 }
-
-#else /* No JSON support. */
-
-void JsonTemplateLogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
index ec33f4d42f9bd48f317a8438fbc5a624bf433084..94f5b05e94ceddb1259611676be75a2043b0eb08 100644 (file)
@@ -51,8 +51,6 @@
 #include "rust.h"
 #include "rust-tftp-log-gen.h"
 
-#ifdef HAVE_LIBJANSSON
-
 typedef struct LogTFTPFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t    flags;
@@ -177,11 +175,3 @@ void JsonTFTPLogRegister(void)
 
     SCLogDebug("TFTP JSON logger registered.");
 }
-
-#else /* HAVE_LIBJANSSON */
-
-void JsonTFTPLogRegister(void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
index e70aebb7f6810fdc8ff1a9293551bf65b2a37981..fb4685f6069cbf5d30334d8e708f499b52b35a40 100644 (file)
@@ -51,8 +51,6 @@
 #include "output-json.h"
 #include "output-json-tls.h"
 
-#ifdef HAVE_LIBJANSSON
-
 SC_ATOMIC_DECLARE(unsigned int, cert_id);
 
 #define MODULE_NAME "LogTlsLog"
@@ -665,12 +663,3 @@ void JsonTlsLogRegister (void)
         JsonTlsLogger, TLS_HANDSHAKE_DONE, TLS_HANDSHAKE_DONE,
         JsonTlsLogThreadInit, JsonTlsLogThreadDeinit, NULL);
 }
-
-#else
-
-void JsonTlsLogRegister (void)
-{
-}
-
-#endif /* HAVE_LIBJANSSON */
-
index 06657c8e852c2a2afc930217b72ca85ab1aa3a95..799a8ea19c9e3703326d2f98b7595d3933fea42e 100644 (file)
 
 void JsonTlsLogRegister(void);
 
-#ifdef HAVE_LIBJANSSON
 #include "app-layer-ssl.h"
 
 void JsonTlsLogJSONBasic(json_t *js, SSLState *ssl_state);
 void JsonTlsLogJSONExtended(json_t *js, SSLState *ssl_state);
-#endif /* HAVE_LIBJANSSON */
 
 #endif /* __OUTPUT_JSON_TLS_H__ */
index cf258707afd77900e1b8301961337441c683c49d..925d9664ea310113dec161bcf8dd258f6f478355 100644 (file)
 
 #include "source-pcap-file.h"
 
-#ifndef HAVE_LIBJANSSON
-
-/** Handle the case where no JSON support is compiled in.
- *
- */
-
-int OutputJsonOpenFileCtx(LogFileCtx *, char *);
-
-void OutputJsonRegister (void)
-{
-    SCLogDebug("Can't register JSON output - JSON support was disabled during build.");
-}
-
-#else /* implied we do have JSON support */
-
 #define DEFAULT_LOG_FILENAME "eve.json"
 #define DEFAULT_ALERT_SYSLOG_FACILITY_STR       "local0"
 #define DEFAULT_ALERT_SYSLOG_FACILITY           LOG_LOCAL0
@@ -1100,5 +1085,3 @@ static void OutputJsonDeInitCtx(OutputCtx *output_ctx)
     SCFree(json_ctx);
     SCFree(output_ctx);
 }
-
-#endif
index 99edefe1fbb175fe02859e81ee6b1a90552a565b..34bde321d8aeada2f04c080dc1c76cd804bc0608 100644 (file)
@@ -33,8 +33,6 @@
 
 void OutputJsonRegister(void);
 
-#ifdef HAVE_LIBJANSSON
-
 enum OutputJsonLogDirection {
     LOG_DIR_PACKET = 0,
     LOG_DIR_FLOW,
@@ -97,6 +95,4 @@ void SCJsonDecref(json_t *js);
 void JsonAddCommonOptions(const OutputJsonCommonSettings *cfg,
         const Packet *p, const Flow *f, json_t *js);
 
-#endif /* HAVE_LIBJANSSON */
-
 #endif /* __OUTPUT_JSON_H__ */
index 1d7d82cbf0d2f95c79fcfef6a3311555b8e771cf..47f774493d82b4528b5d29eade106cfacec3b2d3 100644 (file)
@@ -765,14 +765,6 @@ void RunModeInitializeOutputs(void)
                     "recompile with --enable-prelude to add Prelude "
                     "support.");
             continue;
-#endif
-        } else if (strcmp(output->val, "eve-log") == 0) {
-#ifndef HAVE_LIBJANSSON
-            SCLogWarning(SC_ERR_NOT_SUPPORTED,
-                    "Eve-log support not compiled in. Reconfigure/"
-                    "recompile with libjansson and its development "
-                    "files installed to add eve-log support.");
-            continue;
 #endif
         } else if (strcmp(output->val, "lua") == 0) {
 #ifndef HAVE_LUA
index c3f7e9e632616e679330ff7d9150b9479b1c5515..627de0d78e20da24945cd06300c5805291ae8055 100644 (file)
 #include <w32api/wtypes.h>
 #endif
 
-#ifdef HAVE_LIBJANSSON
 #include <jansson.h>
 #ifndef JSON_ESCAPE_SLASH
 #define JSON_ESCAPE_SLASH 0
 #define json_boolean(val)      SCJsonBool((val))
 //#define json_boolean(val)      ((val) ? json_true() : json_false())
 #endif
-#endif
 
 #ifdef HAVE_MAGIC
 #include <magic.h>
index 38a323ecfb46dc984d522bdb31f3f73e10785034..709c7bfd1297837a5a987c3d574cc8421d7b4591 100644 (file)
@@ -750,9 +750,7 @@ static void PrintBuildInfo(void)
 #ifdef HAVE_LUAJIT
     strlcat(features, "HAVE_LUAJIT ", sizeof(features));
 #endif
-#ifdef HAVE_LIBJANSSON
     strlcat(features, "HAVE_LIBJANSSON ", sizeof(features));
-#endif
 #ifdef PROFILING
     strlcat(features, "PROFILING ", sizeof(features));
 #endif
index ff2c4907496a2afc83f8f1cd753e41a37d03f1da..90db1f70f3fbade4f1046eb64a642bc81bd2ffa6 100644 (file)
@@ -155,7 +155,6 @@ int ConfUnixSocketIsEnable(void)
     }
 
     if (!strcmp(value, "auto")) {
-#ifdef HAVE_LIBJANSSON
 #ifdef OS_WIN32
         return 0;
 #else
@@ -165,9 +164,6 @@ int ConfUnixSocketIsEnable(void)
         } else {
             return 0;
         }
-#endif
-#else
-        return 0;
 #endif
     }
 
index 84b0fd2cbe40a170c3c822a1cdb4a96ff1d6b71a..d700d05786b9b893c4b97309826534601b20d75f 100644 (file)
@@ -200,7 +200,6 @@ static inline void SCLogPrintToSyslog(int syslog_log_level, const char *msg)
     return;
 }
 
-#ifdef HAVE_LIBJANSSON
 #include <jansson.h>
 /**
  */
@@ -264,7 +263,6 @@ static int SCLogMessageJSON(struct timeval *tval, char *buffer, size_t buffer_si
 error:
     return -1;
 }
-#endif /* HAVE_LIBJANSSON */
 
 /**
  * \brief Adds the global log_format to the outgoing buffer
@@ -286,10 +284,8 @@ static SCError SCLogMessageGetBuffer(
                      const unsigned int line, const char *function,
                      const SCError error_code, const char *message)
 {
-#ifdef HAVE_LIBJANSSON
     if (type == SC_LOG_OP_TYPE_JSON)
         return SCLogMessageJSON(tval, buffer, buffer_size, log_level, file, line, function, error_code, message);
-#endif
 
     char *temp = buffer;
     const char *s = NULL;
@@ -1357,13 +1353,7 @@ void SCLogLoadConfig(int daemon, int verbose)
             if (strcmp(type_s, "regular") == 0)
                 type = SC_LOG_OP_TYPE_REGULAR;
             else if (strcmp(type_s, "json") == 0) {
-#ifdef HAVE_LIBJANSSON
                 type = SC_LOG_OP_TYPE_JSON;
-#else
-                SCLogError(SC_ERR_INVALID_ARGUMENT, "libjansson support not "
-                        "compiled in, can't use 'json' logging");
-                exit(EXIT_FAILURE);
-#endif /* HAVE_LIBJANSSON */
             }
         }
 
index 8eea87ab2c5f243449ac563ab602b037e95e75f6..ee825fa462554af3149bba5b01001a6d513ab92b 100644 (file)
@@ -386,7 +386,6 @@ SCConfLogOpenGeneric(ConfNode *conf,
         append = DEFAULT_LOG_MODE_APPEND;
 
     /* JSON flags */
-#ifdef HAVE_LIBJANSSON
     log_ctx->json_flags = JSON_PRESERVE_ORDER|JSON_COMPACT|
                           JSON_ENSURE_ASCII|JSON_ESCAPE_SLASH;
 
@@ -412,7 +411,6 @@ SCConfLogOpenGeneric(ConfNode *conf,
         if (escape_slash != NULL && ConfValIsFalse(escape_slash))
             log_ctx->json_flags &= ~(JSON_ESCAPE_SLASH);
     }
-#endif /* HAVE_LIBJANSSON */
 
     // Now, what have we been asked to open?
     if (strcasecmp(filetype, "unix_stream") == 0) {
index 66831b5fe0fd6a5654cd697a0be07bcf72db9722..c2e002dea030a521220b8e92d17a85e5aebb2926 100644 (file)
@@ -66,9 +66,7 @@ static int profiling_sghs_output_to_file = 0;
 int profiling_sghs_enabled = 0;
 static char profiling_file_name[PATH_MAX];
 static const char *profiling_file_mode = "a";
-#ifdef HAVE_LIBJANSSON
 static int profiling_rulegroup_json = 0;
-#endif
 
 void SCProfilingSghsGlobalInit(void)
 {
@@ -96,17 +94,12 @@ void SCProfilingSghsGlobalInit(void)
                 profiling_sghs_output_to_file = 1;
             }
             if (ConfNodeChildValueIsTrue(conf, "json")) {
-#ifdef HAVE_LIBJANSSON
                 profiling_rulegroup_json = 1;
-#else
-                SCLogWarning(SC_ERR_NO_JSON_SUPPORT, "no json support compiled in, using plain output");
-#endif
             }
         }
     }
 }
 
-#ifdef HAVE_LIBJANSSON
 static void DoDumpJSON(SCProfileSghDetectCtx *rules_ctx, FILE *fp, const char *name)
 {
     char timebuf[64];
@@ -165,7 +158,6 @@ static void DoDumpJSON(SCProfileSghDetectCtx *rules_ctx, FILE *fp, const char *n
     }
     json_decref(js);
 }
-#endif /* HAVE_LIBJANSSON */
 
 static void DoDump(SCProfileSghDetectCtx *rules_ctx, FILE *fp, const char *name)
 {
@@ -252,12 +244,9 @@ SCProfilingSghDump(DetectEngineCtx *de_ctx)
        fp = stdout;
     }
 
-#ifdef HAVE_LIBJANSSON
     if (profiling_rulegroup_json) {
         DoDumpJSON(de_ctx->profile_sgh_ctx, fp, "rule groups");
-    } else
-#endif
-    {
+    } else {
         DoDump(de_ctx->profile_sgh_ctx, fp, "rule groups");
     }
 
index 74d8eff40f5598b4c05ea9f536d0306c4fd08d38..f7beb0efe5a3eb3448bdbdae3faba37c5fada676 100644 (file)
@@ -81,9 +81,7 @@ extern int profiling_output_to_file;
 int profiling_rules_enabled = 0;
 static char profiling_file_name[PATH_MAX] = "";
 static const char *profiling_file_mode = "a";
-#ifdef HAVE_LIBJANSSON
 static int profiling_rule_json = 0;
-#endif
 
 /**
  * Sort orders for dumping profiled rules.
@@ -185,11 +183,7 @@ void SCProfilingRulesGlobalInit(void)
                 profiling_output_to_file = 1;
             }
             if (ConfNodeChildValueIsTrue(conf, "json")) {
-#ifdef HAVE_LIBJANSSON
                 profiling_rule_json = 1;
-#else
-                SCLogWarning(SC_ERR_NO_JSON_SUPPORT, "no json support compiled in, using plain output");
-#endif
             }
         }
     }
@@ -294,8 +288,6 @@ SCProfileSummarySortByMaxTicks(const void *a, const void *b)
         return s0->max > s1->max ? -1 : 1;
 }
 
-#ifdef HAVE_LIBJANSSON
-
 static void DumpJson(FILE *fp, SCProfileSummary *summary,
         uint32_t count, uint64_t total_ticks,
         const char *sort_desc)
@@ -359,8 +351,6 @@ static void DumpJson(FILE *fp, SCProfileSummary *summary,
     json_decref(js);
 }
 
-#endif /* HAVE_LIBJANSSON */
-
 static void DumpText(FILE *fp, SCProfileSummary *summary,
         uint32_t count, uint64_t total_ticks,
         const char *sort_desc)
@@ -530,12 +520,9 @@ SCProfilingRuleDump(SCProfileDetectCtx *rules_ctx)
                 sort_desc = "average ticks (no match)";
                 break;
         }
-#ifdef HAVE_LIBJANSSON
         if (profiling_rule_json) {
             DumpJson(fp, summary, count, total_ticks, sort_desc);
-        } else
-#endif
-        {
+        } else {
             DumpText(fp, summary, count, total_ticks, sort_desc);
         }
         order++;