package dns
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=5123d7167f5fb3a5ab70cf0b3ccc965089ec440dc07edeabf8c0568ee737a7f0
sha512=4e5945435f280591c158ab03fec19dc0c807fb713d6ee68873939899c49175f39af1fbcd135517514a3ab088993356a4c303f7dce5e18d403d4630a33bad9076
doc/dns.cache/Dns_cache/index.html
Module Dns_cacheSource
DNS cache - a least recently used cache of DNS responses
This data structure allows to insert and retrieve entries into a least recently used data structure. An `Entry weights the cardinality of the resource record map, all other entries have a weight of 1.
The time to live is preserved, and when it is exceeded the entry is no longer returned.
type rank = | ZoneFile| ZoneTransfer| AuthoritativeAnswer of Dns.Rrsig.t option| AuthoritativeAuthority of Dns.Rrsig.t option| ZoneGlue| NonAuthoritativeAnswer| Additional
The variant of the rank in the cache.
The type of a DNS cache.
empty maximum_size is an empty DNS cache with the maximum size as capacity.
type 'a entry = [ | `Entry of 'a| `No_data of [ `raw ] Domain_name.t * Dns.Soa.t| `No_domain of [ `raw ] Domain_name.t * Dns.Soa.t| `Serv_fail of [ `raw ] Domain_name.t * Dns.Soa.t
]The polymorphic variant of an entry: a resource record, or no data, no domain, or a server failure.
pp_entry ppf entry pretty-prints entry on ppf.
val get :
t ->
int64 ->
[ `raw ] Domain_name.t ->
'a Dns.Rr_map.key ->
t * ('a entry * rank, [ `Cache_miss | `Cache_drop ]) resultget cache timestamp type name retrieves the query type, name from the cache using timestamp. If the time to live is exceeded, a `Cache_drop is returned. If there is no entry in the cache, a `Cache_miss is returned.
val get_or_cname :
t ->
int64 ->
[ `raw ] Domain_name.t ->
'a Dns.Rr_map.key ->
t
* ([ 'a entry | `Alias of int32 * [ `raw ] Domain_name.t ] * rank,
[ `Cache_miss | `Cache_drop ])
resultget_or_cname cache timestamp type name is the same as get, but if a `Cache_miss is encountered, a lookup for an alias (CNAME) is done.
val get_any :
t ->
int64 ->
[ `raw ] Domain_name.t ->
t
* ([ `Entries of Dns.Rr_map.t
| `No_domain of [ `raw ] Domain_name.t * Dns.Soa.t ]
* rank,
[ `Cache_miss | `Cache_drop ])
resultget_any cache timestamp name retrieves all resource records for name in cache.
val get_nsec3 :
t ->
int64 ->
[ `raw ] Domain_name.t ->
t
* (([ `raw ] Domain_name.t * int32 * Dns.Nsec3.t * rank) list,
[ `Cache_miss | `Cache_drop ])
resultget_nsec3 cache timestamp name retrieves all nsec3 resource records for the zone name.
set cache timestamp type name rank value attempts to insert type, name, value into the cache using the timestamp and rank. If an entry already exists with a higher rank, the cache is unchanged.
remove cache name removes name from cache.