package tcpip

  1. Overview
  2. Docs

Parameters

Signature

type t

Overall state of the TCP stack

type pcb
type error = private [>
  1. | Mirage_protocols.Tcp.error
]
type write_error = private [>
  1. | Mirage_protocols.Tcp.write_error
]
val pp_error : error Fmt.t
val pp_write_error : write_error Fmt.t
type connection = pcb * unit Lwt.t

State for an individual connection

val pp_pcb : Format.formatter -> pcb -> unit
val pp_stats : Format.formatter -> t -> unit
val ip : t -> Ip.t
val input : t -> listeners:(int -> (pcb -> unit Lwt.t) option) -> src:Ip.ipaddr -> dst:Ip.ipaddr -> Cstruct.t -> unit Lwt.t
val connect : t -> dst:Ip.ipaddr -> dst_port:int -> (connection, error) Result.result Lwt.t
val close : pcb -> unit Lwt.t
val dst : pcb -> Ip.ipaddr * int
val read : pcb -> Cstruct.t option Lwt.t
val write_available : pcb -> int
val write_wait_for : pcb -> int -> unit Lwt.t
val write : pcb -> Cstruct.t -> (unit, write_error) Result.result Lwt.t
val writev : pcb -> Cstruct.t list -> (unit, write_error) Result.result Lwt.t
val write_nodelay : pcb -> Cstruct.t -> (unit, write_error) Result.result Lwt.t
val writev_nodelay : pcb -> Cstruct.t list -> (unit, write_error) Result.result Lwt.t
val create : Ip.t -> Clock.t -> t
OCaml

Innovation. Community. Security.