suricata
filetype.c File Reference
#include "suricata-common.h"
#include "suricata-plugin.h"
#include "output-eve.h"
#include "util-mem.h"
#include "util-debug.h"
Include dependency graph for filetype.c:

Go to the source code of this file.

Data Structures

struct  ThreadData_
 
struct  Context_
 

Macros

#define FILETYPE_NAME   "json-filetype-plugin"
 

Typedefs

typedef struct ThreadData_ ThreadData
 
typedef struct Context_ Context
 

Functions

void PluginInit (void)
 
const SCPluginSCPluginRegister ()
 

Variables

const SCPlugin PluginRegistration
 

Macro Definition Documentation

◆ FILETYPE_NAME

#define FILETYPE_NAME   "json-filetype-plugin"

Definition at line 24 of file filetype.c.

Typedef Documentation

◆ Context

typedef struct Context_ Context

A context object for each eve logger using this output.

◆ ThreadData

typedef struct ThreadData_ ThreadData

Per thread context data for each logging thread.

Function Documentation

◆ PluginInit()

void PluginInit ( void  )

Called by Suricata to initialize the module. This module registers new file type to the JSON logger.

Definition at line 194 of file filetype.c.

References SCEveFileType_::Deinit, FatalError, FILETYPE_NAME, SCEveFileType_::Init, SCEveFileType_::name, SCCalloc, SCRegisterEveFileType(), SCEveFileType_::ThreadDeinit, SCEveFileType_::ThreadInit, and SCEveFileType_::Write.

Here is the call graph for this function:

◆ SCPluginRegister()

const SCPlugin * SCPluginRegister ( void  )

The function called by Suricata after loading this plugin.

A pointer to a populated SCPlugin struct must be returned.

Definition at line 223 of file filetype.c.

References PluginRegistration.

Variable Documentation

◆ PluginRegistration

const SCPlugin PluginRegistration
Initial value:
= {
.version = SC_API_VERSION,
.suricata_version = SC_PACKAGE_VERSION,
.name = FILETYPE_NAME,
.plugin_version = "0.1.0",
.author = "FirstName LastName <name@example.org>",
.license = "GPL-2.0-only",
.Init = PluginInit,
}
#define FILETYPE_NAME
Definition filetype.c:24
void PluginInit(void)
Definition filetype.c:194
#define SC_PACKAGE_VERSION

Definition at line 208 of file filetype.c.

Referenced by SCPluginRegister().