From: Victor Julien Date: Sat, 30 May 2020 18:20:54 +0000 (+0200) Subject: app-layer: add methods to get status from AppLayerResult X-Git-Tag: suricata-6.0.0-beta1~400 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0288da686c0f641282ba5818b2a86c485d40f2f;p=thirdparty%2Fsuricata.git app-layer: add methods to get status from AppLayerResult --- diff --git a/rust/src/applayer.rs b/rust/src/applayer.rs index e96688e560..efc322da3f 100644 --- a/rust/src/applayer.rs +++ b/rust/src/applayer.rs @@ -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 for AppLayerResult {