#[non_exhaustive]pub struct DnsUdpParser { /* private fields */ }Available on crate feature
dns only.Expand description
Per-flow DNS-over-UDP parser.
Without correlation (the default), each datagram is parsed
independently. With correlation enabled — Self::with_correlation
or Self::with_config — Response messages carry RTT in their
elapsed field, and DatagramParser::on_tick emits
DnsMessage::Unanswered for queries left unanswered past
query_timeout.
Implementations§
Source§impl DnsUdpParser
impl DnsUdpParser
Sourcepub fn with_correlation() -> Self
pub fn with_correlation() -> Self
Enable query/response correlation with the default
DnsConfig.
Sourcepub fn with_config(config: DnsConfig) -> Self
pub fn with_config(config: DnsConfig) -> Self
Enable correlation with an explicit DnsConfig
(query_timeout, max_pending).
Trait Implementations§
Source§impl Clone for DnsUdpParser
impl Clone for DnsUdpParser
Source§impl DatagramParser for DnsUdpParser
impl DatagramParser for DnsUdpParser
Source§type Message = DnsMessage
type Message = DnsMessage
Available on crate feature
session only.L7 message produced by this parser. Same
Debug bound as
SessionParser::Message.Source§fn parse(
&mut self,
payload: &[u8],
_side: FlowSide,
ts: Timestamp,
out: &mut Vec<DnsMessage>,
)
fn parse( &mut self, payload: &[u8], _side: FlowSide, ts: Timestamp, out: &mut Vec<DnsMessage>, )
Available on crate feature
session only.Parse one L4 payload.
side is the direction relative to
the flow’s initiator; ts is the observed time of the
datagram. Push any complete messages decoded into out. Read moreSource§fn on_tick(&mut self, now: Timestamp, out: &mut Vec<DnsMessage>)
fn on_tick(&mut self, now: Timestamp, out: &mut Vec<DnsMessage>)
Available on crate feature
session only.Periodic time hook — see
SessionParser::on_tick. The
driver calls this on every sweep / finish. Default: no-op.Source§fn parser_kind(&self) -> ParserKind
fn parser_kind(&self) -> ParserKind
Available on crate feature
session only.See
SessionParser::parser_kind. Default
ParserKind::Unspecified.Source§fn is_poisoned(&self) -> bool
fn is_poisoned(&self) -> bool
Available on crate feature
session only.True after the parser has hit an unrecoverable error. See
SessionParser::is_poisoned for the contract.Source§fn poison_reason(&self) -> Option<&str>
fn poison_reason(&self) -> Option<&str>
Available on crate feature
session only.Optional reason for poison. See
SessionParser::poison_reason.Source§fn is_done(&self) -> bool
fn is_done(&self) -> bool
Available on crate feature
session only.Symmetric “I’m done — close this flow cleanly” signal,
mirroring
SessionParser::is_done. Default: false.Source§fn transports(&self) -> Transports
fn transports(&self) -> Transports
Available on crate feature
session only.Which transports this parser reads. The engines hand it only
datagrams of these transports: a UDP parser never sees an
ICMP message and an ICMP parser never sees a UDP payload.
Default
Transports::UDP. New in 0.25.0.Source§impl Debug for DnsUdpParser
impl Debug for DnsUdpParser
Auto Trait Implementations§
impl Freeze for DnsUdpParser
impl RefUnwindSafe for DnsUdpParser
impl Send for DnsUdpParser
impl Sync for DnsUdpParser
impl Unpin for DnsUdpParser
impl UnsafeUnpin for DnsUdpParser
impl UnwindSafe for DnsUdpParser
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K, P> DatagramParserFactory<K> for P
impl<K, P> DatagramParserFactory<K> for P
Source§fn new_parser(&mut self, _key: &K) -> P
fn new_parser(&mut self, _key: &K) -> P
Available on crate feature
session only.Source§fn transports(&self) -> Transports
fn transports(&self) -> Transports
Available on crate feature
session only.Transports the parsers read (see
DatagramParser::transports). Default Transports::UDP;
factories that clone a template delegate to it.