pub struct Decoder { /* private fields */ }Expand description
Stateful IPFIX decoder holding the Template cache of one Transport Session
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn with_config(config: DecoderConfig) -> Self
pub fn with_config(config: DecoderConfig) -> Self
Create a decoder with a custom configuration
Sourcepub fn template_count(&self) -> usize
pub fn template_count(&self) -> usize
Number of Templates and Options Templates in the cache
Sourcepub fn has_template(&self, observation_domain_id: u32, template_id: u16) -> bool
pub fn has_template(&self, observation_domain_id: u32, template_id: u16) -> bool
Whether a Template (or Options Template) is known for this Observation Domain and Template ID
Sourcepub fn template_last_received(
&self,
observation_domain_id: u32,
template_id: u16,
) -> Option<u32>
pub fn template_last_received( &self, observation_domain_id: u32, template_id: u16, ) -> Option<u32>
Export Time of the Message that last carried this Template (or Options Template), i.e. the “Last Received” of RFC 7011 Section 8.4
Sourcepub fn expire_templates(&mut self, now: u32)
pub fn expire_templates(&mut self, now: u32)
Discard the Templates not refreshed within
DecoderConfig::template_lifetime at time now (in seconds since the
UNIX epoch, like the Export Time). This runs automatically for each
decoded Message over UDP; call it to expire Templates with your own
clock, e.g. when an Exporter stopped sending. Does nothing without a
lifetime.
Sourcepub fn remove_observation_domain(&mut self, observation_domain_id: u32)
pub fn remove_observation_domain(&mut self, observation_domain_id: u32)
Remove all Templates of an Observation Domain