From: Jason Ish Date: Mon, 11 Mar 2024 23:14:30 +0000 (-0600) Subject: eve/filetype: reorder fields to match lifecycle X-Git-Tag: suricata-8.0.0-beta1~1633 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7b16fb4811c5fb3a8196264fb6df1c0641825a1;p=thirdparty%2Fsuricata.git eve/filetype: reorder fields to match lifecycle Enhances readability. --- diff --git a/src/output-eve.h b/src/output-eve.h index 3b2637f64c..7046c7b980 100644 --- a/src/output-eve.h +++ b/src/output-eve.h @@ -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;