package dns-server

  1. Overview
  2. Docs
type s

The state of a secondary DNS server.

val data : s -> Dns_trie.t

data s is the zone data of s.

val with_data : s -> Dns_trie.t -> s

with_data s trie is s with its data replaced by trie.

val create : ?primary:Ipaddr.V4.t -> tsig_verify:Dns.Tsig_op.verify -> tsig_sign:Dns.Tsig_op.sign -> rng:(int -> Cstruct.t) -> ('a Domain_name.t * Dns.Dnskey.t) list -> s

create ~primary ~tsig_verify ~tsig_sign ~rng keys creates a secondary DNS server state.

val handle_packet : s -> Ptime.t -> int64 -> Ipaddr.V4.t -> Dns.Packet.t -> 'a Domain_name.t option -> s * Dns.Packet.t option * (Ipaddr.V4.t * Cstruct.t) option

handle_packet s now ts ip proto key t handles the incoming packet.

val handle_buf : s -> Ptime.t -> int64 -> Dns.proto -> Ipaddr.V4.t -> Cstruct.t -> s * Cstruct.t option * (Ipaddr.V4.t * Cstruct.t) option

handle_buf s now ts proto src buf decodes buf, processes with handle_packet, and encodes the results.

val timer : s -> Ptime.t -> int64 -> s * (Ipaddr.V4.t * Cstruct.t list) list

timer s now ts may request SOA or retransmit AXFR.

val closed : s -> Ptime.t -> int64 -> Ipaddr.V4.t -> s * Cstruct.t list

closed s now ts ip marks ip as closed, the returned buffers (SOA requests) should be sent to ip.

OCaml

Innovation. Community. Security.