retina_datatypes

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§