Trait retina_datatypes::Tracked
source · pub trait Tracked {
// Required methods
fn new(first_pkt: &L4Pdu) -> Self;
fn update(&mut self, pdu: &L4Pdu, reassembled: bool);
fn stream_protocols() -> Vec<&'static str>;
fn clear(&mut self);
}
Expand description
Trait implemented by datatypes that require inline tracking. This is typically required for subscribable types that require calculating metrics throughout a connection, e.g. QoS metrics.
Required Methods§
sourcefn new(first_pkt: &L4Pdu) -> Self
fn new(first_pkt: &L4Pdu) -> Self
Initialize internal data; called once per connection.
Note first_pkt
will also be delivered to update
.
sourcefn update(&mut self, pdu: &L4Pdu, reassembled: bool)
fn update(&mut self, pdu: &L4Pdu, reassembled: bool)
New packet in connection received (or reassembled, if reassembled=true)
Note this may be invoked both pre- and post-reassembly; types
should check reassembled
to avoid double-counting.
sourcefn stream_protocols() -> Vec<&'static str>
fn stream_protocols() -> Vec<&'static str>
The stream protocols (lower-case) required for this datatype.
See IMPLEMENTED_PROTOCOLS
in retina_core for list of supported protocols.
Object Safety§
This trait is not object safe.