]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve/filetype: reorder fields to match lifecycle
authorJason Ish <jason.ish@oisf.net>
Mon, 11 Mar 2024 23:14:30 +0000 (17:14 -0600)
committerVictor Julien <victor@inliniac.net>
Sat, 16 Mar 2024 08:29:34 +0000 (09:29 +0100)
Enhances readability.

src/output-eve.h

index 3b2637f64ccfe669a3775b4084e2e6cb8a90eb90..7046c7b98005d2e965ac455fedab8cc2edbfbbe5 100644 (file)
@@ -102,36 +102,6 @@ typedef struct SCEveFileType_ {
      */
     int (*Init)(const ConfNode *conf, const bool threaded, void **init_data);
 
-    /**
-     * \brief Called for each EVE log record.
-     *
-     * The Write function is called for each log EVE log record. The
-     * provided buffer contains a fully formatted EVE record in JSON
-     * format.
-     *
-     * \param buffer The fully formatted JSON EVE log record
-     *
-     * \param buffer_len The length of the buffer
-     *
-     * \param init_data The data setup in the call to Init
-     *
-     * \param thread_data The data setup in the call to ThreadInit
-     *
-     * \retval 0 on success, -1 on failure
-     */
-    int (*Write)(
-            const char *buffer, const int buffer_len, const void *init_data, void *thread_data);
-
-    /**
-     * \brief Final call to deinitialize this filetype.
-     *
-     * Called, usually on exit to deinitialize and free any resources
-     * allocated during Init.
-     *
-     * \param init_data Data setup in the call to Init.
-     */
-    void (*Deinit)(void *init_data);
-
     /**
      * \brief Initialize thread specific data.
      *
@@ -153,6 +123,26 @@ typedef struct SCEveFileType_ {
      */
     int (*ThreadInit)(const void *init_data, const ThreadId thread_id, void **thread_data);
 
+    /**
+     * \brief Called for each EVE log record.
+     *
+     * The Write function is called for each log EVE log record. The
+     * provided buffer contains a fully formatted EVE record in JSON
+     * format.
+     *
+     * \param buffer The fully formatted JSON EVE log record
+     *
+     * \param buffer_len The length of the buffer
+     *
+     * \param init_data The data setup in the call to Init
+     *
+     * \param thread_data The data setup in the call to ThreadInit
+     *
+     * \retval 0 on success, -1 on failure
+     */
+    int (*Write)(
+            const char *buffer, const int buffer_len, const void *init_data, void *thread_data);
+
     /**
      * \brief Called to deinitialize each thread.
      *
@@ -165,6 +155,16 @@ typedef struct SCEveFileType_ {
      */
     void (*ThreadDeinit)(const void *init_data, void *thread_data);
 
+    /**
+     * \brief Final call to deinitialize this filetype.
+     *
+     * Called, usually on exit to deinitialize and free any resources
+     * allocated during Init.
+     *
+     * \param init_data Data setup in the call to Init.
+     */
+    void (*Deinit)(void *init_data);
+
     /* Internal list management. */
     TAILQ_ENTRY(SCEveFileType_) entries;
 } SCEveFileType;