app-layer: use bool for 'HasDecoderEvents'

pull/3108/head
Victor Julien 8 years ago
parent aac15854b4
commit 948dee9a98

@ -1130,9 +1130,9 @@ void AppLayerParserSetEOF(AppLayerParserState *pstate)
SCReturn;
}
int AppLayerParserHasDecoderEvents(const Flow *f,
void *alstate, AppLayerParserState *pstate,
uint8_t flags)
bool AppLayerParserHasDecoderEvents(const Flow *f,
void *alstate, AppLayerParserState *pstate,
const uint8_t flags)
{
SCEnter();
@ -1169,9 +1169,9 @@ int AppLayerParserHasDecoderEvents(const Flow *f,
/* if we have reached here, we don't have events */
not_present:
SCReturnInt(0);
return false;
present:
SCReturnInt(1);
return true;
}
/** \brief simpler way to globally test if a alproto is registered

@ -218,8 +218,8 @@ int AppLayerParserSetTxMpmIDs(uint8_t ipproto, AppProto alproto, void *tx, uint6
int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *tctx, Flow *f, AppProto alproto,
uint8_t flags, uint8_t *input, uint32_t input_len);
void AppLayerParserSetEOF(AppLayerParserState *pstate);
int AppLayerParserHasDecoderEvents(const Flow *f, void *alstate, AppLayerParserState *pstate,
uint8_t flags);
bool AppLayerParserHasDecoderEvents(const Flow *f, void *alstate, AppLayerParserState *pstate,
const uint8_t flags);
int AppLayerParserIsTxAware(AppProto alproto);
int AppLayerParserProtocolIsTxAware(uint8_t ipproto, AppProto alproto);
int AppLayerParserProtocolIsTxEventAware(uint8_t ipproto, AppProto alproto);

@ -403,7 +403,7 @@ deonly:
*/
void
PacketCreateMask(Packet *p, SignatureMask *mask, AppProto alproto,
bool has_state, int app_decoder_events)
bool has_state, bool app_decoder_events)
{
if (!(p->flags & PKT_NOPAYLOAD_INSPECTION) && p->payload_len > 0) {
SCLogDebug("packet has payload");

@ -19,7 +19,7 @@
#define __DETECT_ENGINE_BUILD_H__
void PacketCreateMask(Packet *p, SignatureMask *mask, AppProto alproto,
bool has_state, int app_decoder_events);
bool has_state, bool app_decoder_events);
int SignatureIsFilestoring(const Signature *);
int SignatureIsFilemagicInspecting(const Signature *);

@ -418,7 +418,7 @@ void SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineT
const Signature *s = NULL;
const Signature *next_s = NULL;
int state_alert = 0;
int app_decoder_events = 0;
bool app_decoder_events = false;
bool has_state = false; /* do we have an alstate to work with? */
SCEnter();

Loading…
Cancel
Save