]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: BIT_U16 macro utility
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 8 Dec 2020 13:53:01 +0000 (14:53 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 7 Jun 2021 08:58:05 +0000 (10:58 +0200)
(cherry picked from commit 2e46b5d1001d61da2131c42554eff10b7400ad81)

rust/src/core.rs
rust/src/filecontainer.rs

index 727d4605cb79bd6e149ed3dd6856bf9c639335c0..2fb3ac1eca5d548f347e562c6777529adcfa6143 100644 (file)
@@ -48,6 +48,10 @@ pub static mut ALPROTO_FAILED : AppProto = 0; // updated during init
 pub const IPPROTO_TCP : i32 = 6;
 pub const IPPROTO_UDP : i32 = 17;
 
+macro_rules!BIT_U16 {
+    ($x:expr) => (1 << $x);
+}
+
 macro_rules!BIT_U32 {
     ($x:expr) => (1 << $x);
 }
@@ -231,4 +235,4 @@ impl Flow {
             std::time::Duration::new(secs, usecs as u32 * 1000)
         }
     }
-}
\ No newline at end of file
+}
index 7bf585827610c172b8b45b498b1072d39fc65c2c..401d215cde4c406c495082e177d35a64e3d631ed 100644 (file)
@@ -24,7 +24,7 @@ use crate::core::*;
 extern {
     pub fn FileFlowToFlags(flow: *const Flow, flags: u8) -> u16;
 }
-pub const FILE_USE_DETECT:    u16 = 0x2000;
+pub const FILE_USE_DETECT:    u16 = BIT_U16!(13);
 
 
 pub struct File;