]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/proto: use BIT macros instead of expr
authorShivani Bhardwaj <shivani@oisf.net>
Thu, 10 Oct 2024 07:17:49 +0000 (12:47 +0530)
committerVictor Julien <victor@inliniac.net>
Tue, 15 Oct 2024 11:54:34 +0000 (13:54 +0200)
src/detect-engine-proto.h

index 6008430be68011f215ded9a5807420a1661d0cc8..95089a23e7da5d18eb90b9374e53218372f5bf8b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2024 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
 #ifndef SURICATA_DETECT_PROTO_H
 #define SURICATA_DETECT_PROTO_H
 
-#define DETECT_PROTO_ANY            (1 << 0) /**< Indicate that given protocol
-                                              is considered as IP */
-#define DETECT_PROTO_ONLY_PKT       (1 << 1) /**< Indicate that we only care
-                                              about packet payloads. */
-#define DETECT_PROTO_ONLY_STREAM    (1 << 2) /**< Indicate that we only care
-                                              about stream payloads. */
-#define DETECT_PROTO_IPV4           (1 << 3) /**< IPv4 only */
-#define DETECT_PROTO_IPV6           (1 << 4) /**< IPv6 only */
+// clang-format off
+#define DETECT_PROTO_ANY               BIT_U8(0) /**< Indicate that given protocol is considered as IP */
+#define DETECT_PROTO_ONLY_PKT          BIT_U8(1) /**< Indicate that we only care about packet payloads. */
+#define DETECT_PROTO_ONLY_STREAM       BIT_U8(2) /**< Indicate that we only care about stream payloads. */
+#define DETECT_PROTO_IPV4              BIT_U8(3) /**< IPv4 only */
+#define DETECT_PROTO_IPV6              BIT_U8(4) /**< IPv6 only */
+// clang-format on
 
 typedef struct DetectProto_ {
     uint8_t proto[256/8]; /**< bit array for 256 protocol bits */