package dns
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8f3ec95acf14f574219b5440a689eae1acc2a49cb1d8a066f9b23a7ac68f44f0
sha512=7bf2d099919a410f270d157a04a8d2e1c499269cca868e19a80396cdfc84a9b844c353267cf9183f585bb9b975445b8e2d0a6dd64d85b8de19e7752ec495cbe9
doc/dns/Dns/Rr_map/index.html
Module Dns.Rr_mapSource
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.
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 : Ipaddr.V4.Set.t with_ttl rr| Aaaa : Ipaddr.V6.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| Ds : Ds_set.t with_ttl rr| Rrsig : Rrsig_set.t with_ttl rr| Nsec : Nsec.t with_ttl rr| Nsec3 : Nsec3.t with_ttl rr| Loc : Loc_set.t with_ttl rr| Null : Null_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).
*)
include Gmap.S with type 'a key = 'a rr
The type of maps from type 'a key to 'a.
Constructors
singleton key value creates a one-element map that contains a binding value for key.
Basic operations
Lookup operations
find key m returns Some v if the binding of key in m is v, or None if key is not bound m.
Insertion and removal operations
add_unless_bound key value m returns Some m', a map containing the same bindings as m, plus a binding of key to value. Or, None if key was already bound in m.
add key value m returns a map containing the same bindings as m, plus a binding of key to value. If key was already bound in m, the previous binding disappears.
remove key m returns a map containing the same bindings as m, except for key which is not bound in the returned map. If key was not bound in m, m is returned unchanged.
update k f m returns a map containing the same bindings as m, except for the binding v of k. Depending the value of v, which is f (find k m), the binding of k is added, removed, or updated.
Bindings
Selection of bindings
bindings m returns the list of all bindings in the given map m. The list is sorted with respect to the ordering over the type of the keys.
Higher-order functions
The function type for the equal operation, using a record type for "first-class" semi-explicit polymorphism.
equal p m m' tests whether the maps m and m' are equal, that is contain equal keys and associate them with equal data. p is the equality predicate used to compare the data associated with the keys.
The function type for the map operation, using a record type for "first-class" semi-explicit polymorphism.
map f m returns a map with the same domain as m, where the associated binding b has been replaced by the result of the application of f to b. The bindings are passed to f in increasing order with respect to the ordering over the type of the keys.
iter f m applies f to all bindings in m. The bindings are passed in increasing order with respect to the ordering over the type of keys.
fold f m acc computes (f bN .. (f b1 acc)), where b1 .. bN are the bindings of m in increasing order with respect to the ordering over the type of the keys.
for_all p m checks if all bindings of the map m satisfy the predicate p.
exists p m checks if at least one binding of the map m satisfies p.
filter p m returns the map with all the bindings in m that satisfy p.
The function type for the merge operation, using a record type for "first-class" semi-explicit polymorphism.
merge f m m' computes a map whose keys is a subset of keys of m and m'. The presence of each such binding, and the corresponding value, is determined with the function f.
The function type for the union operation, using a record type for "first-class" semi-explicit polymorphism.
of_int ~off i constructs a k of the provided integer.
of_string i constructs a k of the provided string.
names k v are the referenced domain names in the given binding.
val text_b :
?origin:'a Domain_name.t ->
?default_ttl:int32 ->
'b Domain_name.t ->
b ->
stringtext_b ~origin ~default_ttl domain-name binding is the zone file format of binding using domain-name.
remove_rr k v rem removes rem from v. If the result is an empty set, None is returned.
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 ->
stringtext ~origin ~default_ttl name k v is the zone file data for k, v.
val prep_for_sig :
[ `raw ] Domain_name.t ->
Rrsig.t ->
'a key ->
'a ->
([ `raw ] Domain_name.t * string, [ `Msg of string ]) result