Module Dns__Loader

How to build up a DNS trie from separate RRs.

type db = {
trie : Dns.Trie.dnstrie;
mutable names : (Dns.Name.keyDns.RR.dnsnodeHashtbl.t;
}

Loader database: the DNS trie plus a hash table of other names in use.

val new_db : unit ‑> db

Make a new, empty database.

val no_more_updates : db ‑> unit

Call when guaranteed there will be no more updates.

Insert RRs in the database: args are rdata, ttl, owner, db.

val add_generic_rr : int ‑> string ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_a_rr : Ipaddr.V4.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_aaaa_rr : Ipaddr.V6.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_ns_rr : Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_cname_rr : Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_soa_rr : Dns.Name.t ‑> Dns.Name.t ‑> Dns.RR.serial ‑> int32 ‑> int32 ‑> int32 ‑> int32 ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_mb_rr : Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_mg_rr : Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_mr_rr : Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_wks_rr : Ipaddr.V4.t ‑> Cstruct.byte ‑> string ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_ptr_rr : Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_hinfo_rr : string ‑> string ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_minfo_rr : Dns.Name.t ‑> Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_mx_rr : int ‑> Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_txt_rr : string list ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_rp_rr : Dns.Name.t ‑> Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_afsdb_rr : int ‑> Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_x25_rr : string ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_isdn_rr : string ‑> string option ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_rt_rr : int ‑> Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_srv_rr : int ‑> int ‑> int ‑> Dns.Name.t ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_dnskey_rr : int ‑> int ‑> string ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_ds_rr : int ‑> int ‑> int ‑> string ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
val add_rrsig_rr : string ‑> int ‑> int ‑> int32 ‑> int32 ‑> int32 ‑> int ‑> Dns.Name.t ‑> string ‑> int32 ‑> Dns.Name.t ‑> db ‑> unit
exception TTLMismatch

Raised if we already had an RRSet for this name and type, but with a different TTL. Also possible: Trie.BadName.

N.B. If TTLMismatch is raised, the RR was successfully added, and the RRSet now has the new ttl.