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 SURICATA_OUTPUT_FILE_H
27 #define SURICATA_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 /* SURICATA_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:460
rust.h
OutputFileLogThreadDeinit
TmEcode OutputFileLogThreadDeinit(ThreadVars *tv, OutputFileLoggerThreadData *thread_data)
Definition: output-file.c:215
OutputCtx_
Definition: tm-modules.h:85
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:243
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:57
ThreadInitFunc
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
Definition: tm-modules.h:40
OutputFileLoggerThreadData
struct OutputFileLoggerThreadData_ OutputFileLoggerThreadData
Packet_
Definition: decode.h:437
TmEcode
TmEcode
Definition: tm-threads-common.h:83
File_
Definition: util-file.h:79
AppLayerTxData
struct AppLayerTxData AppLayerTxData
Definition: detect.h:1358
ThreadExitPrintStatsFunc
void(* ThreadExitPrintStatsFunc)(ThreadVars *, void *)
Definition: tm-modules.h:42
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:168
OutputFileLoggerRegister
void OutputFileLoggerRegister(void)
Definition: output-file.c:239
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:100
OutputFileLoggerThreadData_::store
OutputLoggerThreadStore * store
Definition: output-file.h:34
ThreadDeinitFunc
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)
Definition: tm-modules.h:41