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-krb5.h" //KRB5State, KRB5Transaction
26 #include "app-layer-ike.h" //IKEState, IKETransaction
27 #include "app-layer-ntp.h" //NTPState, NTPTransaction
28 #include "app-layer-snmp.h" //SNMPState, SNMPTransaction
29 #include "app-layer-tftp.h" //TFTPState, TFTPTransaction
30 
31 #include "util-debug.h"
32 #include "util-file.h"
33 
34 // hack for include orders cf SCSha256
36 
37 struct AppLayerParser;
38 
39 typedef struct SuricataContext_ {
40  SCError (*SCLogMessage)(const SCLogLevel, const char *, const unsigned int, const char *,
41  const char *, const char *message);
44  uint8_t);
47 
50  const uint16_t, HttpRangeContainerBlock *, const uint8_t *, uint32_t);
51 
53  uint32_t track_id, const uint8_t *name, uint16_t name_len,
54  const uint8_t *data, uint32_t data_len, uint16_t flags);
55  int (*FileCloseFileById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id,
56  const uint8_t *data, uint32_t data_len, uint16_t flags);
57  int (*FileAppendDataById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id,
58  const uint8_t *data, uint32_t data_len);
59  int (*FileAppendGAPById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id,
60  const uint8_t *data, uint32_t data_len);
62 
63  int (*AppLayerRegisterParser)(const struct AppLayerParser *p, AppProto alproto);
64 
66 
68 
69 typedef struct SuricataFileContext_ {
70 
72 
74 
75 const SuricataContext *SCGetContext(void);
76 
77 #endif /* !SURICATA_RUST_CONTEXT_H */
SuricataContext_::DetectEngineStateFree
void(* DetectEngineStateFree)(DetectEngineState *)
Definition: rust-context.h:42
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:43
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:81
SuricataContext_::HTPFileCloseHandleRange
bool(* HTPFileCloseHandleRange)(const StreamingBufferConfig *sbcfg, FileContainer *, const uint16_t, HttpRangeContainerBlock *, const uint8_t *, uint32_t)
Definition: rust-context.h:49
SuricataContext_::AppLayerDecoderEventsFreeEvents
void(* AppLayerDecoderEventsFreeEvents)(AppLayerDecoderEvents **)
Definition: rust-context.h:45
SuricataContext_::HttpRangeFreeBlock
void(* HttpRangeFreeBlock)(HttpRangeContainerBlock *)
Definition: rust-context.h:48
Flow_
Flow data structure.
Definition: flow.h:351
SuricataContext_::AppLayerRegisterParser
int(* AppLayerRegisterParser)(const struct AppLayerParser *p, AppProto alproto)
Definition: rust-context.h:63
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
app-layer-krb5.h
AppLayerParser
Definition: app-layer-register.h:29
util-debug.h
app-layer-ike.h
SuricataFileContext_::sbcfg
const StreamingBufferConfig * sbcfg
Definition: rust-context.h:71
detect.h
SuricataContext_::FileContainerRecycle
void(* FileContainerRecycle)(FileContainer *ffc, const StreamingBufferConfig *)
Definition: rust-context.h:61
SuricataContext_::FileAppendDataById
int(* FileAppendDataById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id, const uint8_t *data, uint32_t data_len)
Definition: rust-context.h:57
SuricataContext_::AppLayerParserTriggerRawStreamReassembly
void(* AppLayerParserTriggerRawStreamReassembly)(Flow *, int direction)
Definition: rust-context.h:46
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:55
SCError
SCError
Definition: util-error.h:26
SuricataContext
struct SuricataContext_ SuricataContext
StreamingBufferConfig_
Definition: util-streaming-buffer.h:65
SuricataFileContext_
Definition: rust-context.h:69
SuricataContext_::SCLogMessage
SCError(* SCLogMessage)(const SCLogLevel, const char *, const unsigned int, const char *, const char *, const char *message)
Definition: rust-context.h:40
app-layer-snmp.h
SuricataContext_::FileAppendGAPById
int(* FileAppendGAPById)(FileContainer *, const StreamingBufferConfig *, uint32_t track_id, const uint8_t *data, uint32_t data_len)
Definition: rust-context.h:59
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:52
flow.h
SuricataContext_
Definition: rust-context.h:39
app-layer-ntp.h