}
void AppLayerParserSetTransactionInspectId(AppLayerParserState *pstate,
- uint8_t ipproto, AppProto alproto, void *alstate,
- uint8_t direction)
+ const uint8_t ipproto, const AppProto alproto,
+ void *alstate, const uint8_t flags)
{
SCEnter();
- uint8_t dir = (direction & STREAM_TOSERVER) ? 0 : 1;
+ int direction = (flags & STREAM_TOSERVER) ? 0 : 1;
uint64_t total_txs = AppLayerParserGetTxCnt(ipproto, alproto, alstate);
- uint64_t idx = AppLayerParserGetTransactionInspectId(pstate, direction);
- int state_done_progress = AppLayerParserGetStateProgressCompletionStatus(ipproto, alproto, direction);
+ uint64_t idx = AppLayerParserGetTransactionInspectId(pstate, flags);
+ int state_done_progress = AppLayerParserGetStateProgressCompletionStatus(ipproto, alproto, flags);
void *tx;
int state_progress;
tx = AppLayerParserGetTx(ipproto, alproto, alstate, idx);
if (tx == NULL)
continue;
- state_progress = AppLayerParserGetStateProgress(ipproto, alproto, tx, direction);
+ state_progress = AppLayerParserGetStateProgress(ipproto, alproto, tx, flags);
if (state_progress >= state_done_progress)
continue;
else
break;
}
- pstate->inspect_id[dir] = idx;
+ pstate->inspect_id[direction] = idx;
SCReturn;
}
void AppLayerParserSetTransactionLogId(AppLayerParserState *pstate);
uint64_t AppLayerParserGetTransactionInspectId(AppLayerParserState *pstate, uint8_t direction);
void AppLayerParserSetTransactionInspectId(AppLayerParserState *pstate,
- uint8_t ipproto, AppProto alproto, void *alstate,
- uint8_t direction);
+ const uint8_t ipproto, const AppProto alproto, void *alstate,
+ const uint8_t flags);
AppLayerDecoderEvents *AppLayerParserGetDecoderEvents(AppLayerParserState *pstate);
void AppLayerParserSetDecoderEvents(AppLayerParserState *pstate, AppLayerDecoderEvents *devents);
AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint8_t ipproto, AppProto alproto, void *alstate,
return;
}
/** \brief update flow's inspection id's
+ *
+ * \param f unlocked flow
+ * \param flags direction and disruption flags
*
* \note it is possible that f->alstate, f->alparser are NULL */
-void DeStateUpdateInspectTransactionId(Flow *f, uint8_t direction)
+void DeStateUpdateInspectTransactionId(Flow *f, const uint8_t flags)
{
FLOWLOCK_WRLOCK(f);
if (f->alparser && f->alstate) {
- AppLayerParserSetTransactionInspectId(f->alparser, f->proto, f->alproto, f->alstate, direction);
+ AppLayerParserSetTransactionInspectId(f->alparser, f->proto,
+ f->alproto, f->alstate, flags);
}
FLOWLOCK_UNLOCK(f);
/**
* \brief Update the inspect id.
*
- * \param f Flow(unlocked).
- * \param direction 0 for to server, 1 for toclient.
+ * \param f unlocked flow
+ * \param flags direction and disruption flags
*/
-void DeStateUpdateInspectTransactionId(Flow *f, uint8_t direction);
+void DeStateUpdateInspectTransactionId(Flow *f, const uint8_t flags);
/**
* \brief Reset a DetectEngineState state.