package tcpip

  1. Overview
  2. Docs

Parameters

module Ipv4 : V1_LWT.IPV4
module Time : V1_LWT.TIME
module Clock : V1.CLOCK
module Random : V1.RANDOM

Signature

type t
type pcb
type connection = pcb * unit Lwt.t
type connection_result = [
  1. | `Ok of connection
  2. | `Rst
  3. | `Timeout
]
val ip : t -> Ipv4.t
val input : t -> listeners:(int -> (pcb -> unit Lwt.t) option) -> src:Ipaddr.V4.t -> dst:Ipaddr.V4.t -> Cstruct.t -> unit Lwt.t
val connect : t -> dest_ip:Ipaddr.V4.t -> dest_port:int -> connection_result Lwt.t
val close : pcb -> unit Lwt.t
val get_dest : pcb -> Ipaddr.V4.t * 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 Lwt.t
val writev : pcb -> Cstruct.t list -> unit Lwt.t
val write_nodelay : pcb -> Cstruct.t -> unit Lwt.t
val writev_nodelay : pcb -> Cstruct.t list -> unit Lwt.t
val create : Ipv4.t -> t
OCaml

Innovation. Community. Security.