app-layer: all protocols are tx aware now

So remove the runtime check for it.
pull/4532/head
Victor Julien 7 years ago
parent 1262ecbde0
commit d369e54f1d

@ -1341,10 +1341,10 @@ bool AppLayerParserHasDecoderEvents(AppLayerParserState *pstate)
return false;
}
/** \brief simpler way to globally test if a alproto is registered
/** \brief simple way to globally test if a alproto is registered
* and fully enabled in the configuration.
*/
int AppLayerParserIsTxAware(AppProto alproto)
int AppLayerParserIsEnabled(AppProto alproto)
{
return (alp_ctx.ctxs[FLOW_PROTO_DEFAULT][alproto]
.StateGetProgressCompletionStatus != NULL);

@ -230,7 +230,6 @@ int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *tctx, Flow *f,
uint8_t flags, const uint8_t *input, uint32_t input_len);
void AppLayerParserSetEOF(AppLayerParserState *pstate);
bool AppLayerParserHasDecoderEvents(AppLayerParserState *pstate);
int AppLayerParserIsTxAware(AppProto alproto);
int AppLayerParserProtocolIsTxEventAware(uint8_t ipproto, AppProto alproto);
int AppLayerParserProtocolHasLogger(uint8_t ipproto, AppProto alproto);
LoggerId AppLayerParserProtocolGetLoggerBits(uint8_t ipproto, AppProto alproto);
@ -238,6 +237,7 @@ void AppLayerParserTriggerRawStreamReassembly(Flow *f, int direction);
void AppLayerParserSetStreamDepth(uint8_t ipproto, AppProto alproto, uint32_t stream_depth);
uint32_t AppLayerParserGetStreamDepth(const Flow *f);
void AppLayerParserSetStreamDepthFlag(uint8_t ipproto, AppProto alproto, void *state, uint64_t tx_id, uint8_t flags);
int AppLayerParserIsEnabled(AppProto alproto);
/***** Cleanup *****/

@ -171,7 +171,7 @@ void DetectAppLayerInspectEngineRegister(const char *name,
AppProto alproto, uint32_t dir,
int progress, InspectEngineFuncPtr Callback)
{
if (AppLayerParserIsTxAware(alproto)) {
if (AppLayerParserIsEnabled(alproto)) {
if (!AppLayerParserSupportsTxDetectFlags(alproto)) {
FatalError(SC_ERR_INITIALIZATION,
"Inspect engine registered for app-layer protocol without "

@ -72,12 +72,11 @@ int OutputRegisterTxLogger(LoggerId id, const char *name, AppProto alproto,
ThreadDeinitFunc ThreadDeinit,
void (*ThreadExitPrintStats)(ThreadVars *, void *))
{
if (alproto != ALPROTO_UNKNOWN && !(AppLayerParserIsTxAware(alproto))) {
if (alproto != ALPROTO_UNKNOWN && !(AppLayerParserIsEnabled(alproto))) {
SCLogNotice("%s logger not enabled: protocol %s is disabled",
name, AppProtoToString(alproto));
return -1;
}
OutputTxLogger *op = SCMalloc(sizeof(*op));
if (op == NULL)
return -1;

Loading…
Cancel
Save