|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
/* Copyright (C) 2020 Open Information Security Foundation
|
|
|
|
|
/* Copyright (C) 2020-2021 Open Information Security Foundation
|
|
|
|
|
*
|
|
|
|
|
* You can copy, redistribute or modify this Program under the terms of
|
|
|
|
|
* the GNU General Public License version 2 as published by the Free
|
|
|
|
@ -45,12 +45,22 @@ typedef struct SCPlugin_ {
|
|
|
|
|
* Structure used to define a file type plugin.
|
|
|
|
|
*
|
|
|
|
|
* Currently only used by the Eve output type.
|
|
|
|
|
*
|
|
|
|
|
* name -- The plugin name. This name is used to identify the plugin: eve-log.filetype and in the
|
|
|
|
|
* plugins: section
|
|
|
|
|
*/
|
|
|
|
|
typedef struct SCPluginFileType_ {
|
|
|
|
|
char *name;
|
|
|
|
|
int (*Open)(ConfNode *conf, void **data);
|
|
|
|
|
int (*Write)(const char *buffer, int buffer_len, void *ctx);
|
|
|
|
|
void (*Close)(void *ctx);
|
|
|
|
|
/* Init Called on first access */
|
|
|
|
|
int (*Init)(ConfNode *conf, bool threaded, void **init_data);
|
|
|
|
|
/* Write - Called on each write to the object */
|
|
|
|
|
int (*Write)(const char *buffer, int buffer_len, void *init_data, void *thread_data);
|
|
|
|
|
/* Close - Called on final close */
|
|
|
|
|
void (*Deinit)(void *init_data);
|
|
|
|
|
/* ThreadInit - Called for each thread using file object*/
|
|
|
|
|
int (*ThreadInit)(void *init_data, int thread_id, void **thread_data);
|
|
|
|
|
/* ThreadDeinit - Called for each thread using file object */
|
|
|
|
|
int (*ThreadDeinit)(void *init_data, void *thread_data);
|
|
|
|
|
TAILQ_ENTRY(SCPluginFileType_) entries;
|
|
|
|
|
} SCPluginFileType;
|
|
|
|
|
|
|
|
|
@ -59,6 +69,8 @@ bool SCPluginRegisterFileType(SCPluginFileType *);
|
|
|
|
|
typedef struct SCCapturePlugin_ {
|
|
|
|
|
char *name;
|
|
|
|
|
void (*Init)(const char *args, int plugin_slot, int receive_slot, int decode_slot);
|
|
|
|
|
int (*ThreadInit)(void *ctx, int thread_id, void **thread_ctx);
|
|
|
|
|
int (*ThreadDeinit)(void *ctx, void *thread_ctx);
|
|
|
|
|
const char *(*GetDefaultMode)(void);
|
|
|
|
|
TAILQ_ENTRY(SCCapturePlugin_) entries;
|
|
|
|
|
} SCCapturePlugin;
|
|
|
|
|