package tcpip

  1. Overview
  2. Docs
include Mirage_protocols.TCP with type ipaddr = Ipaddr.V6.t and type flow = Lwt_unix.file_descr and type error = [ Mirage_protocols.Tcp.error | `Exn of exn ] and type write_error = [ Mirage_protocols.Tcp.write_error | `Exn of exn ]
type error = [
  1. | `Exn of exn
  2. | `Refused
  3. | `Timeout
]
type write_error = [
  1. | `Closed
  2. | `Exn of exn
  3. | `Refused
  4. | `Timeout
]
type ipaddr = Ipaddr.V6.t
type flow = Lwt_unix.file_descr
type t
val pp_error : error Fmt.t
val pp_write_error : write_error Fmt.t
val read : flow -> (Cstruct.t Mirage_flow.or_eof, error) Stdlib.result Lwt.t
val write : flow -> Cstruct.t -> (unit, write_error) Stdlib.result Lwt.t
val writev : flow -> Cstruct.t list -> (unit, write_error) Stdlib.result Lwt.t
val close : flow -> unit Lwt.t
val dst : flow -> ipaddr * int
val write_nodelay : flow -> Cstruct.t -> (unit, write_error) Stdlib.result Lwt.t
val writev_nodelay : flow -> Cstruct.t list -> (unit, write_error) Stdlib.result Lwt.t
val create_connection : ?keepalive:Mirage_protocols.Keepalive.t -> t -> (ipaddr * int) -> (flow, error) Stdlib.result Lwt.t
val listen : t -> port:int -> ?keepalive:Mirage_protocols.Keepalive.t -> (flow -> unit Lwt.t) -> unit
val unlisten : t -> port:int -> unit
val input : t -> src:ipaddr -> dst:ipaddr -> Cstruct.t -> unit Lwt.t
val connect : Ipaddr.V6.Prefix.t option -> t Lwt.t
val disconnect : t -> unit Lwt.t
val set_switched_off : t -> unit Lwt.t -> unit
OCaml

Innovation. Community. Security.