#include "runmodes.h"
+static GetActiveTxIdFunc AppLayerGetActiveTxIdFuncPtr = NULL;
+
struct AppLayerParserThreadCtx_ {
void *alproto_local_storage[FLOW_PROTO_MAX][ALPROTO_MAX];
};
memset(&alp_ctx, 0, sizeof(alp_ctx));
+ /* set the default tx handler if none was set explicitly */
+ if (AppLayerGetActiveTxIdFuncPtr == NULL) {
+ RegisterAppLayerGetActiveTxIdFunc(AppLayerTransactionGetActiveDetectLog);
+ }
+
SCReturnInt(0);
}
SCReturnPtr(ptr, "FileContainer *");
}
-/**
- * \brief Get 'active' tx id, meaning the lowest id that still need work.
+/** \brief active TX retrieval for normal ops: so with detection and logging
*
- * \retval id tx id
- */
-static uint64_t AppLayerTransactionGetActive(Flow *f, uint8_t flags) {
+ * \retval tx_id lowest tx_id that still needs work */
+uint64_t AppLayerTransactionGetActiveDetectLog(Flow *f, uint8_t flags) {
AppLayerParserProtoCtx *p = &alp_ctx.ctxs[FlowGetProtoMapping(f->proto)][f->alproto];
uint64_t log_id = f->alparser->log_id;
uint64_t inspect_id = f->alparser->inspect_id[flags & STREAM_TOSERVER ? 0 : 1];
}
}
+void RegisterAppLayerGetActiveTxIdFunc(GetActiveTxIdFunc FuncPtr) {
+ BUG_ON(AppLayerGetActiveTxIdFuncPtr != NULL);
+ AppLayerGetActiveTxIdFuncPtr = FuncPtr;
+}
+
+/**
+ * \brief Get 'active' tx id, meaning the lowest id that still need work.
+ *
+ * \retval id tx id
+ */
+static uint64_t AppLayerTransactionGetActive(Flow *f, uint8_t flags) {
+ BUG_ON(AppLayerGetActiveTxIdFuncPtr == NULL);
+
+ return AppLayerGetActiveTxIdFuncPtr(f, flags);
+}
+
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
SCEnter();
SCReturnInt(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
StateGetProgressCompletionStatus(direction));
-
}
int AppLayerParserGetEventInfo(uint8_t ipproto, AppProto alproto, const char *event_name,
#define APP_LAYER_PARSER_NO_INSPECTION 0x02
#define APP_LAYER_PARSER_NO_REASSEMBLY 0x04
+
+
+/***** transaction handling *****/
+
+/** \brief Function ptr type for getting active TxId from a flow
+ * Used by AppLayerTransactionGetActive.
+ */
+typedef uint64_t (*GetActiveTxIdFunc)(Flow *f, uint8_t flags);
+
+/** \brief Register GetActiveTxId Function
+ *
+ */
+void RegisterAppLayerGetActiveTxIdFunc(GetActiveTxIdFunc FuncPtr);
+
+/** \brief active TX retrieval for normal ops: so with detection and logging
+ *
+ * \retval tx_id lowest tx_id that still needs work
+ *
+ * This is the default function.
+ */
+uint64_t AppLayerTransactionGetActiveDetectLog(Flow *f, uint8_t flags);
+
int AppLayerParserSetup(void);
int AppLayerParserDeSetup(void);