if (unlikely(p->StateTransactionFree == NULL))
SCReturn;
- const bool has_tx_detect_flags = (p->GetTxData != NULL && !g_detect_disabled);
+ const bool has_tx_detect_flags = !g_detect_disabled;
const uint8_t ipproto = f->proto;
const AppProto alproto = f->alproto;
void * const alstate = f->alstate;
return FALSE;
}
-int AppLayerParserSupportsTxDetectState(uint8_t ipproto, AppProto alproto)
-{
- if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxDetectState != NULL)
- return TRUE;
- return FALSE;
-}
-
DetectEngineState *AppLayerParserGetTxDetectState(uint8_t ipproto, AppProto alproto, void *tx)
{
SCEnter();
int AppLayerParserSetTxDetectState(const Flow *f,
void *tx, DetectEngineState *s)
{
- int r;
SCEnter();
- if ((alp_ctx.ctxs[f->protomap][f->alproto].GetTxDetectState(tx) != NULL))
- SCReturnInt(-EBUSY);
- r = alp_ctx.ctxs[f->protomap][f->alproto].SetTxDetectState(tx, s);
+ int r = alp_ctx.ctxs[f->protomap][f->alproto].SetTxDetectState(tx, s);
SCReturnInt(r);
}
-bool AppLayerParserSupportsTxDetectFlags(AppProto alproto)
-{
- SCEnter();
- for (uint8_t p = 0; p < FLOW_PROTO_APPLAYER_MAX; p++) {
- if (alp_ctx.ctxs[p][alproto].GetTxData != NULL) {
- SCReturnBool(true);
- }
- }
- SCReturnBool(false);
-}
-
AppLayerTxData *AppLayerParserGetTxData(uint8_t ipproto, AppProto alproto, void *tx)
{
SCEnter();
- if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxData) {
- AppLayerTxData *d = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxData(tx);
- SCReturnPtr(d, "AppLayerTxData");
- }
- SCReturnPtr(NULL, "AppLayerTxData");
+ AppLayerTxData *d = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxData(tx);
+ SCReturnPtr(d, "AppLayerTxData");
}
void AppLayerParserApplyTxConfig(uint8_t ipproto, AppProto alproto,
if (!(BOTH_SET(ctx->GetTxDetectState, ctx->SetTxDetectState))) {
goto bad;
}
- if (!(BOTH_SET_OR_BOTH_UNSET(ctx->GetTxDetectState, ctx->SetTxDetectState))) {
- goto bad;
- }
if (ctx->GetTxData == NULL) {
goto bad;
}
uint8_t AppLayerParserGetFirstDataDir(uint8_t ipproto, AppProto alproto);
int AppLayerParserSupportsFiles(uint8_t ipproto, AppProto alproto);
-int AppLayerParserSupportsTxDetectState(uint8_t ipproto, AppProto alproto);
int AppLayerParserHasTxDetectState(uint8_t ipproto, AppProto alproto, void *alstate);
DetectEngineState *AppLayerParserGetTxDetectState(uint8_t ipproto, AppProto alproto, void *tx);
int AppLayerParserSetTxDetectState(const Flow *f, void *tx, DetectEngineState *s);
-bool AppLayerParserSupportsTxDetectFlags(AppProto alproto);
-
AppLayerTxData *AppLayerParserGetTxData(uint8_t ipproto, AppProto alproto, void *tx);
void AppLayerParserApplyTxConfig(uint8_t ipproto, AppProto alproto,
void *state, void *tx, enum ConfigAction mode, AppLayerTxConfig);