return 0;
}
-static void DNP3SetTxLogged(void *alstate, void *vtx, LoggerId logged)
+static AppLayerTxData *DNP3GetTxData(void *vtx)
{
DNP3Transaction *tx = (DNP3Transaction *)vtx;
- tx->logged = logged;
-}
-
-static LoggerId DNP3GetTxLogged(void *alstate, void *vtx)
-{
- DNP3Transaction *tx = (DNP3Transaction *)vtx;
- return tx->logged;
+ return &tx->tx_data;
}
/**
}
}
-static uint64_t DNP3GetTxDetectFlags(void *vtx, uint8_t dir)
-{
- DNP3Transaction *tx = (DNP3Transaction *)vtx;
- if (dir & STREAM_TOSERVER) {
- return tx->detect_flags_ts;
- } else {
- return tx->detect_flags_tc;
- }
-}
-
-static void DNP3SetTxDetectFlags(void *vtx, uint8_t dir, uint64_t detect_flags)
-{
- DNP3Transaction *tx = (DNP3Transaction *)vtx;
- if (dir & STREAM_TOSERVER) {
- tx->detect_flags_ts = detect_flags;
- } else {
- tx->detect_flags_tc = detect_flags;
- }
- return;
-}
-
/**
* \brief Register the DNP3 application protocol parser.
*/
DNP3GetEvents);
AppLayerParserRegisterDetectStateFuncs(IPPROTO_TCP, ALPROTO_DNP3,
DNP3GetTxDetectState, DNP3SetTxDetectState);
- AppLayerParserRegisterDetectFlagsFuncs(IPPROTO_TCP, ALPROTO_DNP3,
- DNP3GetTxDetectFlags, DNP3SetTxDetectFlags);
AppLayerParserRegisterGetTx(IPPROTO_TCP, ALPROTO_DNP3, DNP3GetTx);
AppLayerParserRegisterGetTxCnt(IPPROTO_TCP, ALPROTO_DNP3, DNP3GetTxCnt);
AppLayerParserRegisterGetEventInfoById(IPPROTO_TCP, ALPROTO_DNP3,
DNP3StateGetEventInfoById);
- AppLayerParserRegisterLoggerFuncs(IPPROTO_TCP, ALPROTO_DNP3,
- DNP3GetTxLogged, DNP3SetTxLogged);
+ AppLayerParserRegisterTxDataFunc(IPPROTO_TCP, ALPROTO_DNP3,
+ DNP3GetTxData);
}
else {
SCLogConfig("Parser disabled for protocol %s. "
#include "detect-engine-state.h"
#include "util-hashlist.h"
#include "util-byte.h"
+#include "rust.h"
/**
* The maximum size of a DNP3 link PDU.
* \brief DNP3 transaction.
*/
typedef struct DNP3Transaction_ {
- /** detection engine flags */
- uint64_t detect_flags_ts;
- uint64_t detect_flags_tc;
+ AppLayerTxData tx_data;
uint64_t tx_num; /**< Internal transaction ID. */
- uint32_t logged; /**< Flags indicating which loggers have logged this tx. */
struct DNP3State_ *dnp3;