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§

source

fn new(first_pkt: &L4Pdu) -> Self

Initialize internal data; called once per connection. Note first_pkt will also be delivered to update.

source

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.

source

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.

source

fn clear(&mut self)

Clear internal data; called if connection no longer matches filter that requires the Tracked type.

Object Safety§

This trait is not object safe.

Implementors§