general: Convert _Bool to bool

This commit addresses task 3167 and changes usages of '_Bool` to `bool`.
The latter is included from `suricata-common.h`
pull/4568/head
Jeff Lucovsky 7 years ago committed by Victor Julien
parent 3385859176
commit be4c6b85de

@ -213,11 +213,11 @@ typedef struct IPV6GenOptHdr_
typedef struct IPV6ExtHdrs_
{
_Bool rh_set;
bool rh_set;
uint8_t rh_type;
_Bool fh_set;
_Bool fh_more_frags_set;
bool fh_set;
bool fh_more_frags_set;
uint8_t fh_nh;
uint8_t fh_prev_nh;

@ -153,7 +153,7 @@ typedef struct TCPHdr_
typedef struct TCPVars_
{
/* commonly used and needed opts */
_Bool ts_set;
bool ts_set;
uint32_t ts_val; /* host-order */
uint32_t ts_ecr; /* host-order */
TCPOpt sack;

@ -111,7 +111,7 @@ static DetectAppLayerProtocolData *DetectAppLayerProtocolParse(const char *arg,
return data;
}
static _Bool HasConflicts(const DetectAppLayerProtocolData *us,
static bool HasConflicts(const DetectAppLayerProtocolData *us,
const DetectAppLayerProtocolData *them)
{
/* mixing negated and non negated is illegal */
@ -228,7 +228,7 @@ PrefilterPacketAppProtoSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u8[2] = (uint8_t)a->negated;
}
static _Bool
static bool
PrefilterPacketAppProtoCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectAppLayerProtocolData *a = smctx;
@ -246,7 +246,7 @@ static int PrefilterSetupAppProto(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketAppProtoMatch);
}
static _Bool PrefilterAppProtoIsPrefilterable(const Signature *s)
static bool PrefilterAppProtoIsPrefilterable(const Signature *s)
{
if (s->flags & SIG_FLAG_PDONLY) {
SCLogDebug("prefilter on PD %u", s->id);

@ -374,7 +374,7 @@ void DetectContentFree(void *ptr)
* \retval 1 valid
* \retval 0 invalid
*/
_Bool DetectContentPMATCHValidateCallback(const Signature *s)
bool DetectContentPMATCHValidateCallback(const Signature *s)
{
if (!(s->flags & SIG_FLAG_DSIZE)) {
return TRUE;

@ -120,7 +120,7 @@ int DetectContentSetup(DetectEngineCtx *de_ctx, Signature *s, const char *conten
void DetectContentPrint(DetectContentData *);
void DetectContentFree(void *);
_Bool DetectContentPMATCHValidateCallback(const Signature *s);
bool DetectContentPMATCHValidateCallback(const Signature *s);
void DetectContentPropagateLimits(Signature *s);
#endif /* __DETECT_CONTENT_H__ */

@ -57,7 +57,7 @@ static void DsizeRegisterTests(void);
static void DetectDsizeFree(void *);
static int PrefilterSetupDsize(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterDsizeIsPrefilterable(const Signature *s);
static bool PrefilterDsizeIsPrefilterable(const Signature *s);
/**
* \brief Registration function for dsize: keyword
@ -343,7 +343,7 @@ PrefilterPacketDsizeSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u16[2] = a->dsize2;
}
static _Bool
static bool
PrefilterPacketDsizeCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectDsizeData *a = smctx;
@ -362,7 +362,7 @@ static int PrefilterSetupDsize(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketDsizeMatch);
}
static _Bool PrefilterDsizeIsPrefilterable(const Signature *s)
static bool PrefilterDsizeIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -95,7 +95,7 @@ static void GetExtraMatch(const Signature *s, uint16_t *type, uint16_t *value)
static int
SetupEngineForPacketHeader(DetectEngineCtx *de_ctx, SigGroupHead *sgh,
int sm_type, PrefilterPacketHeaderHashCtx *hctx,
_Bool (*Compare)(PrefilterPacketHeaderValue v, void *),
bool (*Compare)(PrefilterPacketHeaderValue v, void *),
void (*Match)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx))
{
Signature *s = NULL;
@ -200,7 +200,7 @@ static int
SetupEngineForPacketHeaderPrefilterPacketU8HashCtx(DetectEngineCtx *de_ctx,
SigGroupHead *sgh, int sm_type, uint32_t *counts,
void (*Set)(PrefilterPacketHeaderValue *v, void *),
_Bool (*Compare)(PrefilterPacketHeaderValue v, void *),
bool (*Compare)(PrefilterPacketHeaderValue v, void *),
void (*Match)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx))
{
Signature *s = NULL;
@ -254,7 +254,7 @@ SetupEngineForPacketHeaderPrefilterPacketU8HashCtx(DetectEngineCtx *de_ctx,
*/
static void SetupSingle(DetectEngineCtx *de_ctx, HashListTable *hash_table,
SigGroupHead *sgh, int sm_type,
_Bool (*Compare)(PrefilterPacketHeaderValue v, void *),
bool (*Compare)(PrefilterPacketHeaderValue v, void *),
void (*Match)(DetectEngineThreadCtx *det_ctx,
Packet *p, const void *pectx))
{
@ -273,7 +273,7 @@ static void SetupSingle(DetectEngineCtx *de_ctx, HashListTable *hash_table,
static void SetupU8Hash(DetectEngineCtx *de_ctx, HashListTable *hash_table,
SigGroupHead *sgh, int sm_type,
void (*Set)(PrefilterPacketHeaderValue *v, void *),
_Bool (*Compare)(PrefilterPacketHeaderValue v, void *),
bool (*Compare)(PrefilterPacketHeaderValue v, void *),
void (*Match)(DetectEngineThreadCtx *det_ctx,
Packet *p, const void *pectx))
{
@ -325,10 +325,10 @@ static void SetupU8Hash(DetectEngineCtx *de_ctx, HashListTable *hash_table,
static int PrefilterSetupPacketHeaderCommon(DetectEngineCtx *de_ctx,
SigGroupHead *sgh, int sm_type,
void (*Set)(PrefilterPacketHeaderValue *v, void *),
_Bool (*Compare)(PrefilterPacketHeaderValue v, void *),
bool (*Compare)(PrefilterPacketHeaderValue v, void *),
void (*Match)(DetectEngineThreadCtx *det_ctx,
Packet *p, const void *pectx),
_Bool u8hash)
bool u8hash)
{
Signature *s = NULL;
uint32_t sig = 0;
@ -395,7 +395,7 @@ error:
int PrefilterSetupPacketHeaderU8Hash(DetectEngineCtx *de_ctx,
SigGroupHead *sgh, int sm_type,
void (*Set)(PrefilterPacketHeaderValue *v, void *),
_Bool (*Compare)(PrefilterPacketHeaderValue v, void *),
bool (*Compare)(PrefilterPacketHeaderValue v, void *),
void (*Match)(DetectEngineThreadCtx *det_ctx,
Packet *p, const void *pectx))
{
@ -406,7 +406,7 @@ int PrefilterSetupPacketHeaderU8Hash(DetectEngineCtx *de_ctx,
int PrefilterSetupPacketHeader(DetectEngineCtx *de_ctx,
SigGroupHead *sgh, int sm_type,
void (*Set)(PrefilterPacketHeaderValue *v, void *),
_Bool (*Compare)(PrefilterPacketHeaderValue v, void *),
bool (*Compare)(PrefilterPacketHeaderValue v, void *),
void (*Match)(DetectEngineThreadCtx *det_ctx,
Packet *p, const void *pectx))
{

@ -59,18 +59,18 @@ typedef struct PrefilterPacketU8HashCtx_ {
int PrefilterSetupPacketHeader(DetectEngineCtx *de_ctx,
SigGroupHead *sgh, int sm_type,
void (*Set)(PrefilterPacketHeaderValue *v, void *),
_Bool (*Compare)(PrefilterPacketHeaderValue v, void *),
bool (*Compare)(PrefilterPacketHeaderValue v, void *),
void (*Match)(DetectEngineThreadCtx *det_ctx,
Packet *p, const void *pectx));
int PrefilterSetupPacketHeaderU8Hash(DetectEngineCtx *de_ctx,
SigGroupHead *sgh, int sm_type,
void (*Set)(PrefilterPacketHeaderValue *v, void *),
_Bool (*Compare)(PrefilterPacketHeaderValue v, void *),
bool (*Compare)(PrefilterPacketHeaderValue v, void *),
void (*Match)(DetectEngineThreadCtx *det_ctx,
Packet *p, const void *pectx));
static inline _Bool
static inline bool
PrefilterPacketHeaderExtraMatch(const PrefilterPacketHeaderCtx *ctx,
const Packet *p)
{

@ -950,7 +950,7 @@ void DetectBufferRunSetupCallback(const DetectEngineCtx *de_ctx,
}
void DetectBufferTypeRegisterValidateCallback(const char *name,
_Bool (*ValidateCallback)(const Signature *, const char **sigerror))
bool (*ValidateCallback)(const Signature *, const char **sigerror))
{
BUG_ON(g_buffer_type_reg_closed);
DetectBufferTypeRegister(name);

@ -52,7 +52,7 @@ const char *DetectBufferTypeGetDescriptionByName(const char *name);
void DetectBufferTypeRegisterSetupCallback(const char *name,
void (*Callback)(const DetectEngineCtx *, Signature *));
void DetectBufferTypeRegisterValidateCallback(const char *name,
_Bool (*ValidateCallback)(const Signature *, const char **sigerror));
bool (*ValidateCallback)(const Signature *, const char **sigerror));
int DetectBufferTypeGetByIdTransforms(DetectEngineCtx *de_ctx, const int id,
int *transforms, int transform_cnt);

@ -56,7 +56,7 @@ void DetectFlowRegisterTests(void);
void DetectFlowFree(void *);
static int PrefilterSetupFlow(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterFlowIsPrefilterable(const Signature *s);
static bool PrefilterFlowIsPrefilterable(const Signature *s);
/**
* \brief Registration function for flow: keyword
@ -446,7 +446,7 @@ PrefilterPacketFlowSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u8[1] = fb->match_cnt;
}
static _Bool
static bool
PrefilterPacketFlowCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectFlowData *fb = smctx;
@ -466,7 +466,7 @@ static int PrefilterSetupFlow(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketFlowMatch);
}
static _Bool PrefilterFlowIsPrefilterable(const Signature *s)
static bool PrefilterFlowIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -74,7 +74,7 @@ static int DetectFragBitsSetup (DetectEngineCtx *, Signature *, const char *);
static void DetectFragBitsFree(void *);
static int PrefilterSetupFragBits(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterFragBitsIsPrefilterable(const Signature *s);
static bool PrefilterFragBitsIsPrefilterable(const Signature *s);
/**
* \brief Registration function for fragbits: keyword
@ -346,7 +346,7 @@ PrefilterPacketFragBitsSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u8[1] = fb->fragbits;
}
static _Bool
static bool
PrefilterPacketFragBitsCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectFragBitsData *fb = smctx;
@ -366,7 +366,7 @@ static int PrefilterSetupFragBits(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketFragBitsMatch);
}
static _Bool PrefilterFragBitsIsPrefilterable(const Signature *s)
static bool PrefilterFragBitsIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -51,7 +51,7 @@ void DetectFragOffsetRegisterTests(void);
void DetectFragOffsetFree(void *);
static int PrefilterSetupFragOffset(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterFragOffsetIsPrefilterable(const Signature *s);
static bool PrefilterFragOffsetIsPrefilterable(const Signature *s);
/**
* \brief Registration function for fragoffset
@ -290,7 +290,7 @@ PrefilterPacketFragOffsetSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u16[1] = fb->frag_off;
}
static _Bool
static bool
PrefilterPacketFragOffsetCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectFragOffsetData *fb = smctx;
@ -310,7 +310,7 @@ static int PrefilterSetupFragOffset(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketFragOffsetMatch);
}
static _Bool PrefilterFragOffsetIsPrefilterable(const Signature *s)
static bool PrefilterFragOffsetIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -62,7 +62,7 @@ static int DetectHttpHHSetup(DetectEngineCtx *, Signature *, const char *);
#ifdef UNITTESTS
static void DetectHttpHHRegisterTests(void);
#endif
static _Bool DetectHttpHostValidateCallback(const Signature *s, const char **sigerror);
static bool DetectHttpHostValidateCallback(const Signature *s, const char **sigerror);
static int DetectHttpHostSetup(DetectEngineCtx *, Signature *, const char *);
static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
const DetectEngineTransforms *transforms,
@ -165,7 +165,7 @@ static int DetectHttpHHSetup(DetectEngineCtx *de_ctx, Signature *s, const char *
ALPROTO_HTTP);
}
static _Bool DetectHttpHostValidateCallback(const Signature *s, const char **sigerror)
static bool DetectHttpHostValidateCallback(const Signature *s, const char **sigerror)
{
const SigMatch *sm = s->init_data->smlists[g_http_host_buffer_id];
for ( ; sm != NULL; sm = sm->next) {

@ -66,7 +66,7 @@ static int DetectHttpMethodSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co
void DetectHttpMethodRegisterTests(void);
#endif
void DetectHttpMethodFree(void *);
static _Bool DetectHttpMethodValidateCallback(const Signature *s, const char **sigerror);
static bool DetectHttpMethodValidateCallback(const Signature *s, const char **sigerror);
static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
const DetectEngineTransforms *transforms, Flow *_f,
const uint8_t _flow_flags, void *txv, const int list_id);
@ -157,7 +157,7 @@ static int DetectHttpMethodSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co
* \retval 1 valid
* \retval 0 invalid
*/
static _Bool DetectHttpMethodValidateCallback(const Signature *s, const char **sigerror)
static bool DetectHttpMethodValidateCallback(const Signature *s, const char **sigerror)
{
const SigMatch *sm = s->init_data->smlists[g_http_method_buffer_id];
for ( ; sm != NULL; sm = sm->next) {

@ -57,7 +57,7 @@ static int DetectHttpRawHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s,
#ifdef UNITTESTS
static void DetectHttpRawHeaderRegisterTests(void);
#endif
static _Bool DetectHttpRawHeaderValidateCallback(const Signature *s, const char **sigerror);
static bool DetectHttpRawHeaderValidateCallback(const Signature *s, const char **sigerror);
static int g_http_raw_header_buffer_id = 0;
static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
const DetectEngineTransforms *transforms, Flow *_f,
@ -155,7 +155,7 @@ static int DetectHttpRawHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s,
return 0;
}
static _Bool DetectHttpRawHeaderValidateCallback(const Signature *s, const char **sigerror)
static bool DetectHttpRawHeaderValidateCallback(const Signature *s, const char **sigerror)
{
if ((s->flags & (SIG_FLAG_TOCLIENT|SIG_FLAG_TOSERVER)) == (SIG_FLAG_TOCLIENT|SIG_FLAG_TOSERVER)) {
*sigerror = "http_raw_header signature "

@ -49,7 +49,7 @@ static int DetectIcmpIdSetup(DetectEngineCtx *, Signature *, const char *);
void DetectIcmpIdRegisterTests(void);
void DetectIcmpIdFree(void *);
static int PrefilterSetupIcmpId(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterIcmpIdIsPrefilterable(const Signature *s);
static bool PrefilterIcmpIdIsPrefilterable(const Signature *s);
/**
* \brief Registration function for icode: icmp_id
@ -70,7 +70,7 @@ void DetectIcmpIdRegister (void)
DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study);
}
static inline _Bool GetIcmpId(Packet *p, uint16_t *id)
static inline bool GetIcmpId(Packet *p, uint16_t *id)
{
if (PKT_IS_PSEUDOPKT(p))
return FALSE;
@ -290,7 +290,7 @@ PrefilterPacketIcmpIdSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u16[0] = a->id;
}
static _Bool
static bool
PrefilterPacketIcmpIdCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectIcmpIdData *a = smctx;
@ -307,7 +307,7 @@ static int PrefilterSetupIcmpId(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketIcmpIdMatch);
}
static _Bool PrefilterIcmpIdIsPrefilterable(const Signature *s)
static bool PrefilterIcmpIdIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -49,7 +49,7 @@ static int DetectIcmpSeqSetup(DetectEngineCtx *, Signature *, const char *);
void DetectIcmpSeqRegisterTests(void);
void DetectIcmpSeqFree(void *);
static int PrefilterSetupIcmpSeq(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterIcmpSeqIsPrefilterable(const Signature *s);
static bool PrefilterIcmpSeqIsPrefilterable(const Signature *s);
/**
* \brief Registration function for icmp_seq
@ -70,7 +70,7 @@ void DetectIcmpSeqRegister (void)
DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study);
}
static inline _Bool GetIcmpSeq(Packet *p, uint16_t *seq)
static inline bool GetIcmpSeq(Packet *p, uint16_t *seq)
{
uint16_t seqn;
@ -293,7 +293,7 @@ PrefilterPacketIcmpSeqSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u16[0] = a->seq;
}
static _Bool
static bool
PrefilterPacketIcmpSeqCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectIcmpSeqData *a = smctx;
@ -310,7 +310,7 @@ static int PrefilterSetupIcmpSeq(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketIcmpSeqMatch);
}
static _Bool PrefilterIcmpSeqIsPrefilterable(const Signature *s)
static bool PrefilterIcmpSeqIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -53,7 +53,7 @@ void DetectICodeRegisterTests(void);
void DetectICodeFree(void *);
static int PrefilterSetupICode(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterICodeIsPrefilterable(const Signature *s);
static bool PrefilterICodeIsPrefilterable(const Signature *s);
/**
* \brief Registration function for icode: keyword
@ -320,7 +320,7 @@ PrefilterPacketICodeSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u8[2] = a->code2;
}
static _Bool
static bool
PrefilterPacketICodeCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectICodeData *a = smctx;
@ -339,7 +339,7 @@ static int PrefilterSetupICode(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketICodeMatch);
}
static _Bool PrefilterICodeIsPrefilterable(const Signature *s)
static bool PrefilterICodeIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -56,7 +56,7 @@ void DetectIdRegisterTests(void);
void DetectIdFree(void *);
static int PrefilterSetupId(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterIdIsPrefilterable(const Signature *s);
static bool PrefilterIdIsPrefilterable(const Signature *s);
/**
* \brief Registration function for keyword: id
@ -248,7 +248,7 @@ PrefilterPacketIdSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u16[0] = a->id;
}
static _Bool
static bool
PrefilterPacketIdCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectIdData *a = smctx;
@ -265,7 +265,7 @@ static int PrefilterSetupId(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketIdMatch);
}
static _Bool PrefilterIdIsPrefilterable(const Signature *s)
static bool PrefilterIdIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -53,7 +53,7 @@ void DetectITypeRegisterTests(void);
void DetectITypeFree(void *);
static int PrefilterSetupIType(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterITypeIsPrefilterable(const Signature *s);
static bool PrefilterITypeIsPrefilterable(const Signature *s);
/**
* \brief Registration function for itype: keyword
@ -324,7 +324,7 @@ PrefilterPacketITypeSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u8[2] = a->type2;
}
static _Bool
static bool
PrefilterPacketITypeCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectITypeData *a = smctx;
@ -343,7 +343,7 @@ static int PrefilterSetupIType(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketITypeMatch);
}
static _Bool PrefilterITypeIsPrefilterable(const Signature *s)
static bool PrefilterITypeIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -108,7 +108,7 @@ static int GetFlow(lua_State *luastate, Flow **ret_f)
}
static int GetFlowVarById(lua_State *luastate, Flow *f,
FlowVar **ret_fv, _Bool fv_may_be_null, uint32_t *ret_idx)
FlowVar **ret_fv, bool fv_may_be_null, uint32_t *ret_idx)
{
DetectLuaData *ld = NULL;
if (ret_idx)
@ -169,7 +169,7 @@ static int GetFlowVarByKey(lua_State *luastate, Flow *f, FlowVar **ret_fv)
}
static int GetFlowIntById(lua_State *luastate, Flow *f,
FlowVar **ret_fv, _Bool fv_may_be_null, uint32_t *ret_idx)
FlowVar **ret_fv, bool fv_may_be_null, uint32_t *ret_idx)
{
DetectLuaData *ld = NULL;
if (ret_idx)

@ -49,7 +49,7 @@ static int DetectAckMatch(DetectEngineThreadCtx *,
static void DetectAckRegisterTests(void);
static void DetectAckFree(void *);
static int PrefilterSetupTcpAck(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterTcpAckIsPrefilterable(const Signature *s);
static bool PrefilterTcpAckIsPrefilterable(const Signature *s);
void DetectAckRegister(void)
{
@ -175,7 +175,7 @@ PrefilterPacketAckSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u32[0] = a->ack;
}
static _Bool
static bool
PrefilterPacketAckCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectAckData *a = smctx;
@ -192,7 +192,7 @@ static int PrefilterSetupTcpAck(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketAckMatch);
}
static _Bool PrefilterTcpAckIsPrefilterable(const Signature *s)
static bool PrefilterTcpAckIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -63,7 +63,7 @@ static int DetectFlagsMatch (DetectEngineThreadCtx *, Packet *,
static int DetectFlagsSetup (DetectEngineCtx *, Signature *, const char *);
static void DetectFlagsFree(void *);
static _Bool PrefilterTcpFlagsIsPrefilterable(const Signature *s);
static bool PrefilterTcpFlagsIsPrefilterable(const Signature *s);
static int PrefilterSetupTcpFlags(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
/**
@ -574,7 +574,7 @@ PrefilterPacketFlagsSet(PrefilterPacketHeaderValue *v, void *smctx)
SCLogDebug("v->u8[0] = %02x", v->u8[0]);
}
static _Bool
static bool
PrefilterPacketFlagsCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectFlagsData *a = smctx;
@ -594,7 +594,7 @@ static int PrefilterSetupTcpFlags(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
}
static _Bool PrefilterTcpFlagsIsPrefilterable(const Signature *s)
static bool PrefilterTcpFlagsIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -46,7 +46,7 @@ static int DetectSeqMatch(DetectEngineThreadCtx *,
static void DetectSeqRegisterTests(void);
static void DetectSeqFree(void *);
static int PrefilterSetupTcpSeq(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterTcpSeqIsPrefilterable(const Signature *s);
static bool PrefilterTcpSeqIsPrefilterable(const Signature *s);
void DetectSeqRegister(void)
{
@ -170,7 +170,7 @@ PrefilterPacketSeqSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u32[0] = a->seq;
}
static _Bool
static bool
PrefilterPacketSeqCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectSeqData *a = smctx;
@ -187,7 +187,7 @@ static int PrefilterSetupTcpSeq(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketSeqMatch);
}
static _Bool PrefilterTcpSeqIsPrefilterable(const Signature *s)
static bool PrefilterTcpSeqIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -47,7 +47,7 @@ void DetectTcpmssFree (void *);
void DetectTcpmssRegisterTests (void);
#endif
static int PrefilterSetupTcpmss(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterTcpmssIsPrefilterable(const Signature *s);
static bool PrefilterTcpmssIsPrefilterable(const Signature *s);
/**
* \brief Registration function for tcpmss: keyword
@ -333,7 +333,7 @@ PrefilterPacketTcpmssSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u16[2] = a->arg2;
}
static _Bool
static bool
PrefilterPacketTcpmssCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectTcpmssData *a = smctx;
@ -352,7 +352,7 @@ static int PrefilterSetupTcpmss(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketTcpmssMatch);
}
static _Bool PrefilterTcpmssIsPrefilterable(const Signature *s)
static bool PrefilterTcpmssIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -47,7 +47,7 @@ void DetectTemplate2Free (void *);
void DetectTemplate2RegisterTests (void);
#endif
static int PrefilterSetupTemplate2(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterTemplate2IsPrefilterable(const Signature *s);
static bool PrefilterTemplate2IsPrefilterable(const Signature *s);
/**
* \brief Registration function for template2: keyword
@ -346,7 +346,7 @@ PrefilterPacketTemplate2Set(PrefilterPacketHeaderValue *v, void *smctx)
v->u8[2] = a->arg2;
}
static _Bool
static bool
PrefilterPacketTemplate2Compare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectTemplate2Data *a = smctx;
@ -365,7 +365,7 @@ static int PrefilterSetupTemplate2(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketTemplate2Match);
}
static _Bool PrefilterTemplate2IsPrefilterable(const Signature *s)
static bool PrefilterTemplate2IsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -64,7 +64,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
void *txv, const int list_id);
static void DetectTlsFingerprintSetupCallback(const DetectEngineCtx *de_ctx,
Signature *s);
static _Bool DetectTlsFingerprintValidateCallback(const Signature *s,
static bool DetectTlsFingerprintValidateCallback(const Signature *s,
const char **sigerror);
static int g_tls_cert_fingerprint_buffer_id = 0;
@ -148,7 +148,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
return buffer;
}
static _Bool DetectTlsFingerprintValidateCallback(const Signature *s,
static bool DetectTlsFingerprintValidateCallback(const Signature *s,
const char **sigerror)
{
const SigMatch *sm = s->init_data->smlists[g_tls_cert_fingerprint_buffer_id];
@ -166,7 +166,7 @@ static _Bool DetectTlsFingerprintValidateCallback(const Signature *s,
return FALSE;
}
_Bool have_delimiters = FALSE;
bool have_delimiters = FALSE;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{
@ -206,7 +206,7 @@ static void DetectTlsFingerprintSetupCallback(const DetectEngineCtx *de_ctx,
DetectContentData *cd = (DetectContentData *)sm->ctx;
_Bool changed = FALSE;
bool changed = FALSE;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{

@ -64,7 +64,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
void *txv, const int list_id);
static void DetectTlsSerialSetupCallback(const DetectEngineCtx *de_ctx,
Signature *s);
static _Bool DetectTlsSerialValidateCallback(const Signature *s,
static bool DetectTlsSerialValidateCallback(const Signature *s,
const char **sigerror);
static int g_tls_cert_serial_buffer_id = 0;
@ -147,7 +147,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
return buffer;
}
static _Bool DetectTlsSerialValidateCallback(const Signature *s,
static bool DetectTlsSerialValidateCallback(const Signature *s,
const char **sigerror)
{
const SigMatch *sm = s->init_data->smlists[g_tls_cert_serial_buffer_id];
@ -196,7 +196,7 @@ static void DetectTlsSerialSetupCallback(const DetectEngineCtx *de_ctx,
DetectContentData *cd = (DetectContentData *)sm->ctx;
_Bool changed = FALSE;
bool changed = FALSE;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{

@ -68,7 +68,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
void *txv, const int list_id);
static void DetectTlsJa3HashSetupCallback(const DetectEngineCtx *de_ctx,
Signature *s);
static _Bool DetectTlsJa3HashValidateCallback(const Signature *s,
static bool DetectTlsJa3HashValidateCallback(const Signature *s,
const char **sigerror);
static int g_tls_ja3_hash_buffer_id = 0;
@ -160,7 +160,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
return buffer;
}
static _Bool DetectTlsJa3HashValidateCallback(const Signature *s,
static bool DetectTlsJa3HashValidateCallback(const Signature *s,
const char **sigerror)
{
const SigMatch *sm = s->init_data->smlists[g_tls_ja3_hash_buffer_id];
@ -202,7 +202,7 @@ static void DetectTlsJa3HashSetupCallback(const DetectEngineCtx *de_ctx,
DetectContentData *cd = (DetectContentData *)sm->ctx;
_Bool changed = FALSE;
bool changed = FALSE;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{

@ -68,7 +68,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
void *txv, const int list_id);
static void DetectTlsJa3SHashSetupCallback(const DetectEngineCtx *de_ctx,
Signature *s);
static _Bool DetectTlsJa3SHashValidateCallback(const Signature *s,
static bool DetectTlsJa3SHashValidateCallback(const Signature *s,
const char **sigerror);
static int g_tls_ja3s_hash_buffer_id = 0;
@ -158,7 +158,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
return buffer;
}
static _Bool DetectTlsJa3SHashValidateCallback(const Signature *s,
static bool DetectTlsJa3SHashValidateCallback(const Signature *s,
const char **sigerror)
{
const SigMatch *sm = s->init_data->smlists[g_tls_ja3s_hash_buffer_id];
@ -200,7 +200,7 @@ static void DetectTlsJa3SHashSetupCallback(const DetectEngineCtx *de_ctx,
DetectContentData *cd = (DetectContentData *)sm->ctx;
_Bool changed = FALSE;
bool changed = FALSE;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{

@ -51,7 +51,7 @@ void DetectTtlFree (void *);
void DetectTtlRegisterTests (void);
#endif
static int PrefilterSetupTtl(DetectEngineCtx *de_ctx, SigGroupHead *sgh);
static _Bool PrefilterTtlIsPrefilterable(const Signature *s);
static bool PrefilterTtlIsPrefilterable(const Signature *s);
/**
* \brief Registration function for ttl: keyword
@ -331,7 +331,7 @@ PrefilterPacketTtlSet(PrefilterPacketHeaderValue *v, void *smctx)
v->u8[2] = a->ttl2;
}
static _Bool
static bool
PrefilterPacketTtlCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectTtlData *a = smctx;
@ -350,7 +350,7 @@ static int PrefilterSetupTtl(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
PrefilterPacketTtlMatch);
}
static _Bool PrefilterTtlIsPrefilterable(const Signature *s)
static bool PrefilterTtlIsPrefilterable(const Signature *s)
{
const SigMatch *sm;
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {

@ -426,8 +426,8 @@ typedef struct DetectBufferType_ {
const char *description;
int id;
int parent_id;
_Bool mpm;
_Bool packet; /**< compat to packet matches */
bool mpm;
bool packet; /**< compat to packet matches */
bool supports_transforms;
void (*SetupCallback)(const struct DetectEngineCtx_ *, struct Signature_ *);
bool (*ValidateCallback)(const struct Signature_ *, const char **sigerror);
@ -1185,7 +1185,7 @@ typedef struct SigTableElmt_ {
/** keyword setup function pointer */
int (*Setup)(DetectEngineCtx *, Signature *, const char *);
_Bool (*SupportsPrefilter)(const Signature *s);
bool (*SupportsPrefilter)(const Signature *s);
int (*SetupPrefilter)(DetectEngineCtx *de_ctx, struct SigGroupHead_ *sgh);
void (*Free)(void *);

@ -296,7 +296,7 @@ THashTableContext* THashInit(const char *cnf_prefix, size_t data_size,
int (*DataSet)(void *, void *),
void (*DataFree)(void *),
uint32_t (*DataHash)(void *),
_Bool (*DataCompare)(void *, void *))
bool (*DataCompare)(void *, void *))
{
THashTableContext *ctx = SCCalloc(1, sizeof(*ctx));
BUG_ON(!ctx);

@ -135,7 +135,7 @@ typedef struct THashDataConfig_ {
int (*DataSet)(void *dst, void *src);
void (*DataFree)(void *);
uint32_t (*DataHash)(void *);
_Bool (*DataCompare)(void *, void *);
bool (*DataCompare)(void *, void *);
} THashConfig;
#define THASH_DATA_SIZE(ctx) (sizeof(THashData) + (ctx)->config.data_size)
@ -187,7 +187,7 @@ THashTableContext* THashInit(const char *cnf_prefix, size_t data_size,
int (*DataSet)(void *dst, void *src),
void (*DataFree)(void *),
uint32_t (*DataHash)(void *),
_Bool (*DataCompare)(void *, void *));
bool (*DataCompare)(void *, void *));
void THashShutdown(THashTableContext *ctx);

Loading…
Cancel
Save