suricata
output-filedata.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 Filedata Logger Output registration functions
24  */
25 
26 #ifndef SURICATA_OUTPUT_FILEDATA_H
27 #define SURICATA_OUTPUT_FILEDATA_H
28 
29 #define OUTPUT_FILEDATA_FLAG_OPEN 0x01
30 #define OUTPUT_FILEDATA_FLAG_CLOSE 0x02
31 
32 /** per thread data for this module, contains a list of per thread
33  * data for the packet loggers. */
36 #ifdef HAVE_MAGIC
37  magic_t magic_ctx;
38 #endif
40 
43 
45  AppLayerGetFileState files, void *txv, const uint64_t tx_id, AppLayerTxData *txd,
46  const uint8_t call_flags, const bool file_close, const bool file_trunc, const uint8_t dir);
47 
48 /** filedata logger function pointer type */
49 typedef int (*FiledataLogger)(ThreadVars *, void *thread_data, const Packet *, File *, void *tx,
50  const uint64_t tx_id, const uint8_t *, uint32_t, uint8_t, uint8_t dir);
51 
52 int OutputRegisterFiledataLogger(LoggerId id, const char *name,
53  FiledataLogger LogFunc, OutputCtx *, ThreadInitFunc ThreadInit,
54  ThreadDeinitFunc ThreadDeinit,
55  ThreadExitPrintStatsFunc ThreadExitPrintStats);
56 
58 
59 void OutputFiledataShutdown(void);
60 
61 #endif /* SURICATA_OUTPUT_FILEDATA_H */
OutputFiledataLogThreadDeinit
TmEcode OutputFiledataLogThreadDeinit(ThreadVars *tv, OutputFiledataLoggerThreadData *thread_data)
Definition: output-filedata.c:250
OutputLoggerThreadStore_
Definition: output.h:33
OutputFiledataLoggerThreadData_::store
OutputLoggerThreadStore * store
Definition: output-filedata.h:35
LoggerId
LoggerId
Definition: suricata-common.h:460
OutputCtx_
Definition: tm-modules.h:85
FiledataLogger
int(* FiledataLogger)(ThreadVars *, void *thread_data, const Packet *, File *, void *tx, const uint64_t tx_id, const uint8_t *, uint32_t, uint8_t, uint8_t dir)
Definition: output-filedata.h:49
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:57
ThreadInitFunc
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
Definition: tm-modules.h:40
Packet_
Definition: decode.h:437
TmEcode
TmEcode
Definition: tm-threads-common.h:83
OutputFiledataLoggerThreadData_
Definition: output-filedata.h:34
OutputRegisterFiledataLogger
int OutputRegisterFiledataLogger(LoggerId id, const char *name, FiledataLogger LogFunc, OutputCtx *, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Definition: output-filedata.c:55
File_
Definition: util-file.h:79
AppLayerTxData
struct AppLayerTxData AppLayerTxData
Definition: detect.h:1358
ThreadExitPrintStatsFunc
void(* ThreadExitPrintStatsFunc)(ThreadVars *, void *)
Definition: tm-modules.h:42
OutputFiledataLogFfc
void OutputFiledataLogFfc(ThreadVars *tv, OutputFiledataLoggerThreadData *td, Packet *p, AppLayerGetFileState files, void *txv, const uint64_t tx_id, AppLayerTxData *txd, const uint8_t call_flags, const bool file_close, const bool file_trunc, const uint8_t dir)
Definition: output-filedata.c:128
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
OutputFiledataLoggerThreadData
struct OutputFiledataLoggerThreadData_ OutputFiledataLoggerThreadData
OutputFiledataShutdown
void OutputFiledataShutdown(void)
Definition: output-filedata.c:281
OutputFiledataLogThreadInit
TmEcode OutputFiledataLogThreadInit(ThreadVars *tv, OutputFiledataLoggerThreadData **data)
thread init for the filedata logger This will run the thread init functions for the individual regist...
Definition: output-filedata.c:204
ThreadDeinitFunc
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)
Definition: tm-modules.h:41
OutputFiledataLoggerRegister
void OutputFiledataLoggerRegister(void)
Definition: output-filedata.c:275