package dns

  1. Overview
  2. Docs

Map DNS query-response mechanism onto trie database.

  • author Tim Deegan
  • author Richard Mortier <mort\@cantab.net> (documentation)
type answer = {
  1. rcode : Packet.rcode;
  2. aa : bool;
  3. answer : Packet.rr list;
  4. authority : Packet.rr list;
  5. additional : Packet.rr list;
}

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

type filter = Name.t -> RR.rrset -> RR.rrset
type flush = Name.t -> 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.t -> Packet.q_type -> Trie.dnstrie -> answer

Answer a query about Domain_name, given a query type q_type and a Trie of DNS data.

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

Answer one or more questions given a Trie of DNS data.

val create : ?dnssec:bool -> id:int -> Packet.q_class -> Packet.q_type -> Name.t -> 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.

OCaml

Innovation. Community. Security.