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 __RUST_CONTEXT_H__
19 #define __RUST_CONTEXT_H__
20 
21 #include "detect-engine-state.h" //DetectEngineState
22 #include "app-layer-krb5.h" //KRB5State, KRB5Transaction
23 #include "app-layer-ike.h" //IKEState, IKETransaction
24 #include "app-layer-ntp.h" //NTPState, NTPTransaction
25 #include "app-layer-snmp.h" //SNMPState, SNMPTransaction
26 #include "app-layer-tftp.h" //TFTPState, TFTPTransaction
27 
28 // hack for include orders cf SCSha256
30 
31 struct AppLayerParser;
32 
33 typedef struct SuricataContext_ {
34  SCError (*SCLogMessage)(const SCLogLevel, const char *, const unsigned int,
35  const char *, const SCError, const char *message);
38  uint8_t);
41 
44  FileContainer *, const uint16_t, HttpRangeContainerBlock *, const uint8_t *, uint32_t);
45 
47  uint32_t track_id, const uint8_t *name, uint16_t name_len,
48  const uint8_t *data, uint32_t data_len, uint16_t flags);
49  int (*FileCloseFileById)(FileContainer *, uint32_t track_id,
50  const uint8_t *data, uint32_t data_len, uint16_t flags);
51  int (*FileAppendDataById)(FileContainer *, uint32_t track_id,
52  const uint8_t *data, uint32_t data_len);
53  int (*FileAppendGAPById)(FileContainer *, uint32_t track_id,
54  const uint8_t *data, uint32_t data_len);
56  void (*FilePrune)(FileContainer *ffc);
57  void (*FileSetTx)(FileContainer *, uint64_t);
58 
59  int (*AppLayerRegisterParser)(const struct AppLayerParser *p, AppProto alproto);
60 
62 
64 
65 typedef struct SuricataFileContext_ {
66 
68 
70 
72 
73 #endif /* !__RUST_CONTEXT_H__ */
SuricataContext_::DetectEngineStateFree
void(* DetectEngineStateFree)(DetectEngineState *)
Definition: rust-context.h:36
FileContainer_
Definition: util-file.h:107
SuricataFileContext
struct SuricataFileContext_ SuricataFileContext
app-layer-tftp.h
SuricataContext_::SCLogMessage
SCError(* SCLogMessage)(const SCLogLevel, const char *, const unsigned int, const char *, const SCError, const char *message)
Definition: rust-context.h:34
DetectEngineState_
Definition: detect-engine-state.h:93
SuricataContext_::AppLayerDecoderEventsSetEventRaw
void(* AppLayerDecoderEventsSetEventRaw)(AppLayerDecoderEvents **, uint8_t)
Definition: rust-context.h:37
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:77
SuricataContext_::AppLayerDecoderEventsFreeEvents
void(* AppLayerDecoderEventsFreeEvents)(AppLayerDecoderEvents **)
Definition: rust-context.h:39
SuricataContext_::HttpRangeFreeBlock
void(* HttpRangeFreeBlock)(HttpRangeContainerBlock *)
Definition: rust-context.h:42
Flow_
Flow data structure.
Definition: flow.h:353
SuricataContext_::AppLayerRegisterParser
int(* AppLayerRegisterParser)(const struct AppLayerParser *p, AppProto alproto)
Definition: rust-context.h:59
SuricataContext_::FileSetTx
void(* FileSetTx)(FileContainer *, uint64_t)
Definition: rust-context.h:57
AppLayerDecoderEvents_
Data structure to store app layer decoder events.
Definition: app-layer-events.h:34
HttpRangeContainerBlock
Definition: app-layer-htp-range.h:89
app-layer-krb5.h
AppLayerParser
Definition: app-layer-register.h:27
app-layer-ike.h
SuricataFileContext_::sbcfg
const StreamingBufferConfig * sbcfg
Definition: rust-context.h:67
SuricataContext_::FileAppendDataById
int(* FileAppendDataById)(FileContainer *, uint32_t track_id, const uint8_t *data, uint32_t data_len)
Definition: rust-context.h:51
suricata_context
SuricataContext suricata_context
Definition: rust-context.c:21
SuricataContext_::FileCloseFileById
int(* FileCloseFileById)(FileContainer *, uint32_t track_id, const uint8_t *data, uint32_t data_len, uint16_t flags)
Definition: rust-context.h:49
SuricataContext_::AppLayerParserTriggerRawStreamReassembly
void(* AppLayerParserTriggerRawStreamReassembly)(Flow *, int direction)
Definition: rust-context.h:40
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:50
SuricataContext_::FilePrune
void(* FilePrune)(FileContainer *ffc)
Definition: rust-context.h:56
SuricataContext_::FileAppendGAPById
int(* FileAppendGAPById)(FileContainer *, uint32_t track_id, const uint8_t *data, uint32_t data_len)
Definition: rust-context.h:53
flags
uint8_t flags
Definition: decode-gre.h:0
SCError
SCError
Definition: util-error.h:29
SuricataContext
struct SuricataContext_ SuricataContext
StreamingBufferConfig_
Definition: util-streaming-buffer.h:67
SuricataFileContext_
Definition: rust-context.h:65
app-layer-snmp.h
SuricataContext_::HTPFileCloseHandleRange
void(* HTPFileCloseHandleRange)(FileContainer *, const uint16_t, HttpRangeContainerBlock *, const uint8_t *, uint32_t)
Definition: rust-context.h:43
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:46
SuricataContext_::FileContainerRecycle
void(* FileContainerRecycle)(FileContainer *ffc)
Definition: rust-context.h:55
SCGetContext
SuricataContext * SCGetContext(void)
Definition: rust-context.c:23
SuricataContext_
Definition: rust-context.h:33
app-layer-ntp.h