]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
log file: add type flag
authorEric Leblond <eric@regit.org>
Wed, 20 May 2015 11:38:10 +0000 (13:38 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 22 May 2015 13:45:00 +0000 (15:45 +0200)
It will be used to store if the file is syslog or a real file.

src/output-json.h
src/util-logopenfile.h

index e35b81be4581fa51d0deb5daf432dce4419818bd..1acde3e67792d826e5401e402c1e358f452e6a72 100644 (file)
@@ -39,10 +39,7 @@ TmEcode OutputJSON(json_t *js, void *data, uint64_t *count);
 int OutputJSONBuffer(json_t *js, LogFileCtx *file_ctx, MemBuffer *buffer);
 OutputCtx *OutputJsonInitCtx(ConfNode *);
 
-enum JsonOutput { ALERT_FILE,
-                  ALERT_SYSLOG,
-                  ALERT_UNIX_DGRAM,
-                  ALERT_UNIX_STREAM };
+
 enum JsonFormat { COMPACT, INDENT };
 
 /*
@@ -50,11 +47,10 @@ enum JsonFormat { COMPACT, INDENT };
  */
 typedef struct OutputJsonCtx_ {
     LogFileCtx *file_ctx;
-    enum JsonOutput json_out;
+    enum LogFileType json_out;
     enum JsonFormat format;
 } OutputJsonCtx;
 
-
 typedef struct AlertJsonThread_ {
     /** LogFileCtx has the pointer to the file and a mutex to allow multithreading */
     LogFileCtx *file_ctx;
index 65d179a6f77595641da6db0c67ba213445b3ee1d..49e770a504e27f604d8a9531e2255cbd6061d1e5 100644 (file)
@@ -31,6 +31,11 @@ typedef struct {
     uint16_t fileno;
 } PcieFile;
 
+enum LogFileType { ALERT_FILE,
+                  ALERT_SYSLOG,
+                  ALERT_UNIX_DGRAM,
+                  ALERT_UNIX_STREAM };
+
 /** Global structure for Output Context */
 typedef struct LogFileCtx_ {
     union {
@@ -45,6 +50,9 @@ typedef struct LogFileCtx_ {
      * record cannot be written to the file in one call */
     SCMutex fp_mutex;
 
+    /** the type of file */
+    enum LogFileType type;
+
     /** The name of the file */
     char *filename;