#include "app-layer-protos.h"
#include "app-layer-parser.h"
#include "app-layer-detect-proto.h"
+#include "app-layer-events.h"
#include "app-layer-dnp3.h"
#include "app-layer-dnp3-objects.h"
#include "app-layer-parser.h"
#include "app-layer-expectation.h"
#include "app-layer-detect-proto.h"
+#include "app-layer-events.h"
#include "rust.h"
#include "app-layer-htp-xff.h"
#include "app-layer-htp-range.h"
#include "app-layer-htp-mem.h"
+#include "app-layer-events.h"
#include "util-debug.h"
#include "util-misc.h"
#include "app-layer-parser.h"
#include "app-layer-modbus.h"
+#include "rust.h"
void ModbusParserRegisterTests(void);
#include "flow-util.h"
#include "app-layer-frames.h"
+#include "app-layer-events.h"
#include "stream-tcp.h"
#include "util-validate.h"
+#include "util-config.h"
#include "app-layer.h"
#include "app-layer-detect-proto.h"
#ifndef SURICATA_APP_LAYER_PARSER_H
#define SURICATA_APP_LAYER_PARSER_H
-#include "app-layer-events.h"
-#include "util-file.h"
-#include "rust.h"
-#include "util-config.h"
+#include "app-layer-protos.h"
+// Forward declarations for bindgen
+enum ConfigAction;
+typedef struct Flow_ Flow;
+typedef struct AppLayerParserState_ AppLayerParserState;
+typedef struct AppLayerDecoderEvents_ AppLayerDecoderEvents;
+typedef struct ThreadVars_ ThreadVars;
+typedef struct File_ File;
+// Forward declarations from rust
+typedef struct StreamSlice StreamSlice;
+typedef struct AppLayerResult AppLayerResult;
+typedef struct AppLayerGetTxIterTuple AppLayerGetTxIterTuple;
+typedef struct AppLayerGetFileState AppLayerGetFileState;
+typedef struct AppLayerTxData AppLayerTxData;
+typedef enum AppLayerEventType AppLayerEventType;
+typedef struct AppLayerStateData AppLayerStateData;
+typedef struct AppLayerTxConfig AppLayerTxConfig;
/* Flags for AppLayerParserState. */
// flag available BIT_U16(0)
void AppLayerParserApplyTxConfig(uint8_t ipproto, AppProto alproto,
void *state, void *tx, enum ConfigAction mode, AppLayerTxConfig);
-static inline bool AppLayerParserIsFileTx(const AppLayerTxData *txd)
-{
- if (txd->file_tx != 0) {
- return true;
- }
- return false;
-}
-
-static inline bool AppLayerParserIsFileTxInDir(const AppLayerTxData *txd, const uint8_t direction)
-{
- if ((txd->file_tx & direction) != 0) {
- return true;
- }
- return false;
-}
-
/** \brief check if tx (possibly) has files in this tx for the direction */
-static inline bool AppLayerParserHasFilesInDir(const AppLayerTxData *txd, const uint8_t direction)
-{
- return (txd->files_opened && AppLayerParserIsFileTxInDir(txd, direction));
-}
+#define AppLayerParserHasFilesInDir(txd, direction) \
+ ((txd)->files_opened && ((txd)->file_tx & (direction)) != 0)
/***** General *****/
#include "suricata.h"
#include "stream.h"
#include "conf.h"
+#include "rust.h"
#include "app-layer-detect-proto.h"
#include "app-layer-parser.h"
#include "app-layer-protos.h"
#include "app-layer-parser.h"
#include "app-layer-frames.h"
+#include "app-layer-events.h"
#include "app-layer-smtp.h"
#include "util-enum.h"
#include "app-layer-protos.h"
#include "app-layer-parser.h"
#include "app-layer-frames.h"
+#include "app-layer-events.h"
#include "app-layer-ssl.h"
#include "conf.h"
#include "app-layer-htp-range.h"
#include "app-layer-detect-proto.h"
#include "app-layer-frames.h"
+#include "app-layer-events.h"
#include "stream-tcp-reassemble.h"
#include "stream-tcp-private.h"
#include "stream-tcp-inline.h"
#include "app-layer.h"
#include "app-layer-protos.h"
#include "app-layer-parser.h"
+#include "app-layer-events.h"
#include "app-layer-smtp.h"
#include "detect.h"
#include "detect-parse.h"
#include "threads.h"
#include "decode.h"
+#include "rust.h"
#include "app-layer-parser.h"
#include "app-layer-protos.h"
#include "detect-engine-state.h"
#include "detect-engine-build.h"
-#include "rust-bindings.h"
-
#include "detect-content.h"
#include "detect-pcre.h"
#include "detect-byte.h"
#include "datasets.h"
#include "app-layer-parser.h"
+#include "app-layer-events.h"
#include "app-layer-htp.h"
#include "detect-parse.h"
#include "flow-util.h"
#include "detect-flowbits.h"
#include "util-spm.h"
+#include "rust.h"
#include "app-layer-parser.h"
#include "detect-engine-content-inspection.h"
#include "detect-engine-mpm.h"
#include "detect-ike-vendor.h"
+#include "rust.h"
#include "app-layer-parser.h"
#include "util-byte.h"
-#include "rust-bindings.h"
#include "util-profiling.h"
static int DetectIkeVendorSetup(DetectEngineCtx *, Signature *, const char *);
#include "detect-lua.h"
+#include "rust.h"
#include "app-layer-parser.h"
#include "util-lua.h"
#include "util-debug.h"
+#include "rust.h"
#include "app-layer-parser.h"
#include "app-layer-expectation.h"
#include "stream.h"
#include "app-layer.h"
#include "app-layer-parser.h"
+#include "util-config.h"
#include "util-profiling.h"
#include "util-validate.h"
op_thread_data->filedata);
if (file_logging_active) {
- if (AppLayerParserIsFileTx(txd)) { // need to process each tx that might be a file tx,
- // even if there are not files (yet)
+ if (txd->file_tx != 0) { // need to process each tx that might be a file tx,
+ // even if there are not files (yet)
const bool ts_ready = (tx_progress_ts == complete_ts);
const bool tc_ready = (tx_progress_tc == complete_tc);
SCLogDebug("ts_ready %d tc_ready %d", ts_ready, tc_ready);
/* call only for the correct direction, except when it looks anything like a end of
* transaction or end of stream. Since OutputTxLogFiles has complicated logic around
* that, we just leave it to that function to sort things out for now. */
- if (eval_files || AppLayerParserIsFileTxInDir(txd, pkt_dir)) {
+ if (eval_files || ((txd->file_tx & pkt_dir) != 0)) {
OutputTxLogFiles(tv, op_thread_data->file, op_thread_data->filedata, p, f, tx,
tx_id, txd, tx_complete, ts_ready, tc_ready, ts_eof, tc_eof, eof);
}
#include "suricata-common.h"
#include "rust-context.h"
#include "app-layer-parser.h"
+#include "app-layer-events.h"
#include "app-layer-register.h"
#include "app-layer-htp-range.h"
#include "app-layer-htp-file.h"
#include "util-byte.h"
#include "conf-yaml-loader.h"
#include "util-conf.h"
+#include "rust.h"
#define HEADER_LEN 6