]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http2: complete parsing of priority frames
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 1 Oct 2020 13:10:27 +0000 (15:10 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 3 Oct 2020 17:52:53 +0000 (19:52 +0200)
rust/src/http2/http2.rs
rust/src/http2/parser.rs

index c7b55c3f60f918629f0ae107f0965e4e15df2886..9a033010397fabb3cfa3797c1a1cb8df5a73a8a5 100644 (file)
@@ -56,7 +56,7 @@ const HTTP2_FRAME_HEADER_LEN: usize = 9;
 const HTTP2_MAGIC_LEN: usize = 24;
 const HTTP2_FRAME_GOAWAY_LEN: usize = 4;
 const HTTP2_FRAME_RSTSTREAM_LEN: usize = 4;
-const HTTP2_FRAME_PRIORITY_LEN: usize = 1;
+const HTTP2_FRAME_PRIORITY_LEN: usize = 5;
 const HTTP2_FRAME_WINDOWUPDATE_LEN: usize = 4;
 //TODO make this configurable
 pub const HTTP2_MAX_TABLESIZE: u32 = 0x10000; // 65536
index d0e3b3aaa9eee9342587c117d0b99945cd74a658..9ba2e5835d70235da9f7580b30e688d8be587e70 100644 (file)
@@ -168,13 +168,17 @@ named!(pub http2_parse_frame_rststream<HTTP2FrameRstStream>,
 
 #[derive(Clone, Copy)]
 pub struct HTTP2FramePriority {
+    pub exclusive: u8,
+    pub dependency: u32,
     pub weight: u8,
 }
 
 named!(pub http2_parse_frame_priority<HTTP2FramePriority>,
     do_parse!(
+        sid: bits!( tuple!( take_bits!(1u8),
+                            take_bits!(31u32) ) ) >>
         weight: be_u8 >>
-        (HTTP2FramePriority{weight})
+        (HTTP2FramePriority{exclusive:sid.0, dependency:sid.1, weight})
     )
 );