package dns
Library
Module
Module type
Parameter
Class
Class type
A map whose keys are record types and their values are the time-to-live and the record set. The relation between key and value type is restricted by the below defined GADT.
module I : sig ... end
A tuple type whose first component is a time-to-live counter in seconds.
type _ rr =
| Soa : Soa.t rr
| Ns : Domain_name.Host_set.t with_ttl rr
| Mx : Mx_set.t with_ttl rr
| Cname : Cname.t with_ttl rr
| A : Ipv4_set.t with_ttl rr
| Aaaa : Ipv6_set.t with_ttl rr
| Ptr : Ptr.t with_ttl rr
| Srv : Srv_set.t with_ttl rr
| Dnskey : Dnskey_set.t with_ttl rr
| Caa : Caa_set.t with_ttl rr
| Tlsa : Tlsa_set.t with_ttl rr
| Sshfp : Sshfp_set.t with_ttl rr
| Txt : Txt_set.t with_ttl rr
| Unknown : I.t -> Txt_set.t with_ttl rr
(*The type of resource record sets, as GADT: the value depends on the specific constructor. There may only be a single SOA and Cname and Ptr record, while other constructors, such as address (A), contain a set of the respective types. The Unknown constructor is used for not specifically supported records. These resource records are usually persisted to disk by a server or resolver. Resource records that are only meant for a single transaction (such as EDNS or TSIG) are not in this GADT, neither is the query type ANY (which answer is computed on the fly), or zone transfer operations (AXFR/IXFR).
*)
val equal_rr : 'a key -> 'a -> 'a -> bool
equal_rr k v v'
is true
if v = v'
, false
otherwise.
val ppk : k Fmt.t
ppk ppf k
pretty-prints k
.
val names : 'a key -> 'a -> Domain_name.Host_set.t
names k v
are the referenced domain names in the given binding.
val pp_b : b Fmt.t
pp_b ppf b
pretty-prints the binding b
.
val text_b :
?origin:'a Domain_name.t ->
?default_ttl:int32 ->
'b Domain_name.t ->
b ->
string
text_b ~origin ~default_ttl domain-name binding
is the zone file format of binding
using domain-name
.
val remove_rr : 'a key -> 'a -> 'a -> 'a option
remove_rr k v rem
removes rem
from v
. If the result is an empty set, None
is returned.
val union_rr : 'a key -> 'a -> 'a -> 'a
union_rr k l r
builds the union of l
with r
. A potential r
Soa or Cname overwrites its l
counterpart.
diff ~old m
computes the difference between old
and m
. The left projection are the deleted entries, the right projection are the added entries. Soa
entries are ignored.
val text :
?origin:'a Domain_name.t ->
?default_ttl:int32 ->
'b Domain_name.t ->
'c rr ->
'c ->
string
text ~origin ~default_ttl name k v
is the zone file data for k, v
.
val get_ttl : b -> int32
get_ttl b
returns the time-to-live of b
.