]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Various style fixes
authorVictor Julien <victor@inliniac.net>
Wed, 8 Jan 2014 15:10:26 +0000 (16:10 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 10 Jan 2014 10:53:36 +0000 (11:53 +0100)
src/app-layer-detect-proto.c
src/app-layer-parser.c
src/app-layer-parser.h
src/app-layer-protos.h
src/app-layer.c
src/app-layer.h

index 1e197885e53bb7f03910e23b1088abc14968654d..effb1520caaef46b5c74caf581bb976425751a2f 100644 (file)
@@ -1541,14 +1541,14 @@ void *AppLayerProtoDetectGetCtxThread(void)
 
     for (i = 0; i < FLOW_PROTO_DEFAULT; i++) {
         for (j = 0; j < 2; j++) {
-            if (max_pat_id == 0)
-                {
-                    max_pat_id = alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id;
-                } else if (alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id &&
-                           max_pat_id < alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id)
-                {
-                    max_pat_id = alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id;
-                }
+            if (max_pat_id == 0) {
+                max_pat_id = alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id;
+
+            } else if (alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id &&
+                    max_pat_id < alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id)
+            {
+                max_pat_id = alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id;
+            }
         }
     }
 
@@ -1622,9 +1622,9 @@ AppProto AppLayerProtoDetectGetProtoByName(char *alproto_name)
         if (alpd_ctx.alproto_names[a] != NULL &&
             strlen(alpd_ctx.alproto_names[a]) == strlen(alproto_name) &&
             (SCMemcmp(alpd_ctx.alproto_names[a], alproto_name, strlen(alproto_name)) == 0))
-            {
-                goto end;
-            }
+        {
+            goto end;
+        }
     }
 
  end:
@@ -2666,27 +2666,6 @@ int AppLayerProtoDetectTest14(void)
     return r;
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 typedef struct AppLayerProtoDetectPPTestDataElement_ {
     char *alproto_name;
     uint16_t alproto;
index f6a3a78b74b906b64114caf13698dccad137950b..0867e00df91bd2e5412f6077d17cb09d93cb6258 100644 (file)
@@ -226,8 +226,7 @@ void *AppLayerParserGetCtxThread(void)
     for (i = 0; i < FLOW_PROTO_DEFAULT; i++) {
         for (j = 0; j < ALPROTO_MAX; j++) {
             tctx->alproto_local_storage[i][j] =
-                AppLayerParserGetProtocolParserLocalStorage(FlowGetReverseProtoMapping(i),
-                                                 j);
+                AppLayerParserGetProtocolParserLocalStorage(FlowGetReverseProtoMapping(i), j);
         }
     }
 
@@ -680,11 +679,11 @@ uint64_t AppLayerParserGetTransactionActive(uint16_t ipproto, AppProto alproto,
 {
     SCEnter();
 
-    AppLayerParserParserState *pstate_1 = (AppLayerParserParserState *)pstate;
+    AppLayerParserParserState *state = (AppLayerParserParserState *)pstate;
     uint64_t active_id;
 
-    uint64_t log_id = pstate_1->log_id;
-    uint64_t inspect_id = pstate_1->inspect_id[direction & STREAM_TOSERVER ? 0 : 1];
+    uint64_t log_id = state->log_id;
+    uint64_t inspect_id = state->inspect_id[direction & STREAM_TOSERVER ? 0 : 1];
     if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].logger == TRUE) {
         active_id = (log_id < inspect_id) ? log_id : inspect_id;
     } else {
@@ -756,9 +755,9 @@ int AppLayerParserParse(void *tctx, Flow *f, AppProto alproto,
         if (p->Parser[(flags & STREAM_TOSERVER) ? 0 : 1](f, alstate, pstate,
                 input, input_len,
                 alp_tctx->alproto_local_storage[FlowGetProtoMapping(f->proto)][alproto]) < 0)
-            {
-                goto error;
-            }
+        {
+            goto error;
+        }
     }
 
     /* set the packets to no inspection and reassembly if required */
index 84ab9a6a2409c34890f9fead3d7476298b105d94..5025763a0a0ed22f7fade75a3344ee603d71ce03 100644 (file)
@@ -22,8 +22,8 @@
  * \author Anoop Saldanha <anoopsaldanha@gmail.com>
  */
 
-#ifndef __APP_LAYER_PARSER__H__
-#define __APP_LAYER_PARSER__H__
+#ifndef __APP_LAYER_PARSER_H__
+#define __APP_LAYER_PARSER_H__
 
 #include "decode-events.h"
 #include "util-file.h"
@@ -189,4 +189,4 @@ void AppLayerParserBackupParserTable(void);
 void AppLayerParserRestoreParserTable(void);
 #endif
 
-#endif /* __APP_LAYER_PARSER__H__ */
+#endif /* __APP_LAYER_PARSER_H__ */
index c48ff49c25c64128858eba862d821b844210f34f..39c729c41a33d857248f5d27550f5c00a97ca34b 100644 (file)
@@ -22,8 +22,8 @@
  * \author Anoop Saldanha <anoopsaldanha@gmail.com>
  */
 
-#ifndef __APP_LAYER_PROTOS__H__
-#define __APP_LAYER_PROTOS__H__
+#ifndef __APP_LAYER_PROTOS_H__
+#define __APP_LAYER_PROTOS_H__
 
 enum {
     ALPROTO_UNKNOWN = 0,
@@ -63,4 +63,4 @@ typedef uint16_t AppProto;
  */
 const char *AppProtoToString(AppProto alproto);
 
-#endif /* __APP_LAYER_PROTOS__H__ */
+#endif /* __APP_LAYER_PROTOS_H__ */
index a7b5c675b31a640017479c0a496fa90bb3155377..86fe6239fa227a71dd3422e2c56420b51a8e54ca 100644 (file)
@@ -286,12 +286,12 @@ int AppLayerHandleTCPData(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
                  */
                 if ((ssn->data_first_seen_dir != APP_LAYER_DATA_ALREADY_SENT_TO_APP_LAYER) &&
                     (first_data_dir) && !(first_data_dir & flags))
-                    {
-                        FlowSetSessionNoApplayerInspectionFlag(f);
-                        StreamTcpSetStreamFlagAppProtoDetectionCompleted(&ssn->server);
-                        StreamTcpSetStreamFlagAppProtoDetectionCompleted(&ssn->client);
-                        goto failure;
-                    }
+                {
+                    FlowSetSessionNoApplayerInspectionFlag(f);
+                    StreamTcpSetStreamFlagAppProtoDetectionCompleted(&ssn->server);
+                    StreamTcpSetStreamFlagAppProtoDetectionCompleted(&ssn->client);
+                    goto failure;
+                }
 
                 if (data_len > 0)
                     ssn->data_first_seen_dir = APP_LAYER_DATA_ALREADY_SENT_TO_APP_LAYER;
index ed37f76577193d5e2955dff28515eb5fda992e12..f44106d51ad688f8394476a8c2ff58da182398c7 100644 (file)
@@ -20,8 +20,8 @@
  * \author Anoop Saldanha <anoopsaldanha@gmail.com>
  */
 
-#ifndef __APP_LAYER__H__
-#define __APP_LAYER__H__
+#ifndef __APP_LAYER_H__
+#define __APP_LAYER_H__
 
 #include "threadvars.h"
 #include "decode.h"