]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
rust: cargo fix for Rust 2018 edition
authorJason Ish <jason.ish@oisf.net>
Mon, 16 Dec 2019 19:41:07 +0000 (13:41 -0600)
committerJason Ish <jason.ish@oisf.net>
Fri, 24 Jan 2020 16:16:00 +0000 (10:16 -0600)
rust/src/applayer.rs
rust/src/dns/lua.rs
rust/src/rdp/log.rs
rust/src/rdp/parser.rs
rust/src/rdp/rdp.rs
rust/src/rdp/util.rs
rust/src/sip/detect.rs
rust/src/sip/log.rs
rust/src/sip/sip.rs
rust/src/smb/debug.rs

index d0dd5c81571e69c1826f3111c765842e41840ba6..d184072fa874ebbcdd6eab83e0000e42345f72ac 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 use std;
-use core::{STREAM_TOSERVER};
+use crate::core::{STREAM_TOSERVER};
 
 #[repr(C)]
 pub struct AppLayerGetTxIterTuple {
index fddeeb976786aeda24964811a456da1f8de16ae3..bbd6e0de43ce33ab6bbf78176626fc8897518fd3 100644 (file)
@@ -17,9 +17,9 @@
 
 use std::os::raw::c_int;
 
-use lua::*;
-use dns::dns::*;
-use dns::log::*;
+use crate::lua::*;
+use crate::dns::dns::*;
+use crate::dns::log::*;
 
 #[no_mangle]
 pub extern "C" fn rs_dns_lua_get_tx_id(clua: &mut CLuaState,
index 40d7a154d0c30eacf41c57463e61087ced2da05b..0d8b2d7d2fa7f6f0daa6d7944a1eabc5bced55e3 100644 (file)
@@ -18,9 +18,9 @@
 // Author: Zach Kelly <zach.kelly@lmco.com>
 
 use super::rdp::{RdpTransaction, RdpTransactionItem};
-use json::{Json, JsonT};
-use rdp::parser::*;
-use rdp::windows;
+use crate::json::{Json, JsonT};
+use crate::rdp::parser::*;
+use crate::rdp::windows;
 use std;
 use x509_parser::parse_x509_der;
 
@@ -78,7 +78,7 @@ fn to_json(tx: &RdpTransaction) -> Option<Json> {
 
 /// json helper for X224ConnectionRequest
 fn x224_req_to_json(js: &Json, x224: &X224ConnectionRequest) {
-    use rdp::parser::NegotiationRequestFlags as Flags;
+    use crate::rdp::parser::NegotiationRequestFlags as Flags;
 
     js.set_string("event_type", "initial_request");
     if let Some(ref cookie) = x224.cookie {
@@ -108,7 +108,7 @@ fn x224_req_to_json(js: &Json, x224: &X224ConnectionRequest) {
 
 /// json helper for X224ConnectionConfirm
 fn x224_conf_to_json(js: &Json, x224: &X224ConnectionConfirm) {
-    use rdp::parser::NegotiationResponseFlags as Flags;
+    use crate::rdp::parser::NegotiationResponseFlags as Flags;
 
     js.set_string("event_type", "initial_response");
     if let Some(ref from_server) = x224.negotiation_from_server {
@@ -292,7 +292,7 @@ fn mcs_req_to_json(js: &Json, mcs: &McsConnectRequest) {
                 if let Some(ref early_capability_flags) =
                     client.early_capability_flags
                 {
-                    use rdp::parser::EarlyCapabilityFlags as Flags;
+                    use crate::rdp::parser::EarlyCapabilityFlags as Flags;
 
                     if !early_capability_flags.is_empty() {
                         let flags = Json::array();
index 0226a31c8fe84ce262adc4070c970baa533b91d3..ef51eb27977971c4026848d40ec955fa18284b6f 100644 (file)
 //! * x.691-spec: <https://www.itu.int/rec/T-REC-X.691/en>
 
 use nom::{be_u16, be_u8, le_u16, le_u32, le_u8, ErrorKind, IResult};
-use rdp::error::RDP_NOT_X224_CLASS_0_ERROR;
-use rdp::util::{
+use crate::rdp::error::RDP_NOT_X224_CLASS_0_ERROR;
+use crate::rdp::util::{
     le_slice_to_string, parse_per_length_determinant, utf7_slice_to_string,
 };
-use rdp::windows;
+use crate::rdp::windows;
 
 /// constrains dimension to a range, per spec
 /// rdp-spec, section 2.2.1.3.2 Client Core Data
@@ -1111,7 +1111,7 @@ fn parse_mcs_connect_response(
 
 #[cfg(test)]
 mod tests_cookie_21182 {
-    use rdp::parser::*;
+    use crate::rdp::parser::*;
 
     static BYTES: [u8; 37] = [
         0x03, 0x00, 0x00, 0x25, 0x20, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43,
@@ -1145,7 +1145,7 @@ mod tests_cookie_21182 {
 
 #[cfg(test)]
 mod tests_negotiate_49350 {
-    use rdp::parser::*;
+    use crate::rdp::parser::*;
 
     static BYTES: [u8; 20] = [
         0x03, 0x00, 0x00, 0x13, 0x0e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
@@ -1188,7 +1188,7 @@ mod tests_negotiate_49350 {
 
 #[cfg(test)]
 mod tests_core_49350 {
-    use rdp::parser::*;
+    use crate::rdp::parser::*;
 
     static BYTES: [u8; 429] = [
         0x03, 0x00, 0x01, 0xac, 0x02, 0xf0, 0x80, 0x7f, 0x65, 0x82, 0x01, 0xa0,
@@ -1310,7 +1310,7 @@ mod tests_core_49350 {
 
 #[cfg(test)]
 mod tests_x223_response_49350 {
-    use rdp::parser::*;
+    use crate::rdp::parser::*;
 
     // changed offset 9 from 0x65 to 0x66 so it is no longer an mcs connect
     static BYTES: [u8; 9] =
@@ -1337,7 +1337,7 @@ mod tests_x223_response_49350 {
 
 #[cfg(test)]
 mod tests_t123_raw_49350 {
-    use rdp::parser::*;
+    use crate::rdp::parser::*;
 
     // changed offset 4 from 0x02 to 0x03 so it is no longer an X223 data object
     static BYTES: [u8; 9] =
@@ -1360,7 +1360,7 @@ mod tests_t123_raw_49350 {
 
 #[cfg(test)]
 mod tests_x224_raw_49350 {
-    use rdp::parser::*;
+    use crate::rdp::parser::*;
 
     // changed offset 11 from 0x01 to 0x02 so it is not a known X224 payload type
     static BYTES: [u8; 19] = [
@@ -1396,7 +1396,7 @@ mod tests_x224_raw_49350 {
 
 #[cfg(test)]
 mod tests_x223_raw_49350 {
-    use rdp::parser::*;
+    use crate::rdp::parser::*;
 
     // changed offset 9 from 0x65 to 0xff so it is no longer an mcs connect
     static BYTES: [u8; 9] =
@@ -1422,7 +1422,7 @@ mod tests_x223_raw_49350 {
 #[cfg(test)]
 mod tests_negotiate_incomplete_49350 {
     use nom;
-    use rdp::parser::*;
+    use crate::rdp::parser::*;
 
     static BYTES: [u8; 19] = [
         0x03, 0x00, 0x00, 0x13, 0x0e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
@@ -1476,7 +1476,7 @@ mod tests_negotiate_incomplete_49350 {
 #[cfg(test)]
 mod tests_core_incomplete_49350 {
     use nom;
-    use rdp::parser::*;
+    use crate::rdp::parser::*;
 
     static BYTES: [u8; 428] = [
         0x03, 0x00, 0x01, 0xac, 0x02, 0xf0, 0x80, 0x7f, 0x65, 0x82, 0x01, 0xa0,
index 3b66935413330d955886a32c2f9a09d35cd97c8e..4a349fe18aab5681ac64f29402bd693bfe359a57 100644 (file)
 
 //! RDP application layer
 
-use core::{
+use crate::core::{
     self, AppProto, DetectEngineState, Flow, ALPROTO_UNKNOWN, IPPROTO_TCP,
 };
-use conf;
+use crate::conf;
 use nom;
-use parser::*;
-use rdp::parser::*;
+use crate::parser::*;
+use crate::rdp::parser::*;
 use std;
 use std::mem::transmute;
 use tls_parser::{
@@ -561,7 +561,7 @@ pub unsafe extern "C" fn rs_rdp_register_parser() {
 #[cfg(test)]
 mod tests {
     use super::*;
-    use rdp::parser::{RdpCookie, X224ConnectionRequest};
+    use crate::rdp::parser::{RdpCookie, X224ConnectionRequest};
 
     #[test]
     fn test_probe_rdp() {
index dc44ff16638da78632671071ab85afbf6d8b2e0c..41758b721078da351199a4f58d6bcf6c6613965d 100644 (file)
@@ -21,7 +21,7 @@ use byteorder::ReadBytesExt;
 use memchr::memchr;
 use nom;
 use nom::{ErrorKind, IResult, Needed};
-use rdp::error::RDP_UNIMPLEMENTED_LENGTH_DETERMINANT;
+use crate::rdp::error::RDP_UNIMPLEMENTED_LENGTH_DETERMINANT;
 use std::io::Cursor;
 use widestring::U16CString;
 
@@ -105,7 +105,7 @@ pub fn parse_per_length_determinant(input: &[u8]) -> IResult<&[u8], u32> {
 mod tests {
     use super::*;
     use nom;
-    use rdp::error::RDP_UNIMPLEMENTED_LENGTH_DETERMINANT;
+    use crate::rdp::error::RDP_UNIMPLEMENTED_LENGTH_DETERMINANT;
 
     #[test]
     fn test_le_string_abc() {
index ab50275ccbcb436b331f856efe280efd692a6912..7d987e6ed80006d65d15f879bccfa16e640c290f 100644 (file)
@@ -17,8 +17,8 @@
 
 // written by Giuseppe Longo <giuseppe@glongo.it>
 
-use core::{STREAM_TOCLIENT, STREAM_TOSERVER};
-use sip::sip::SIPTransaction;
+use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER};
+use crate::sip::sip::SIPTransaction;
 use std::ptr;
 
 #[no_mangle]
index 8427a8775f764a1b5e749e9b45862b923081b790..1c1813366e17401e0d9ca1c8b054cfdad649f46d 100644 (file)
@@ -17,8 +17,8 @@
 
 // written by Giuseppe Longo <giuseppe@glongo.it>
 
-use json::*;
-use sip::sip::{SIPState, SIPTransaction};
+use crate::json::*;
+use crate::sip::sip::{SIPState, SIPTransaction};
 
 #[no_mangle]
 pub extern "C" fn rs_sip_log_json(_state: &mut SIPState, tx: &mut SIPTransaction) -> *mut JsonT {
index b33526003d060574c483c84ee5dbc10317a809ed..2c51e3c95d6e6d54d1d205cb9193ab08bd14543a 100755 (executable)
 
 extern crate nom;
 
-use applayer;
-use conf;
-use core;
-use core::{sc_detect_engine_state_free, AppProto, Flow, ALPROTO_UNKNOWN};
-use log::*;
-use parser::*;
-use sip::parser::*;
+use crate::applayer;
+use crate::conf;
+use crate::core;
+use crate::core::{sc_detect_engine_state_free, AppProto, Flow, ALPROTO_UNKNOWN};
+use crate::log::*;
+use crate::parser::*;
+use crate::sip::parser::*;
 use std;
 use std::ffi::{CStr, CString};
 
index 3387111ead28281461bd57ffc11d00e070fba85a..da1a94fe7a1ded55de0883c6008b5171357dbc09 100644 (file)
@@ -18,7 +18,7 @@
 use crate::smb::smb::*;
 
 #[cfg(feature = "debug")]
-use log::*;
+use crate::log::*;
 
 impl SMBState {
     #[cfg(not(feature = "debug"))]