app-layer: method to see if parser supports tx detect flags

Add method to check if a parser for an app-layer protocol
supports tx detect flags.

This is a bit of a hack for now as where we need to run
this check from we do not have the IP protocol.
pull/4405/head
Jason Ish 6 years ago
parent 3887f8d1f3
commit 739df21e2d

@ -1149,6 +1149,17 @@ int AppLayerParserSetTxDetectState(const Flow *f,
SCReturnInt(r);
}
bool AppLayerParserSupportsTxDetectFlags(AppProto alproto)
{
SCEnter();
for (uint8_t p = 0; p < FLOW_PROTO_APPLAYER_MAX; p++) {
if (alp_ctx.ctxs[p][alproto].GetTxDetectFlags != NULL) {
SCReturnBool(true);
}
}
SCReturnBool(false);
}
uint64_t AppLayerParserGetTxDetectFlags(uint8_t ipproto, AppProto alproto, void *tx, uint8_t dir)
{
SCEnter();

@ -227,6 +227,7 @@ int AppLayerParserSetTxDetectState(const Flow *f, void *tx, DetectEngineState *s
uint64_t AppLayerParserGetTxDetectFlags(uint8_t ipproto, AppProto alproto, void *tx, uint8_t dir);
void AppLayerParserSetTxDetectFlags(uint8_t ipproto, AppProto alproto, void *tx, uint8_t dir, uint64_t);
bool AppLayerParserSupportsTxDetectFlags(AppProto alproto);
/***** General *****/

Loading…
Cancel
Save