package tcpip

  1. Overview
  2. Docs

Parameters

module IP : V1_LWT.IPV4
module TM : V1_LWT.TIME
module C : V1.CLOCK
module R : V1.RANDOM

Signature

type buffer = Cstruct.t
type ipv4 = IP.t
type ipv4addr = Ipaddr.V4.t
type ipv4input = src:Ipaddr.V4.t -> dst:Ipaddr.V4.t -> Cstruct.t -> unit Lwt.t
type flow
type error = [
  1. | `Refused
  2. | `Timeout
  3. | `Unknown of string
]
type 'a io = 'a Lwt.t
type t
val id : t -> ipv4
val connect : ipv4 -> [ `Error of error | `Ok of t ] io
val disconnect : t -> unit io
type callback = flow -> unit io
val get_dest : flow -> ipv4addr * int
val read : flow -> [ `Eof | `Error of error | `Ok of buffer ] io
val write : flow -> buffer -> unit io
val writev : flow -> buffer list -> unit io
val write_nodelay : flow -> buffer -> unit io
val writev_nodelay : flow -> buffer list -> unit io
val close : flow -> unit io
val create_connection : t -> (ipv4addr * int) -> [ `Error of error | `Ok of flow ] io
val input : t -> listeners:(int -> callback option) -> ipv4input
OCaml

Innovation. Community. Security.