Skip to content

Commit 1aa706a

Browse files
committed
output-eve: bindgen SCRegisterEveFileType to Rust
Used by Rust output plugins.
1 parent be93ed0 commit 1aa706a

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

rust/sys/src/sys.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,9 @@ impl Default for SCEveFileType_ {
538538
}
539539
#[doc = " \\brief Structure used to define an EVE output file type.\n\n EVE filetypes implement an object with a file-like interface and\n are used to output EVE log records to files, syslog, or\n database. They can be built-in such as the syslog (see\n SyslogInitialize()) and nullsink (see NullLogInitialize()) outputs,\n registered by a library user or dynamically loaded as a plugin.\n\n The life cycle of an EVE filetype is:\n - Init: called once for each EVE instance using this filetype\n - ThreadInit: called once for each output thread\n - Write: called for each log record\n - ThreadDeinit: called once for each output thread on exit\n - Deinit: called once for each EVE instance using this filetype on exit\n\n Examples:\n - built-in syslog: \\ref src/output-eve-syslog.c\n - built-in nullsink: \\ref src/output-eve-null.c\n - example plugin: \\ref examples/plugins/c-json-filetype/filetype.c\n\n ### Multi-Threaded Note:\n\n The EVE logging system can be configured by the Suricata user to\n run in threaded or non-threaded modes. In the default non-threaded\n mode, ThreadInit will only be called once and the filetype does not\n need to be concerned with threads.\n\n However, in **threaded** mode, ThreadInit will be called multiple\n times and the filetype needs to be thread aware and thread-safe. If\n utilizing a unique resource such as a file for each thread then you\n may be naturally thread safe. However, if sharing a single file\n handle across all threads then your filetype will have to take care\n of locking, etc."]
540540
pub type SCEveFileType = SCEveFileType_;
541+
extern "C" {
542+
pub fn SCRegisterEveFileType(arg1: *mut SCEveFileType) -> bool;
543+
}
541544
extern "C" {
542545
pub fn SCSigTablePreRegister(
543546
KeywordsRegister: ::std::option::Option<unsafe extern "C" fn()>,

src/output-eve-bindgen.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,6 @@ typedef struct SCEveFileType_ {
189189
TAILQ_ENTRY(SCEveFileType_) entries;
190190
} SCEveFileType;
191191

192+
bool SCRegisterEveFileType(SCEveFileType *);
193+
192194
#endif /* ! SURICATA_OUTPUT_EVEN_BINDGEN_H */

src/output-eve.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
#include "conf.h"
3636
#include "output-eve-bindgen.h"
3737

38-
bool SCRegisterEveFileType(SCEveFileType *);
39-
4038
SCEveFileType *SCEveFindFileType(const char *name);
4139

4240
/** \brief Function type for EVE callbacks.

0 commit comments

Comments
 (0)