package nbd-unix

  1. Overview
  2. Docs
Module type
Class type

Network Block Device client and servers for Unix

type tls_role =
  1. | TlsClient of Ssl.context
  2. | TlsServer of Ssl.context
val connect : string -> int -> Lwt.t

connect hostname port connects to host:port and returns a generic_channel with no TLS ability or potential.

val cleartext_channel_of_fd : Lwt_unix.file_descr -> tls_role option -> Nbd.Channel.cleartext_channel

cleartext_channel_of_fd fd role returns a channel from an existing file descriptor. The channel will have a make_tls_channel value that corresponds to role.

val init_tls_get_ctx : ?curve:string -> certfile:string -> ciphersuites:string -> unit -> Ssl.context

Initialise the Ssl (TLS) library and then create and return a new context.

val with_block : string -> (Block.t -> 'a Lwt.t) -> 'a Lwt.t

with_block filename f calls Block.connect filename and applies f to the result, with a guarantee to call Block.disconnect afterwards.

val with_channel : Lwt_unix.file_descr -> tls_role option -> (Nbd.Channel.cleartext_channel -> 'a Lwt.t) -> 'a Lwt.t

with_channel fd role f calls cleartext_channel_of_fd fd role then applies f to the resulting channel, with a guarantee to call the channel's close_clear function afterwards.

A client allows you to access remote disks

A server allows you to expose disks to remote clients


Innovation. Community. Security.