Up

module Query

: sig
#
type answer = {
# rcode
: Packet.rcode;
# aa
: bool;
# answer
: Packet.rr list;
# authority
: Packet.rr list;
# additional
: Packet.rr list;
}

Partially-marshalled query response; that is, it has been uncompacted from the compact [root:Trie] representation, but not yet rendered into a [root: Cstruct].buf.

#
type filter = Name.domain_name -> RR.rrset -> RR.rrset
#
type flush = Name.domain_name -> Packet.rdata -> bool
#
val response_of_answer : ?mdns:bool -> Packet.t -> answer -> Packet.t

response_of_answer query answer is the Packet.t constructed from the answer to the query

#
val answer_of_response : ?preserve_aa:bool -> Packet.t -> answer

answer_of_response response is the answer corresponding to the upstream response for proxied or forwarded response.

#
val answer : ?dnssec:bool -> ?mdns:bool -> ?filter:filter -> ?flush:flush -> Name.domain_name -> Packet.q_type -> Trie.dnstrie -> answer

Answer a query about [root:domain_name], given a query type [root:q_type] and a [root:Trie] of DNS data.

Returns the answer
#
val answer_multiple : ?dnssec:bool -> ?mdns:bool -> ?filter:filter -> ?flush:flush -> Packet.question list -> Trie.dnstrie -> answer

Answer one or more [root:questions] given a [root:Trie] of DNS data.

Returns the answer
#
val create : ?dnssec:bool -> id:int -> Packet.q_class -> Packet.q_type -> Name.domain_name -> Packet.t

create ~id q_class q_type q_name creates a query for q_name with the supplied id, q_class, and q_type.

end