1pub use pcap_parser::PcapBlockOwned;
2
3use crate::{context::*, error::Error, packet::Packet};
4
5pub trait PcapAnalyzer {
7 fn init(&mut self) -> Result<(), Error> {
9 Ok(())
10 }
11
12 fn handle_block(
14 &mut self,
15 _block: &PcapBlockOwned,
16 _block_ctx: &ParseBlockContext,
17 ) -> Result<(), Error> {
18 Ok(())
19 }
20
21 fn handle_packet(&mut self, packet: &Packet, ctx: &ParseContext) -> Result<(), Error>;
23
24 fn teardown(&mut self) {}
26
27 fn before_refill(&mut self) {}
28}
29
30pub trait SafePcapAnalyzer: PcapAnalyzer + Send + Sync {}