pub trait FlowExtractor:
Send
+ Sync
+ 'static {
type Key: Eq + Hash + Clone + Send + Sync + 'static;
// Required method
fn extract(&self, view: PacketView<'_>) -> Option<Extracted<Self::Key>>;
}Expand description
Extract a flow descriptor from one packet.
Implementations are called once per packet on the hot path —
keep them cheap and stateless. Most return Some(_); malformed,
non-IP, or out-of-scope packets return None and are skipped.
§Bidirectional flows
If you want A→B and B→A merged into one flow, your extractor
must produce the same Key for both orientations and report
each packet’s direction via Extracted::orientation. The
built-in crate::extract::FiveTuple::bidirectional does this
by sorting (addr, port) pairs.
§Bounds
Send + Sync + 'static is required so a tracker generic over
this trait can be used from any task / thread.
Required Associated Types§
Required Methods§
Implementors§
Source§impl FlowExtractor for FiveTuple
Available on crate feature extractors only.
impl FlowExtractor for FiveTuple
Available on crate feature
extractors only.type Key = FiveTupleKey
Source§impl FlowExtractor for IpPair
Available on crate feature extractors only.
impl FlowExtractor for IpPair
Available on crate feature
extractors only.Source§impl FlowExtractor for MacPair
Available on crate feature extractors only.
impl FlowExtractor for MacPair
Available on crate feature
extractors only.type Key = MacPairKey
Source§impl<E> FlowExtractor for FlowLabel<E>
Available on crate feature extractors only.
impl<E> FlowExtractor for FlowLabel<E>
Available on crate feature
extractors only.type Key = FlowLabelKey<<E as FlowExtractor>::Key>
Source§impl<E, H> FlowExtractor for DnsUdpObserver<E, H>
Available on crate feature dns only.
impl<E, H> FlowExtractor for DnsUdpObserver<E, H>
Available on crate feature
dns only.type Key = <E as FlowExtractor>::Key
Source§impl<E: FlowExtractor + Clone> FlowExtractor for AutoDetectEncap<E>
Available on crate feature extractors only.
impl<E: FlowExtractor + Clone> FlowExtractor for AutoDetectEncap<E>
Available on crate feature
extractors only.type Key = <E as FlowExtractor>::Key
Source§impl<E: FlowExtractor> FlowExtractor for InnerGre<E>
Available on crate feature extractors only.
impl<E: FlowExtractor> FlowExtractor for InnerGre<E>
Available on crate feature
extractors only.type Key = <E as FlowExtractor>::Key
Source§impl<E: FlowExtractor> FlowExtractor for InnerGtpU<E>
Available on crate feature extractors only.
impl<E: FlowExtractor> FlowExtractor for InnerGtpU<E>
Available on crate feature
extractors only.type Key = <E as FlowExtractor>::Key
Source§impl<E: FlowExtractor> FlowExtractor for StripMpls<E>
Available on crate feature extractors only.
impl<E: FlowExtractor> FlowExtractor for StripMpls<E>
Available on crate feature
extractors only.type Key = <E as FlowExtractor>::Key
Source§impl<E: FlowExtractor> FlowExtractor for StripVlan<E>
Available on crate feature extractors only.
impl<E: FlowExtractor> FlowExtractor for StripVlan<E>
Available on crate feature
extractors only.type Key = <E as FlowExtractor>::Key
Source§impl<E: FlowExtractor> FlowExtractor for InnerVxlan<E>
Available on crate feature extractors only.
impl<E: FlowExtractor> FlowExtractor for InnerVxlan<E>
Available on crate feature
extractors only.