]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: cleanup: use true bool type for 'logger'
authorVictor Julien <victor@inliniac.net>
Thu, 5 Oct 2017 16:50:22 +0000 (18:50 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 24 Nov 2017 09:14:36 +0000 (10:14 +0100)
src/app-layer-parser.c

index ecf35b9980d02fe4f872f8f77e6cd31cce6343cf..3069b5ad01fc906615c34535a993cd1d07f70c8d 100644 (file)
@@ -89,7 +89,7 @@ typedef struct AppLayerParserProtoCtx_
 {
     /* 0 - to_server, 1 - to_client. */
     AppLayerParserFPtr Parser[2];
-    char logger;
+    bool logger;
 
     void *(*StateAlloc)(void);
     void (*StateFree)(void *);
@@ -457,7 +457,7 @@ void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
 {
     SCEnter();
 
-    alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].logger = TRUE;
+    alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].logger = true;
 
     SCReturn;
 }
@@ -732,7 +732,7 @@ uint64_t AppLayerTransactionGetActiveDetectLog(Flow *f, uint8_t flags)
     AppLayerParserProtoCtx *p = &alp_ctx.ctxs[f->protomap][f->alproto];
     uint64_t log_id = f->alparser->log_id;
     uint64_t inspect_id = f->alparser->inspect_id[flags & STREAM_TOSERVER ? 0 : 1];
-    if (p->logger == TRUE) {
+    if (p->logger == true) {
         return (log_id < inspect_id) ? log_id : inspect_id;
     } else {
         return inspect_id;
@@ -751,7 +751,7 @@ uint64_t AppLayerTransactionGetActiveLogOnly(Flow *f, uint8_t flags)
 {
     AppLayerParserProtoCtx *p = &alp_ctx.ctxs[f->protomap][f->alproto];
 
-    if (p->logger == TRUE) {
+    if (p->logger == true) {
         uint64_t log_id = f->alparser->log_id;
         SCLogDebug("returning %"PRIu64, log_id);
         return log_id;
@@ -913,7 +913,7 @@ uint64_t AppLayerParserGetTransactionActive(const Flow *f,
 
     uint64_t log_id = pstate->log_id;
     uint64_t inspect_id = pstate->inspect_id[direction & STREAM_TOSERVER ? 0 : 1];
-    if (alp_ctx.ctxs[f->protomap][f->alproto].logger == TRUE) {
+    if (alp_ctx.ctxs[f->protomap][f->alproto].logger == true) {
         active_id = (log_id < inspect_id) ? log_id : inspect_id;
     } else {
         active_id = inspect_id;
@@ -1215,7 +1215,7 @@ int AppLayerParserProtocolHasLogger(uint8_t ipproto, AppProto alproto)
 {
     SCEnter();
     int ipproto_map = FlowGetProtoMapping(ipproto);
-    int r = (alp_ctx.ctxs[ipproto_map][alproto].logger == 0) ? 0 : 1;
+    int r = (alp_ctx.ctxs[ipproto_map][alproto].logger == false) ? 0 : 1;
     SCReturnInt(r);
 }