Skip to main content

parse_query_multi

Function parse_query_multi 

Source
pub fn parse_query_multi(
    packet: &[u8],
) -> Result<Vec<QuestionOutcome>, DnsParseError>
Expand description

Parse every question declared by QDCOUNT and return one QuestionOutcome per question.

QDCOUNT == 0 is rejected with DnsParseError::QdcountZero; any per-question parse failure (truncation, label overflow, unsupported class, etc.) aborts the whole walk and surfaces the error — partial outcomes are not returned. This matches the single-question API’s “drop on malformed” stance: a multi-question packet with one bad question is treated as malformed in its entirety.

The single-question API (parse_query) and this multi-question API are equivalent on a packet with exactly one question: both surface the same DnsQueryView for that question.