suricata
output-file.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2022 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  *
23  * AppLayer File Logger Output registration functions
24  */
25 
26 #ifndef __OUTPUT_FILE_H__
27 #define __OUTPUT_FILE_H__
28 
29 #include "rust.h"
30 
31 /** per thread data for this module, contains a list of per thread
32  * data for the packet loggers. */
35 #ifdef HAVE_MAGIC
36  magic_t magic_ctx;
37 #endif
39 
42 
44  FileContainer *ffc, void *txv, const uint64_t tx_id, AppLayerTxData *txd,
45  const bool file_close, const bool file_trunc, uint8_t dir);
46 
47 /** file logger function pointer type */
48 typedef int (*FileLogger)(ThreadVars *, void *thread_data, const Packet *, const File *, void *tx,
49  const uint64_t tx_id, uint8_t direction);
50 
51 int OutputRegisterFileLogger(LoggerId id, const char *name, FileLogger LogFunc,
52  OutputCtx *, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
53  ThreadExitPrintStatsFunc ThreadExitPrintStats);
54 
55 void OutputFileLoggerRegister(void);
56 
57 void OutputFileShutdown(void);
58 
59 #endif /* __OUTPUT_FILE_H__ */
FileContainer_
Definition: util-file.h:113
OutputLoggerThreadStore_
Definition: output.h:33
OutputFileLoggerThreadData_
Definition: output-file.h:33
LoggerId
LoggerId
Definition: suricata-common.h:449
rust.h
OutputFileLogThreadDeinit
TmEcode OutputFileLogThreadDeinit(ThreadVars *tv, OutputFileLoggerThreadData *thread_data)
Definition: output-file.c:217
OutputCtx_
Definition: tm-modules.h:78
FileLogger
int(* FileLogger)(ThreadVars *, void *thread_data, const Packet *, const File *, void *tx, const uint64_t tx_id, uint8_t direction)
Definition: output-file.h:48
OutputFileShutdown
void OutputFileShutdown(void)
Definition: output-file.c:245
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:57
ThreadInitFunc
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
Definition: tm-modules.h:39
OutputFileLoggerThreadData
struct OutputFileLoggerThreadData_ OutputFileLoggerThreadData
Packet_
Definition: decode.h:428
TmEcode
TmEcode
Definition: tm-threads-common.h:83
File_
Definition: util-file.h:79
AppLayerTxData
struct AppLayerTxData AppLayerTxData
Definition: detect.h:1303
ThreadExitPrintStatsFunc
void(* ThreadExitPrintStatsFunc)(ThreadVars *, void *)
Definition: tm-modules.h:41
OutputFileLogThreadInit
TmEcode OutputFileLogThreadInit(ThreadVars *tv, OutputFileLoggerThreadData **data)
thread init for the file logger This will run the thread init functions for the individual registered...
Definition: output-file.c:169
OutputFileLoggerRegister
void OutputFileLoggerRegister(void)
Definition: output-file.c:241
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
OutputRegisterFileLogger
int OutputRegisterFileLogger(LoggerId id, const char *name, FileLogger LogFunc, OutputCtx *, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Definition: output-file.c:57
OutputFileLogFfc
void OutputFileLogFfc(ThreadVars *tv, OutputFileLoggerThreadData *op_thread_data, Packet *p, FileContainer *ffc, void *txv, const uint64_t tx_id, AppLayerTxData *txd, const bool file_close, const bool file_trunc, uint8_t dir)
Definition: output-file.c:101
OutputFileLoggerThreadData_::store
OutputLoggerThreadStore * store
Definition: output-file.h:34
ThreadDeinitFunc
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)
Definition: tm-modules.h:40