]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
mqtt: use Direction enum
authorShivani Bhardwaj <shivanib134@gmail.com>
Thu, 12 Aug 2021 12:41:42 +0000 (18:11 +0530)
committerVictor Julien <vjulien@oisf.net>
Fri, 19 Nov 2021 16:20:01 +0000 (17:20 +0100)
rust/src/mqtt/mqtt.rs

index 91564838cfaae20f438dcc734140bd26e931f945..9df1ae3a5e88b97d724a9f46f9636eb7dc608195 100644 (file)
@@ -21,7 +21,7 @@ use super::mqtt_message::*;
 use super::parser::*;
 use crate::applayer::{self, LoggerFlags};
 use crate::applayer::*;
-use crate::core::{self, AppProto, Flow, ALPROTO_FAILED, ALPROTO_UNKNOWN, IPPROTO_TCP};
+use crate::core::{self, *};
 use nom7::Err;
 use std;
 use std::ffi::CString;
@@ -660,11 +660,11 @@ pub unsafe extern "C" fn rs_mqtt_tx_get_alstate_progress(
 ) -> std::os::raw::c_int {
     let tx = cast_pointer!(tx, MQTTTransaction);
     if tx.complete {
-        if direction == core::STREAM_TOSERVER {
+        if direction == Direction::ToServer.into() {
             if tx.toserver {
                 return 1;
             }
-        } else if direction == core::STREAM_TOCLIENT {
+        } else if direction == Direction::ToClient.into() {
             if tx.toclient {
                 return 1;
             }