conduit-mirage

A network connection establishment library for MirageOS
Library conduit-mirage

Dynamic flows.

type callback = Flow.flow -> unit Lwt.t

The type for callback values.

module type Handler = sig ... end

The signature for runtime handlers

TCP

The type for client connections.

type tcp_client = [
| `TCP of Ipaddr.t * int
]

address and destination port

and tcp_server = [
| `TCP of int
]

address and destination port

listening port

type 'a stackv4
val stackv4 : (module Mirage_stack.V4 with type t = 'a) -> 'a stackv4

VCHAN

type vchan_client = [
| `Vchan of [ `Direct of int * Vchan.Port.t | `Domain_socket of string * Vchan.Port.t ]
]
type vchan_server = [
| `Vchan of [ `Direct of int * Vchan.Port.t | `Domain_socket ]
]
module type VCHAN = Vchan.S.ENDPOINT with type port = Vchan.Port.t
module type XS = Xs_client_lwt.S
type vchan
type xs
val vchan : (module VCHAN) -> vchan
val xs : (module XS) -> xs

TLS

type 'a tls_client = [
| `TLS of Tls.Config.client * 'a
]
type 'a tls_server = [
| `TLS of Tls.Config.server * 'a
]

The type for client configuration values.

val sexp_of_client : client -> Sexplib0.Sexp.t
val client_of_sexp : Sexplib0.Sexp.t -> client
val __client_of_sexp__ : Sexplib0.Sexp.t -> client

The type for server configuration values.

val sexp_of_server : server -> Sexplib0.Sexp.t
val server_of_sexp : Sexplib0.Sexp.t -> server
val __server_of_sexp__ : Sexplib0.Sexp.t -> server
val client : Conduit.endp -> client Lwt.t

Resolve a conduit endpoint into a client configuration.

val server : Conduit.endp -> server Lwt.t

Resolve a confuit endpoint into a server configuration.

type conduit

The type for conduit values.

module type S = sig ... end

The signature for Conduit implementations.

include S
type t = conduit
val empty : t

The empty conduit.

module With_tcp (S : Mirage_stack.V4) : sig ... end
val with_tcp : t -> 'a stackv4 -> 'a -> t Lwt.t

Extend a conduit with an implementation for TCP.

val with_tls : t -> t Lwt.t

Extend a conduit with an implementation for TLS.

val with_vchan : t -> xs -> vchan -> string -> t Lwt.t

Extend a conduit with an implementation for VCHAN.

val connect : t -> client -> Flow.flow Lwt.t

Connect a conduit using a client configuration value.

val listen : t -> server -> callback -> unit Lwt.t

Configure a server using a conduit configuration value.