net_parser_rs/flow/layer3/
arp.rs

1use crate::flow::Flow;
2use crate::flow::errors::Error;
3use crate::flow::info::layer2::Info;
4use crate::flow::layer3::FlowExtraction;
5use crate::layer3::Arp;
6
7pub mod errors {
8    use crate::errors::Error as NetParserError;
9    use thiserror::{Error as ThisError};
10
11    #[derive(Debug, ThisError)]
12    pub enum Error {
13        #[error("Error parsing ARP")]
14        NetParser(#[from] NetParserError),
15        #[error("ARP cannot be converted to a flow")]
16        Flow,
17    }
18
19    unsafe impl Sync for Error {}
20    unsafe impl Send for Error {}
21}
22
23impl FlowExtraction for Arp {
24    fn extract_flow(&self, _l2: Info) -> Result<Flow, Error> {
25        Err(Error::L3(errors::Error::Flow.into()))
26    }
27}