]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rename alert-json.[ch] output-json.[ch]
authorTom DeCanio <decanio.tom@gmail.com>
Wed, 13 Nov 2013 01:28:16 +0000 (17:28 -0800)
committerVictor Julien <victor@inliniac.net>
Wed, 29 Jan 2014 10:07:51 +0000 (11:07 +0100)
src/Makefile.am
src/output-dnslog.c
src/output-httplog.c
src/output-json.c [moved from src/alert-json.c with 99% similarity]
src/output-json.h [moved from src/alert-json.h with 99% similarity]
src/output-tlslog.c
src/suricata.c

index 78243183139fb21dbecfcc3d66ffdf2ec0ee11ba..18c86d56a0847ec94799a79caec12b9b15271fe2 100644 (file)
@@ -9,7 +9,6 @@ bin_PROGRAMS = suricata
 suricata_SOURCES = \
 alert-debuglog.c alert-debuglog.h \
 alert-fastlog.c alert-fastlog.h \
-alert-json.c alert-json.h \
 alert-pcapinfo.c alert-pcapinfo.h \
 alert-prelude.c alert-prelude.h \
 alert-syslog.c alert-syslog.h \
@@ -221,6 +220,7 @@ output-packet.c output-packet.h \
 output-tx.c output-tx.h \
 output-dnslog.c output-dnslog.h \
 output-httplog.c output-httplog.h \
+output-json.c output-json.h \
 output-tlslog.c output-tlslog.h \
 packet-queue.c packet-queue.h \
 pkt-var.c pkt-var.h \
index 2e4d27e27fd71987a18dbbd0f4b1433f62be7ac0..3729b5aee7c4474e7677fa4952cc2d36a17a90c9 100644 (file)
@@ -48,7 +48,7 @@
 #include "util-logopenfile.h"
 #include "util-time.h"
 
-#include "alert-json.h"
+#include "output-json.h"
 
 #ifdef HAVE_LIBJANSSON
 #include <jansson.h>
@@ -209,12 +209,6 @@ static TmEcode DnsJsonIPWrapper(ThreadVars *tv, Packet *p, void *data, PacketQue
 
     AlertJsonThread *aft = (AlertJsonThread *)data;
 
-    /* no flow, no htp state */
-    if (p->flow == NULL) {
-        SCLogDebug("no flow");
-        SCReturnInt(TM_ECODE_OK);
-    }
-
     /* check if we have DNS state or not */
     FLOWLOCK_WRLOCK(p->flow); /* WRITE lock before we updated flow logged id */
     uint16_t proto = AppLayerGetProtoFromPacket(p);
@@ -275,6 +269,7 @@ end:
     SCReturnInt(TM_ECODE_OK);
 }
 
+#if 0
 int OutputDnsNeedsLog(Packet *p)
 {
     SCEnter();
@@ -306,11 +301,21 @@ end:
 
     SCReturnInt(1);
 }
+#endif
 
 TmEcode OutputDnsLog(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, PacketQueue *postpq)
 {
     SCEnter();
 
+    /* no flow, no htp state */
+    if (p->flow == NULL) {
+        SCReturnInt(TM_ECODE_OK);
+    }
+
+    if (!(PKT_IS_UDP(p)) && !(PKT_IS_TCP(p))) {
+        SCReturnInt(TM_ECODE_OK);
+    }
+
     DnsJsonIPWrapper(tv, p, data, pq, postpq, AF_INET);
 
     SCReturnInt(TM_ECODE_OK);
index c80ae3ae8c75f79ca0140c577f5cfe5bd05a5ba4..53dda2eba33813ba1a00cc670c469d09ea2d9ade 100644 (file)
@@ -47,7 +47,7 @@
 #include "util-proto-name.h"
 #include "util-logopenfile.h"
 #include "util-time.h"
-#include "alert-json.h"
+#include "output-json.h"
 
 #ifdef HAVE_LIBJANSSON
 #include <jansson.h>
similarity index 99%
rename from src/alert-json.c
rename to src/output-json.c
index b3f5fc52185d437048a7a991389445d70526a0bc..93927e55170918eb589f77eaa46182b8126db83c 100644 (file)
@@ -60,7 +60,7 @@
 #include "util-buffer.h"
 #include "util-logopenfile.h"
 
-#include "alert-json.h"
+#include "output-json.h"
 
 #ifndef HAVE_LIBJANSSON
 
@@ -524,9 +524,7 @@ TmEcode AlertJson (ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, Packe
     }
 
     if (outputFlags & OUTPUT_DNS) {
-        if (OutputDnsNeedsLog(p)) {
-            OutputDnsLog(tv, p, data, pq, postpq);
-        }
+        OutputDnsLog(tv, p, data, pq, postpq);
     }
 
     if (outputFlags & OUTPUT_HTTP) {
similarity index 99%
rename from src/alert-json.h
rename to src/output-json.h
index aa8e8fb1fd1273dddac828d3d70638d5cdc9f958..fb981807df28b37346bb18bdecb79c482c947334 100644 (file)
@@ -63,4 +63,3 @@ typedef struct AlertJsonThread_ {
 #endif /* HAVE_LIBJANSSON */
 
 #endif /* __ALERT_JSON_H__ */
-
index b3fd3767702bb3b5f23e5bc4e3a19bdc7a6b7252..f78b27225b5ed1adb8e9bdcb8984e944d3e956f3 100644 (file)
@@ -48,7 +48,7 @@
 #include "util-logopenfile.h"
 #include "util-crypt.h"
 
-#include "alert-json.h"
+#include "output-json.h"
 
 #ifdef HAVE_LIBJANSSON
 #include <jansson.h>
index 6bd214d2672dd212bda82af4a41018333823d9c5..51618354445590c929fbec057c0dce07a7e1c26b 100644 (file)
@@ -78,7 +78,6 @@
 #include "alert-prelude.h"
 #include "alert-syslog.h"
 #include "alert-pcapinfo.h"
-#include "alert-json.h"
 
 #include "log-droplog.h"
 #include "log-httplog.h"
@@ -88,6 +87,7 @@
 #include "log-file.h"
 #include "log-filestore.h"
 
+#include "output-json.h"
 #include "output-dnslog.h"
 #include "output-httplog.h"