#[non_exhaustive]pub struct Extracted<K> {
pub key: K,
pub orientation: Orientation,
pub l4: Option<L4Proto>,
pub tcp: Option<TcpInfo>,
pub l4_meta: Option<L4Meta>,
}Expand description
Result of extracting one packet.
key identifies the flow. orientation says whether view was
in the canonical direction or reversed. l4, tcp and l4_meta
carry pre-parsed protocol data that the tracker, the reassemblers
and the session engines reuse without re-parsing.
Offsets in tcp and l4_meta are relative to the frame the
outermost extractor was called with — decap combinators
(crate::extract::InnerVxlan, …) rebase the inner extractor’s
offsets with Extracted::rebased, so the tracker can slice the
original frame.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key: KThe flow this packet belongs to.
orientation: OrientationOrientation of this packet relative to the canonical form
of key. Forward if the natural src→dst direction matches
the key’s a→b ordering; Reverse if the extractor swapped
to canonicalize.
The tracker translates this into crate::FlowSide (Initiator
/ Responder) based on which orientation it saw first.
l4: Option<L4Proto>L4 protocol if the extractor identified one. Drives the tracker’s choice of timeout and whether to engage TCP state.
tcp: Option<TcpInfo>Pre-parsed TCP info for TCP packets. If Some, the tracker
runs the TCP state machine without re-parsing; if None,
TCP-specific events (Established, history string) won’t fire
for this flow.
Built-in extractors fill this for ~zero extra cost; custom
extractors that don’t care about TCP can leave it None.
l4_meta: Option<L4Meta>Ports and L4 payload location, when known. The session
engines use it for port-based slot selection and to hand
datagram parsers their payload without re-parsing the frame.
None makes them fall back to parsing the frame as plain
Ethernet (wrong for tunnelled traffic). Built-in extractors
fill it. New in 0.25.0.
Implementations§
Source§impl<K> Extracted<K>
impl<K> Extracted<K>
Sourcepub fn new(
key: K,
orientation: Orientation,
l4: Option<L4Proto>,
tcp: Option<TcpInfo>,
) -> Self
pub fn new( key: K, orientation: Orientation, l4: Option<L4Proto>, tcp: Option<TcpInfo>, ) -> Self
Construct an extraction result (no L4Meta; add it with
Self::with_l4_meta).
Sourcepub fn with_l4_meta(self, meta: L4Meta) -> Self
pub fn with_l4_meta(self, meta: L4Meta) -> Self
Attach ports / L4 payload location. New in 0.25.0.
Sourcepub fn rebased(self, delta: isize) -> Self
pub fn rebased(self, delta: isize) -> Self
Shift every frame offset (tcp.payload_offset,
l4_meta.payload_offset) by delta bytes. Decap combinators
call this to translate offsets from the inner (or synthetic)
frame they handed their inner extractor into offsets in the
frame they were given. An offset that would become negative
drops the TCP payload / L4 meta rather than pointing at the
wrong bytes. New in 0.25.0.