]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: add methods to get status from AppLayerResult
authorVictor Julien <victor@inliniac.net>
Sat, 30 May 2020 18:20:54 +0000 (20:20 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 30 May 2020 18:39:34 +0000 (20:39 +0200)
rust/src/applayer.rs

index e96688e560d317053c39ab709afb84c5c9f0ba49..efc322da3f36f9a580e2a6538fec054a4740869d 100644 (file)
@@ -62,6 +62,16 @@ impl AppLayerResult {
             needed: needed,
         };
     }
+
+    pub fn is_ok(self) -> bool {
+        self.status == 0
+    }
+    pub fn is_incomplete(self) -> bool {
+        self.status == 1
+    }
+    pub fn is_err(self) -> bool {
+        self.status == -1
+    }
 }
 
 impl From<bool> for AppLayerResult {