suricata
rust-context.h
Go to the documentation of this file.
1 /* Copyright (C) 2017 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 #ifndef SURICATA_RUST_CONTEXT_H
19 #define SURICATA_RUST_CONTEXT_H
20 
21 #include "flow.h"
22 #include "detect.h"
23 #include "detect-engine-state.h" //DetectEngineState
24 
25 #include "app-layer-ike.h" //IKEState, IKETransaction
26 #include "app-layer-tftp.h" //TFTPState, TFTPTransaction
27 
28 #include "util-debug.h"
29 #include "util-file.h"
30 
31 // hack for include orders cf SCSha256
33 
34 struct AppLayerParser;
35 
36 typedef struct SuricataContext_ {
37  SCError (*SCLogMessage)(const SCLogLevel, const char *, const unsigned int, const char *,
38  const char *, const char *message);
41  uint8_t);
44 
47  const uint16_t, HttpRangeContainerBlock *, const uint8_t *, uint32_t);
48 
50  uint32_t track_id, const uint8_t *name, uint16_t name_len,
51  const uint8_t *data, uint32_t data_len, uint16_t flags);
52  int (*FileCloseFileById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id,
53  const uint8_t *data, uint32_t data_len, uint16_t flags);
54  int (*FileAppendDataById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id,
55  const uint8_t *data, uint32_t data_len);
56  int (*FileAppendGAPById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id,
57  const uint8_t *data, uint32_t data_len);
59 
60  int (*AppLayerRegisterParser)(const struct AppLayerParser *p, AppProto alproto);
61 
63 
65 
66 typedef struct SuricataFileContext_ {
67 
69 
71 
72 const SuricataContext *SCGetContext(void);
73 
74 #endif /* !SURICATA_RUST_CONTEXT_H */
SuricataContext_::DetectEngineStateFree
void(* DetectEngineStateFree)(DetectEngineState *)
Definition: rust-context.h:39
FileContainer_
Definition: util-file.h:113
SuricataFileContext
struct SuricataFileContext_ SuricataFileContext
app-layer-tftp.h
DetectEngineState_
Definition: detect-engine-state.h:92
suricata_context
const SuricataContext suricata_context
Definition: rust-context.c:25
SuricataContext_::AppLayerDecoderEventsSetEventRaw
void(* AppLayerDecoderEventsSetEventRaw)(AppLayerDecoderEvents **, uint8_t)
Definition: rust-context.h:40
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:84
SuricataContext_::HTPFileCloseHandleRange
bool(* HTPFileCloseHandleRange)(const StreamingBufferConfig *sbcfg, FileContainer *, const uint16_t, HttpRangeContainerBlock *, const uint8_t *, uint32_t)
Definition: rust-context.h:46
SuricataContext_::AppLayerDecoderEventsFreeEvents
void(* AppLayerDecoderEventsFreeEvents)(AppLayerDecoderEvents **)
Definition: rust-context.h:42
SuricataContext_::HttpRangeFreeBlock
void(* HttpRangeFreeBlock)(HttpRangeContainerBlock *)
Definition: rust-context.h:45
Flow_
Flow data structure.
Definition: flow.h:360
SuricataContext_::AppLayerRegisterParser
int(* AppLayerRegisterParser)(const struct AppLayerParser *p, AppProto alproto)
Definition: rust-context.h:60
AppLayerDecoderEvents_
Data structure to store app layer decoder events.
Definition: app-layer-events.h:35
HttpRangeContainerBlock
Definition: app-layer-htp-range.h:90
SCGetContext
const SuricataContext * SCGetContext(void)
Definition: rust-context.c:44
AppLayerParser
Definition: app-layer-register.h:29
util-debug.h
app-layer-ike.h
SuricataFileContext_::sbcfg
const StreamingBufferConfig * sbcfg
Definition: rust-context.h:68
detect.h
SuricataContext_::FileContainerRecycle
void(* FileContainerRecycle)(FileContainer *ffc, const StreamingBufferConfig *)
Definition: rust-context.h:58
SuricataContext_::FileAppendDataById
int(* FileAppendDataById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id, const uint8_t *data, uint32_t data_len)
Definition: rust-context.h:54
SuricataContext_::AppLayerParserTriggerRawStreamReassembly
void(* AppLayerParserTriggerRawStreamReassembly)(Flow *, int direction)
Definition: rust-context.h:43
detect-engine-state.h
Data structures and function prototypes for keeping state for the detection engine.
SCLogLevel
SCLogLevel
The various log levels NOTE: when adding new level, don't forget to update SCLogMapLogLevelToSyslogLe...
Definition: util-debug.h:48
util-file.h
flags
uint8_t flags
Definition: decode-gre.h:0
SuricataContext_::FileCloseFileById
int(* FileCloseFileById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id, const uint8_t *data, uint32_t data_len, uint16_t flags)
Definition: rust-context.h:52
SCError
SCError
Definition: util-error.h:26
SuricataContext
struct SuricataContext_ SuricataContext
StreamingBufferConfig_
Definition: util-streaming-buffer.h:65
SuricataFileContext_
Definition: rust-context.h:66
SuricataContext_::SCLogMessage
SCError(* SCLogMessage)(const SCLogLevel, const char *, const unsigned int, const char *, const char *, const char *message)
Definition: rust-context.h:37
SuricataContext_::FileAppendGAPById
int(* FileAppendGAPById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id, const uint8_t *data, uint32_t data_len)
Definition: rust-context.h:56
SuricataContext_::FileOpenFileWithId
int(* FileOpenFileWithId)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id, const uint8_t *name, uint16_t name_len, const uint8_t *data, uint32_t data_len, uint16_t flags)
Definition: rust-context.h:49
flow.h
SuricataContext_
Definition: rust-context.h:36