pcap-parser 91 packets ??
This commit is contained in:
18
thermalcamdecoder/src/main.rs
Normal file
18
thermalcamdecoder/src/main.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use std::fs::File;
|
||||
|
||||
use pcap_parser::traits::PcapReaderIterator;
|
||||
use pcap_parser::*;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let file = File::open("in.pcap")?;
|
||||
let mut cap = PcapNGReader::new(65535, file)?;
|
||||
let mut i = 0;
|
||||
let mut max_offset = 0;
|
||||
while let Ok((offset, _packet)) = cap.next() {
|
||||
i += 1;
|
||||
max_offset = offset;
|
||||
cap.consume(offset)
|
||||
}
|
||||
println!("found {} packets, {} last offset", i, max_offset);
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user