The main purpose of this module is to provide an implementation of a standard DNS server based on Dns.Query and Dns.Loader.
For a basic DNS server, call process_of_zonebuf, pass the result to processor_of_process, and then invoke the resulting processor function for each received packet.
This module also provides a way to override the parsing and marshaling of DNS packets to allow extensions of DNS to be implemented, such as DNSCurve.
= Ipaddr.t * int
A tuple consisting of an IPv4 or IPv6 address and a TCP or UDP port number.
A type of function that takes an abstract request plus source and destination endpoint addresses, and asynchronously produces an answer to the request, or None if no answer is possible. For most applications the type 'a will be Dns.Packet.t, but may be different if a custom parsing/marshalling layer is required.
module type PROCESSOR : sig ... end
This type of module provides functions for parsing, marshalling and processing DNS requests to produce answers.
type 'a processor
= (module PROCESSOR)
compose process backup_process is
process unless it returns
an rcode other than NoError in which case it becomes
val process_query : Dns.Buf.t -> int -> Dns.Buf.t -> ip_endpoint -> ip_endpoint -> (module PROCESSOR) -> Dns.Buf.t option Lwt.t
process_query ibuf ibuflen obuf src dst processor
Returns a packet processor module by combining Dns.Protocol.Server with the specified packet processing function.