src: clean includes for app-layer-parser.h

To prepare bindgening
pull/13419/head
Philippe Antoine 2 months ago committed by Victor Julien
parent f2faba5a23
commit 249131e9de

@ -32,6 +32,7 @@
#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"

@ -31,6 +31,7 @@
#include "app-layer-parser.h"
#include "app-layer-expectation.h"
#include "app-layer-detect-proto.h"
#include "app-layer-events.h"
#include "rust.h"

@ -55,6 +55,7 @@
#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"

@ -40,6 +40,7 @@
#include "app-layer-parser.h"
#include "app-layer-modbus.h"
#include "rust.h"
void ModbusParserRegisterTests(void);

@ -31,10 +31,12 @@
#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"

@ -25,10 +25,23 @@
#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)
@ -248,27 +261,9 @@ AppLayerStateData *AppLayerParserGetStateData(uint8_t ipproto, AppProto alproto,
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 *****/

@ -27,6 +27,7 @@
#include "suricata.h"
#include "stream.h"
#include "conf.h"
#include "rust.h"
#include "app-layer-detect-proto.h"
#include "app-layer-parser.h"

@ -32,6 +32,7 @@
#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"

@ -32,6 +32,7 @@
#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"

@ -34,6 +34,7 @@
#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"

@ -28,6 +28,7 @@
#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"

@ -29,6 +29,7 @@
#include "threads.h"
#include "decode.h"
#include "rust.h"
#include "app-layer-parser.h"
#include "app-layer-protos.h"
@ -40,8 +41,6 @@
#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"

@ -33,6 +33,7 @@
#include "datasets.h"
#include "app-layer-parser.h"
#include "app-layer-events.h"
#include "app-layer-htp.h"
#include "detect-parse.h"

@ -34,6 +34,7 @@
#include "flow-util.h"
#include "detect-flowbits.h"
#include "util-spm.h"
#include "rust.h"
#include "app-layer-parser.h"

@ -30,10 +30,10 @@
#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 *);

@ -34,6 +34,7 @@
#include "detect-lua.h"
#include "rust.h"
#include "app-layer-parser.h"
#include "util-lua.h"

@ -57,6 +57,7 @@
#include "util-debug.h"
#include "rust.h"
#include "app-layer-parser.h"
#include "app-layer-expectation.h"

@ -29,6 +29,7 @@
#include "stream.h"
#include "app-layer.h"
#include "app-layer-parser.h"
#include "util-config.h"
#include "util-profiling.h"
#include "util-validate.h"
@ -427,8 +428,8 @@ static TmEcode OutputTxLog(ThreadVars *tv, Packet *p, void *thread_data)
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);
@ -444,7 +445,7 @@ static TmEcode OutputTxLog(ThreadVars *tv, Packet *p, void *thread_data)
/* 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);
}

@ -18,6 +18,7 @@
#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"

@ -13,6 +13,7 @@
#include "util-byte.h"
#include "conf-yaml-loader.h"
#include "util-conf.h"
#include "rust.h"
#define HEADER_LEN 6

Loading…
Cancel
Save