From: Pierre Chifflier Date: Wed, 19 Jan 2022 14:56:50 +0000 (+0100) Subject: rust: remove nom 5 dependency X-Git-Tag: suricata-7.0.0-beta1~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16db04c1a7d9a6ad171c2957d7660afcf48824c5;p=thirdparty%2Fsuricata.git rust: remove nom 5 dependency --- diff --git a/rust/Cargo.toml.in b/rust/Cargo.toml.in index c299dd3a37..ade1541cbd 100644 --- a/rust/Cargo.toml.in +++ b/rust/Cargo.toml.in @@ -22,7 +22,6 @@ debug = [] debug-validate = [] [dependencies] -nom = "~5.1.2" nom7 = { version="7.0", package="nom" } bitflags = "~1.2.1" byteorder = "~1.4.2" diff --git a/rust/src/common.rs b/rust/src/common.rs index dadce7b2cb..7c2e4f5d4d 100644 --- a/rust/src/common.rs +++ b/rust/src/common.rs @@ -43,19 +43,6 @@ pub mod nom7 { } } -#[macro_export] -macro_rules! take_until_and_consume ( - ( $i:expr, $needle:expr ) => ( - { - let input: &[u8] = $i; - - let (rem, res) = ::nom::take_until!(input, $needle)?; - let (rem, _) = ::nom::take!(rem, $needle.len())?; - Ok((rem, res)) - } - ); -); - #[cfg(not(feature = "debug-validate"))] #[macro_export] macro_rules! debug_validate_bug_on ( diff --git a/rust/src/dns/dns.rs b/rust/src/dns/dns.rs index 2d52ec60c1..d6ba77e37e 100644 --- a/rust/src/dns/dns.rs +++ b/rust/src/dns/dns.rs @@ -15,8 +15,6 @@ * 02110-1301, USA. */ -extern crate nom; - use std; use std::ffi::CString; use std::collections::HashMap; diff --git a/rust/src/lib.rs b/rust/src/lib.rs index a8b729bf61..5394b05fef 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -64,9 +64,6 @@ #![allow(clippy::redundant_pattern_matching)] #![allow(clippy::field_reassign_with_default)] -#[macro_use] -extern crate nom; - #[macro_use] extern crate bitflags; extern crate byteorder; diff --git a/rust/src/sip/parser.rs b/rust/src/sip/parser.rs index 29a7e69a30..4cc8d86e25 100644 --- a/rust/src/sip/parser.rs +++ b/rust/src/sip/parser.rs @@ -221,7 +221,7 @@ pub fn parse_headers(mut input: &[u8]) -> IResult<&[u8], HashMap Err(Err::Failure(_)) => {} Err(Err::Incomplete(e)) => return Err(Err::Incomplete(e)), }; - let (rest, header) = try_parse!(input, message_header); + let (rest, header) = message_header(input)?; headers_map.insert(header.name, header.value); input = rest; } diff --git a/rust/src/tftp/tftp.rs b/rust/src/tftp/tftp.rs index b78281c657..4aa3f25ecb 100644 --- a/rust/src/tftp/tftp.rs +++ b/rust/src/tftp/tftp.rs @@ -17,8 +17,6 @@ // written by Clément Galland -extern crate nom; - use std::str; use std; use nom7::IResult;