]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
fix compile errors w/o libjansson
authorTom DeCanio <decanio.tom@gmail.com>
Wed, 13 Nov 2013 00:56:48 +0000 (16:56 -0800)
committerVictor Julien <victor@inliniac.net>
Wed, 29 Jan 2014 10:07:51 +0000 (11:07 +0100)
src/alert-json.c
src/alert-json.h

index 1140f1e4f4711ff6b1ad6391a7baade22aaf0b15..b3f5fc52185d437048a7a991389445d70526a0bc 100644 (file)
@@ -43,6 +43,7 @@
 #include "detect-engine.h"
 #include "detect-engine-mpm.h"
 #include "detect-reference.h"
+#include "app-layer-parser.h"
 #include "util-classification-config.h"
 #include "util-syslog.h"
 
@@ -61,8 +62,8 @@
 
 #include "alert-json.h"
 
-/*#undef HAVE_LIBJANSSON for testing without messing with config */
 #ifndef HAVE_LIBJANSSON
+
 /** Handle the case where no JSON support is compiled in.
  *
  */
@@ -79,12 +80,7 @@ void TmModuleAlertJsonRegister (void) {
     tmm_modules[TMM_OUTPUTJSON].Func = AlertJson;
     tmm_modules[TMM_OUTPUTJSON].ThreadDeinit = AlertJsonThreadDeinit;
     tmm_modules[TMM_OUTPUTJSON].RegisterTests = AlertJsonRegisterTests;
-
-    /* enable the logger for the app layer */
-    AppLayerRegisterLogger(ALPROTO_DNS_UDP);
-    AppLayerRegisterLogger(ALPROTO_DNS_TCP);
-
-    AppLayerRegisterLogger(ALPROTO_HTTP);
+}
 
 OutputCtx *AlertJsonInitCtx(ConfNode *conf)
 {
@@ -108,7 +104,8 @@ TmEcode AlertJsonThreadDeinit(ThreadVars *t, void *data)
     return TM_ECODE_FAILED;
 }
 
-void AlertJsonRegisterTests (void) {
+void AlertJsonRegisterTests (void)
+{
 }
 
 #else /* implied we do have JSON support */
@@ -147,6 +144,12 @@ void TmModuleAlertJsonRegister (void) {
     tmm_modules[TMM_OUTPUTJSON].cap_flags = 0;
 
     OutputRegisterModule(MODULE_NAME, "eve-log", AlertJsonInitCtx);
+
+    /* enable the logger for the app layer */
+    AppLayerRegisterLogger(ALPROTO_DNS_UDP);
+    AppLayerRegisterLogger(ALPROTO_DNS_TCP);
+    AppLayerRegisterLogger(ALPROTO_HTTP);
+    AppLayerRegisterLogger(ALPROTO_TLS);
 }
 
 /* Default Sensor ID value */
@@ -753,7 +756,6 @@ void AlertJsonRegisterTests(void)
 
 #ifdef UNITTESTS
 
-
 #endif /* UNITTESTS */
 
 }
index da84d645dc40c0f9ead98d04def1caaaced5bf05..aa8e8fb1fd1273dddac828d3d70638d5cdc9f958 100644 (file)
 #ifndef __ALERT_JSON_H__
 #define __ALERT_JSON_H__
 
+void TmModuleAlertJsonRegister (void);
+
+#ifdef HAVE_LIBJANSSON
+
 json_t *CreateJSONHeader(Packet *p, int direction_sensative);
 TmEcode OutputJSON(json_t *js, void *data, uint64_t *count);
 
-void TmModuleAlertJsonRegister (void);
 void TmModuleAlertJsonIPv4Register (void);
 void TmModuleAlertJsonPv6Register (void);
 OutputCtx *AlertJsonInitCtx(ConfNode *);
@@ -57,5 +60,7 @@ typedef struct AlertJsonThread_ {
     OutputCtx *tls_ctx;
 } AlertJsonThread;
 
+#endif /* HAVE_LIBJANSSON */
+
 #endif /* __ALERT_JSON_H__ */