diff --git a/pcap-rewrite/Cargo.toml b/pcap-rewrite/Cargo.toml index df7c66f..3fcab1a 100644 --- a/pcap-rewrite/Cargo.toml +++ b/pcap-rewrite/Cargo.toml @@ -35,6 +35,7 @@ clap = { version = "3.2", features = ["cargo", "derive"] } libpcap-tools = { version="0.1.0", path="../libpcap-tools" } log = { version = "0.4", features = ["max_level_debug", "release_max_level_warn"] } flate2 = { version = "1.0", features = ["zlib"], default-features = false } +lz4 = "1.23" pnet_packet = "0.31" simplelog = { version="0.12", default-features = false } xz2 = "0.1" diff --git a/pcap-rewrite/src/lib.rs b/pcap-rewrite/src/lib.rs index ecb1d64..e04740b 100644 --- a/pcap-rewrite/src/lib.rs +++ b/pcap-rewrite/src/lib.rs @@ -1,3 +1,5 @@ +extern crate lz4; + use std::fs::File; use std::io::{self, Read}; use std::path::Path; @@ -86,6 +88,8 @@ fn get_reader(input_filename: &str) -> io::Result> { Box::new(GzDecoder::new(file)) } else if input_filename.ends_with(".xz") { Box::new(XzDecoder::new(file)) + } else if input_filename.ends_with(".lz4") { + Box::new(lz4::Decoder::new(file)?) } else { Box::new(file) as Box }