package mnet-dns

  1. Overview
  2. Docs

Module Mnet_dns.TransportSource

Sourcetype context

Type of a network connection initialized by connect.

Sourceand +'a io = 'a
Sourceand daemon = unit Miou.t

The abstract state of a DNS client.

Sourceand stack = private {
  1. limit : int;
  2. length : int;
  3. udp : Mnet.UDP.state;
  4. happy_eyeballs : Mnet_happy_eyeballs.t;
}

Type of everything needed to initiate a network connection (throught UDP or TCP and TLS via Happy Eyeballs).

Sourceand io_addr = [
  1. | `Plaintext of Ipaddr.t * int
  2. | `Tls of Tls.Config.client * Ipaddr.t * int
]

An address for a given context type.

Sourceand flow = [
  1. | `Plain of Mnet.TCP.buffer Mnet.TCP.flow
  2. | `TLS of Mnet_tls.t * Ke.t
]

Basic functions required by the DNS client implementation.

Sourceval bind : 'a -> ('a -> 'b) -> 'b
Sourceval lift : 'a -> 'a
Sourceval clock : unit -> int64
Sourceval rng : int -> string
Sourceval nameservers : (context * daemon) -> [> `Tcp | `Udp ] * io_addr list

Constructors and destructors.

Sourceval kill : (context * daemon) -> unit
Sourceval stack : ?buffer:(int * int) -> Mnet.UDP.state -> Mnet_happy_eyeballs.t -> stack
Sourceval create : ?nameservers:([< `Tcp | `Udp Tcp ] * io_addr list) -> timeout:int64 -> stack -> context * daemon

Operations to send and receive DNS packets.

Sourceval connect : (context * daemon) -> ([> `Tcp | `Udp ] * context, [> `Msg of string ]) result
Sourceval send_recv : context -> string -> (string, [> `Msg of string ]) result
Sourceval close : context -> unit