From 0d267e29a5c5fc790765f752ae89805d7e91579b Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Wed, 5 Jun 2024 13:57:32 +0200 Subject: [PATCH] files: remove the need for state in callbacks As files now belong to transactions --- rust/src/applayer.rs | 2 +- rust/src/http2/http2.rs | 1 - rust/src/nfs/nfs.rs | 2 +- rust/src/smb/files.rs | 2 +- src/app-layer-ftp.c | 2 +- src/app-layer-htp.c | 4 ++-- src/app-layer-parser.c | 13 ++++++------- src/app-layer-parser.h | 7 +++---- src/app-layer-register.h | 2 +- src/app-layer-smtp.c | 2 +- src/detect-engine-file.c | 2 +- src/detect-engine-state.c | 22 +++++++++++----------- src/detect-file-data.c | 4 ++-- src/detect-filemagic.c | 4 ++-- src/detect-filename.c | 4 ++-- src/detect-filestore.c | 2 +- src/output-json-alert.c | 3 +-- src/output-tx.c | 6 ++---- 18 files changed, 39 insertions(+), 45 deletions(-) diff --git a/rust/src/applayer.rs b/rust/src/applayer.rs index dbf4b2cd2d..03047ac588 100644 --- a/rust/src/applayer.rs +++ b/rust/src/applayer.rs @@ -424,7 +424,7 @@ pub type GetEventInfoFn = unsafe extern "C" fn (*const c_char, *mut c_int, * pub type GetEventInfoByIdFn = unsafe extern "C" fn (c_int, *mut *const c_char, *mut AppLayerEventType) -> i8; pub type LocalStorageNewFn = extern "C" fn () -> *mut c_void; pub type LocalStorageFreeFn = extern "C" fn (*mut c_void); -pub type GetTxFilesFn = unsafe extern "C" fn (*mut c_void, *mut c_void, u8) -> AppLayerGetFileState; +pub type GetTxFilesFn = unsafe extern "C" fn (*mut c_void, u8) -> AppLayerGetFileState; pub type GetTxIteratorFn = unsafe extern "C" fn (ipproto: u8, alproto: AppProto, state: *mut c_void, min_tx_id: u64, diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index d620eb77fa..6a5b3936c9 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -1319,7 +1319,6 @@ pub unsafe extern "C" fn rs_http2_tx_get_alstate_progress( #[no_mangle] pub unsafe extern "C" fn rs_http2_getfiles( - _state: *mut std::os::raw::c_void, tx: *mut std::os::raw::c_void, direction: u8, ) -> AppLayerGetFileState { let tx = cast_pointer!(tx, HTTP2Transaction); diff --git a/rust/src/nfs/nfs.rs b/rust/src/nfs/nfs.rs index cb07ef6303..19d8d93cec 100644 --- a/rust/src/nfs/nfs.rs +++ b/rust/src/nfs/nfs.rs @@ -159,7 +159,7 @@ impl NFSTransactionFile { } #[no_mangle] -pub unsafe extern "C" fn rs_nfs_gettxfiles(_state: *mut std::ffi::c_void, tx: *mut std::ffi::c_void, direction: u8) -> AppLayerGetFileState { +pub unsafe extern "C" fn rs_nfs_gettxfiles(tx: *mut std::ffi::c_void, direction: u8) -> AppLayerGetFileState { let tx = cast_pointer!(tx, NFSTransaction); if let Some(NFSTransactionTypeData::FILE(ref mut tdf)) = tx.type_data { let tx_dir : u8 = tdf.direction.into(); diff --git a/rust/src/smb/files.rs b/rust/src/smb/files.rs index b290357428..bdc2619a17 100644 --- a/rust/src/smb/files.rs +++ b/rust/src/smb/files.rs @@ -230,7 +230,7 @@ impl SMBState { use crate::applayer::AppLayerGetFileState; #[no_mangle] -pub unsafe extern "C" fn rs_smb_gettxfiles(_state: *mut std::ffi::c_void, tx: *mut std::ffi::c_void, direction: u8) -> AppLayerGetFileState { +pub unsafe extern "C" fn rs_smb_gettxfiles(tx: *mut std::ffi::c_void, direction: u8) -> AppLayerGetFileState { let tx = cast_pointer!(tx, SMBTransaction); if let Some(SMBTransactionTypeData::FILE(ref mut tdf)) = tx.type_data { let tx_dir : u8 = tdf.direction.into(); diff --git a/src/app-layer-ftp.c b/src/app-layer-ftp.c index 493938959c..36a1018b46 100644 --- a/src/app-layer-ftp.c +++ b/src/app-layer-ftp.c @@ -1216,7 +1216,7 @@ static int FTPDataGetAlstateProgress(void *tx, uint8_t direction) return FTPDATA_STATE_FINISHED; } -static AppLayerGetFileState FTPDataStateGetTxFiles(void *_state, void *tx, uint8_t direction) +static AppLayerGetFileState FTPDataStateGetTxFiles(void *tx, uint8_t direction) { FtpDataState *ftpdata_state = (FtpDataState *)tx; AppLayerGetFileState files = { .fc = NULL, .cfg = &sbcfg }; diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 59ac055c47..50b9901572 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -2637,7 +2637,7 @@ void AppLayerHtpPrintStats(void) * \param direction flow direction * \retval files files ptr */ -static AppLayerGetFileState HTPGetTxFiles(void *state, void *txv, uint8_t direction) +static AppLayerGetFileState HTPGetTxFiles(void *txv, uint8_t direction) { AppLayerGetFileState files = { .fc = NULL, .cfg = &htp_sbcfg }; htp_tx_t *tx = (htp_tx_t *)txv; @@ -6502,7 +6502,7 @@ libhtp:\n\ void *tx_ptr = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, http_state, 0); FAIL_IF_NULL(tx_ptr); - AppLayerGetFileState files = HTPGetTxFiles(http_state, tx_ptr, STREAM_TOCLIENT); + AppLayerGetFileState files = HTPGetTxFiles(tx_ptr, STREAM_TOCLIENT); FileContainer *ffc = files.fc; FAIL_IF_NULL(ffc); diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 428bae864b..1fbb1cd330 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -88,7 +88,7 @@ typedef struct AppLayerParserProtoCtx_ /** get FileContainer reference from the TX. MUST return a non-NULL reference if the TX * has or may have files in the requested direction at some point. */ - AppLayerGetFileState (*GetTxFiles)(void *, void *, uint8_t); + AppLayerGetFileState (*GetTxFiles)(void *, uint8_t); int (*StateGetProgress)(void *alstate, uint8_t direction); uint64_t (*StateGetTxCnt)(void *alstate); @@ -441,8 +441,8 @@ void AppLayerParserRegisterLocalStorageFunc(uint8_t ipproto, AppProto alproto, SCReturn; } -void AppLayerParserRegisterGetTxFilesFunc(uint8_t ipproto, AppProto alproto, - AppLayerGetFileState (*GetTxFiles)(void *, void *, uint8_t)) +void AppLayerParserRegisterGetTxFilesFunc( + uint8_t ipproto, AppProto alproto, AppLayerGetFileState (*GetTxFiles)(void *, uint8_t)) { SCEnter(); @@ -868,13 +868,12 @@ AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint8_t ipproto, AppProto alp SCReturnPtr(ptr, "AppLayerDecoderEvents *"); } -AppLayerGetFileState AppLayerParserGetTxFiles( - const Flow *f, void *state, void *tx, const uint8_t direction) +AppLayerGetFileState AppLayerParserGetTxFiles(const Flow *f, void *tx, const uint8_t direction) { SCEnter(); if (alp_ctx.ctxs[f->protomap][f->alproto].GetTxFiles != NULL) { - return alp_ctx.ctxs[f->protomap][f->alproto].GetTxFiles(state, tx, direction); + return alp_ctx.ctxs[f->protomap][f->alproto].GetTxFiles(tx, direction); } AppLayerGetFileState files = { .fc = NULL, .cfg = NULL }; @@ -884,7 +883,7 @@ AppLayerGetFileState AppLayerParserGetTxFiles( static void AppLayerParserFileTxHousekeeping( const Flow *f, void *tx, const uint8_t pkt_dir, const bool trunc) { - AppLayerGetFileState files = AppLayerParserGetTxFiles(f, FlowGetAppState(f), tx, pkt_dir); + AppLayerGetFileState files = AppLayerParserGetTxFiles(f, tx, pkt_dir); if (files.fc) { FilesPrune(files.fc, files.cfg, trunc); } diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index 8014cb314e..9dbab6701d 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -179,8 +179,8 @@ void AppLayerParserRegisterLocalStorageFunc(uint8_t ipproto, AppProto proto, void *(*LocalStorageAlloc)(void), void (*LocalStorageFree)(void *)); // void AppLayerParserRegisterGetEventsFunc(uint8_t ipproto, AppProto proto, // AppLayerDecoderEvents *(*StateGetEvents)(void *) __attribute__((nonnull))); -void AppLayerParserRegisterGetTxFilesFunc(uint8_t ipproto, AppProto alproto, - AppLayerGetFileState (*GetTxFiles)(void *, void *, uint8_t)); +void AppLayerParserRegisterGetTxFilesFunc( + uint8_t ipproto, AppProto alproto, AppLayerGetFileState (*GetTxFiles)(void *, uint8_t)); void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto); void AppLayerParserRegisterLoggerBits(uint8_t ipproto, AppProto alproto, LoggerId bits); void AppLayerParserRegisterTruncateFunc(uint8_t ipproto, AppProto alproto, @@ -235,8 +235,7 @@ void AppLayerParserSetTransactionInspectId(const Flow *f, AppLayerParserState *p AppLayerDecoderEvents *AppLayerParserGetDecoderEvents(AppLayerParserState *pstate); AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint8_t ipproto, AppProto alproto, void *tx); -AppLayerGetFileState AppLayerParserGetTxFiles( - const Flow *f, void *state, void *tx, const uint8_t direction); +AppLayerGetFileState AppLayerParserGetTxFiles(const Flow *f, void *tx, const uint8_t direction); int AppLayerParserGetStateProgress(uint8_t ipproto, AppProto alproto, void *alstate, uint8_t direction); uint64_t AppLayerParserGetTxCnt(const Flow *, void *alstate); diff --git a/src/app-layer-register.h b/src/app-layer-register.h index b3aa65ac38..eda9628f98 100644 --- a/src/app-layer-register.h +++ b/src/app-layer-register.h @@ -59,7 +59,7 @@ typedef struct AppLayerParser { void *(*LocalStorageAlloc)(void); void (*LocalStorageFree)(void *); - AppLayerGetFileState (*GetTxFiles)(void *, void *, uint8_t); + AppLayerGetFileState (*GetTxFiles)(void *, uint8_t); AppLayerGetTxIterTuple (*GetTxIterator)(const uint8_t ipproto, const AppProto alproto, void *alstate, uint64_t min_tx_id, diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 22976ec393..26f469d933 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -1732,7 +1732,7 @@ static int SMTPStateGetAlstateProgress(void *vtx, uint8_t direction) return tx->done; } -static AppLayerGetFileState SMTPGetTxFiles(void *state, void *txv, uint8_t direction) +static AppLayerGetFileState SMTPGetTxFiles(void *txv, uint8_t direction) { AppLayerGetFileState files = { .fc = NULL, .cfg = &smtp_config.sbcfg }; SMTPTransaction *tx = (SMTPTransaction *)txv; diff --git a/src/detect-engine-file.c b/src/detect-engine-file.c index e7fd9e0c4a..26601ce8a9 100644 --- a/src/detect-engine-file.c +++ b/src/detect-engine-file.c @@ -187,7 +187,7 @@ uint8_t DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx DEBUG_VALIDATE_BUG_ON(f->alstate != alstate); const uint8_t direction = flags & (STREAM_TOSERVER|STREAM_TOCLIENT); - AppLayerGetFileState files = AppLayerParserGetTxFiles(f, alstate, tx, direction); + AppLayerGetFileState files = AppLayerParserGetTxFiles(f, tx, direction); FileContainer *ffc = files.fc; SCLogDebug("tx %p tx_id %" PRIu64 " ffc %p ffc->head %p sid %u", tx, tx_id, ffc, ffc ? ffc->head : NULL, s->id); diff --git a/src/detect-engine-state.c b/src/detect-engine-state.c index 3a9067ce89..e7a3f9fcb3 100644 --- a/src/detect-engine-state.c +++ b/src/detect-engine-state.c @@ -711,7 +711,7 @@ static int DeStateSigTest03(void) SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(!(PacketAlertCheck(p, 1))); - AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); FileContainer *fc = files.fc; FAIL_IF_NULL(fc); @@ -791,7 +791,7 @@ static int DeStateSigTest04(void) HtpTxUserData *tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); FileContainer *fc = files.fc; FAIL_IF_NULL(fc); File *file = fc->head; @@ -866,7 +866,7 @@ static int DeStateSigTest05(void) HtpTxUserData *tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); FileContainer *fc = files.fc; FAIL_IF_NULL(fc); File *file = fc->head; @@ -952,7 +952,7 @@ static int DeStateSigTest06(void) HtpTxUserData *tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); FileContainer *fc = files.fc; FAIL_IF_NULL(fc); File *file = fc->head; @@ -1040,7 +1040,7 @@ static int DeStateSigTest07(void) HtpTxUserData *tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); FileContainer *fc = files.fc; FAIL_IF_NULL(fc); File *file = fc->head; @@ -1139,7 +1139,7 @@ static int DeStateSigTest08(void) HtpTxUserData *tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); FileContainer *fc = files.fc; FAIL_IF_NULL(fc); File *file = fc->head; @@ -1166,7 +1166,7 @@ static int DeStateSigTest08(void) tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); fc = files.fc; FAIL_IF_NULL(fc); file = fc->head; @@ -1267,7 +1267,7 @@ static int DeStateSigTest09(void) HtpTxUserData *tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); FileContainer *fc = files.fc; FAIL_IF_NULL(fc); File *file = fc->head; @@ -1294,7 +1294,7 @@ static int DeStateSigTest09(void) tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); fc = files.fc; FAIL_IF_NULL(fc); file = fc->head; @@ -1393,7 +1393,7 @@ static int DeStateSigTest10(void) HtpTxUserData *tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); FileContainer *fc = files.fc; FAIL_IF_NULL(fc); File *file = fc->head; @@ -1420,7 +1420,7 @@ static int DeStateSigTest10(void) tx_ud = htp_tx_get_user_data(tx); FAIL_IF_NULL(tx_ud); - files = AppLayerParserGetTxFiles(p->flow, http_state, tx, STREAM_TOSERVER); + files = AppLayerParserGetTxFiles(p->flow, tx, STREAM_TOSERVER); fc = files.fc; FAIL_IF_NULL(fc); file = fc->head; diff --git a/src/detect-file-data.c b/src/detect-file-data.c index 533fc8441d..312e3aaac8 100644 --- a/src/detect-file-data.c +++ b/src/detect-file-data.c @@ -395,7 +395,7 @@ uint8_t DetectEngineInspectFiledata(DetectEngineCtx *de_ctx, DetectEngineThreadC transforms = engine->v2.transforms; } - AppLayerGetFileState files = AppLayerParserGetTxFiles(f, alstate, txv, flags); + AppLayerGetFileState files = AppLayerParserGetTxFiles(f, txv, flags); FileContainer *ffc = files.fc; if (ffc == NULL) { return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH_FILES; @@ -448,7 +448,7 @@ static void PrefilterTxFiledata(DetectEngineThreadCtx *det_ctx, const void *pect const MpmCtx *mpm_ctx = ctx->mpm_ctx; const int list_id = ctx->list_id; - AppLayerGetFileState files = AppLayerParserGetTxFiles(f, f->alstate, txv, flags); + AppLayerGetFileState files = AppLayerParserGetTxFiles(f, txv, flags); FileContainer *ffc = files.fc; if (ffc != NULL) { int local_file_id = 0; diff --git a/src/detect-filemagic.c b/src/detect-filemagic.c index bf2a1fc8ac..f23434d866 100644 --- a/src/detect-filemagic.c +++ b/src/detect-filemagic.c @@ -305,7 +305,7 @@ static uint8_t DetectEngineInspectFilemagic(DetectEngineCtx *de_ctx, DetectEngin transforms = engine->v2.transforms; } - AppLayerGetFileState files = AppLayerParserGetTxFiles(f, alstate, txv, flags); + AppLayerGetFileState files = AppLayerParserGetTxFiles(f, txv, flags); FileContainer *ffc = files.fc; if (ffc == NULL) { return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH_FILES; @@ -358,7 +358,7 @@ static void PrefilterTxFilemagic(DetectEngineThreadCtx *det_ctx, const void *pec const MpmCtx *mpm_ctx = ctx->mpm_ctx; const int list_id = ctx->list_id; - AppLayerGetFileState files = AppLayerParserGetTxFiles(f, f->alstate, txv, flags); + AppLayerGetFileState files = AppLayerParserGetTxFiles(f, txv, flags); FileContainer *ffc = files.fc; if (ffc != NULL) { int local_file_id = 0; diff --git a/src/detect-filename.c b/src/detect-filename.c index d8fcd351fc..f75fdbd680 100644 --- a/src/detect-filename.c +++ b/src/detect-filename.c @@ -242,7 +242,7 @@ static uint8_t DetectEngineInspectFilename(DetectEngineCtx *de_ctx, DetectEngine transforms = engine->v2.transforms; } - AppLayerGetFileState files = AppLayerParserGetTxFiles(f, alstate, txv, flags); + AppLayerGetFileState files = AppLayerParserGetTxFiles(f, txv, flags); FileContainer *ffc = files.fc; if (ffc == NULL) { return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH_FILES; @@ -295,7 +295,7 @@ static void PrefilterTxFilename(DetectEngineThreadCtx *det_ctx, const void *pect const MpmCtx *mpm_ctx = ctx->mpm_ctx; const int list_id = ctx->list_id; - AppLayerGetFileState files = AppLayerParserGetTxFiles(f, f->alstate, txv, flags); + AppLayerGetFileState files = AppLayerParserGetTxFiles(f, txv, flags); FileContainer *ffc = files.fc; if (ffc != NULL) { int local_file_id = 0; diff --git a/src/detect-filestore.c b/src/detect-filestore.c index fa8492161e..e93dcceabd 100644 --- a/src/detect-filestore.c +++ b/src/detect-filestore.c @@ -237,7 +237,7 @@ static int DetectFilestorePostMatch(DetectEngineThreadCtx *det_ctx, p->flow->proto, p->flow->alproto, alstate, det_ctx->filestore[u].tx_id); DEBUG_VALIDATE_BUG_ON(txv == NULL); if (txv) { - AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, alstate, txv, flags); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, txv, flags); FileContainer *ffc_tx = files.fc; DEBUG_VALIDATE_BUG_ON(ffc_tx == NULL); if (ffc_tx) { diff --git a/src/output-json-alert.c b/src/output-json-alert.c index ae2a7fc620..f7fc322bb3 100644 --- a/src/output-json-alert.c +++ b/src/output-json-alert.c @@ -394,8 +394,7 @@ static void AlertAddFiles(const Packet *p, JsonBuilder *jb, const uint64_t tx_id if (p->flow->alstate != NULL) { void *tx = AppLayerParserGetTx(p->flow->proto, p->flow->alproto, p->flow->alstate, tx_id); if (tx) { - AppLayerGetFileState files = - AppLayerParserGetTxFiles(p->flow, p->flow->alstate, tx, direction); + AppLayerGetFileState files = AppLayerParserGetTxFiles(p->flow, tx, direction); ffc = files.fc; } } diff --git a/src/output-tx.c b/src/output-tx.c index 7585d37a55..671829fb75 100644 --- a/src/output-tx.c +++ b/src/output-tx.c @@ -167,11 +167,9 @@ static inline void OutputTxLogFiles(ThreadVars *tv, OutputFileLoggerThreadData * opposing_dir == STREAM_TOSERVER ? "TOSERVER" : "TOCLIENT", packet_dir_ready, opposing_dir_ready); - AppLayerGetFileState app_files = - AppLayerParserGetTxFiles(f, FlowGetAppState(f), tx, packet_dir); + AppLayerGetFileState app_files = AppLayerParserGetTxFiles(f, tx, packet_dir); FileContainer *ffc = app_files.fc; - AppLayerGetFileState app_files_opposing = - AppLayerParserGetTxFiles(f, FlowGetAppState(f), tx, opposing_dir); + AppLayerGetFileState app_files_opposing = AppLayerParserGetTxFiles(f, tx, opposing_dir); FileContainer *ffc_opposing = app_files_opposing.fc; /* see if opposing side is finished: if no file support in this direction, of is not