dns

DNS client and server implementation in pure OCaml
Library dns
Module Dns . Trie
exception TrieCorrupt

Missing data from a SOA/cut node.

type dnstrie

Node of the trie

val new_trie : unit -> dnstrie

Make a new, empty trie.

val simple_lookup : Name.key -> dnstrie -> RR.dnsnode option

Simple lookup function: just walk the trie.

val lookup : Name.key -> dnstrie -> mdns:bool -> [> `Delegated of bool * RR.dnsnode | `Found of bool * RR.dnsnode * RR.dnsnode | `NXDomain of RR.dnsnode | `NXDomainNSEC of RR.dnsnode * RR.dnsnode * RR.dnsnode | `NoError of RR.dnsnode | `NoErrorNSEC of RR.dnsnode * RR.dnsnode | `Wildcard of RR.dnsnode * RR.dnsnode | `WildcardNSEC of RR.dnsnode * RR.dnsnode * RR.dnsnode ]

Look up a DNS entry in the trie, with full return.

val lookup_or_insert : Name.key -> dnstrie -> ?parent:dnstrie -> ( unit -> RR.dnsnode ) -> RR.dnsnode

Return the data mapped from this key, making new data if there is none there yet.

val fix_flags : Name.key -> dnstrie -> unit

Sort out flags for a key's node: call after adding or removing NS, SOA and KEY RRs

val iter : ( RR.dnsnode -> unit ) -> dnstrie -> unit

Iterate over all of the nodes in the trie.