]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix app-layer parser flags
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 4 Jun 2021 08:28:10 +0000 (10:28 +0200)
committerShivani Bhardwaj <shivanib134@gmail.com>
Tue, 8 Jun 2021 11:03:30 +0000 (16:33 +0530)
This especially allows for SSH bypass to work

(cherry picked from commit fdab22d924702168e3b7d07d061009ebdcfa9aa9)

rust/src/applayer.rs
rust/src/core.rs

index 3b23a126d404de042f382a9e00314886409aff55..659870e773a88463ea7c91e490c2d35cf299dc52 100644 (file)
@@ -298,12 +298,12 @@ extern {
 }
 
 // Defined in app-layer-parser.h
-pub const APP_LAYER_PARSER_EOF_TS : u8 = 0b0101;
-pub const APP_LAYER_PARSER_EOF_TC : u8 = 0b0110;
-pub const APP_LAYER_PARSER_NO_INSPECTION : u8 = 0b1;
-pub const APP_LAYER_PARSER_NO_REASSEMBLY : u8 = 0b10;
-pub const APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD : u8 = 0b100;
-pub const APP_LAYER_PARSER_BYPASS_READY : u8 = 0b1000;
+pub const APP_LAYER_PARSER_EOF_TS : u8 = BIT_U8!(5);
+pub const APP_LAYER_PARSER_EOF_TC : u8 = BIT_U8!(6);
+pub const APP_LAYER_PARSER_NO_INSPECTION : u8 = BIT_U8!(1);
+pub const APP_LAYER_PARSER_NO_REASSEMBLY : u8 = BIT_U8!(2);
+pub const APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD : u8 = BIT_U8!(3);
+pub const APP_LAYER_PARSER_BYPASS_READY : u8 = BIT_U8!(4);
 
 pub const APP_LAYER_PARSER_OPT_ACCEPT_GAPS: u32 = BIT_U32!(0);
 pub const APP_LAYER_PARSER_OPT_UNIDIR_TXS: u32 = BIT_U32!(1);
index 2fb3ac1eca5d548f347e562c6777529adcfa6143..61073ed6576f188d1bc216e7ff259e4c9944d22b 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_U8 {
+    ($x:expr) => (1 << $x);
+}
+
 macro_rules!BIT_U16 {
     ($x:expr) => (1 << $x);
 }