package tcpip

  1. Overview
  2. Docs
type buffer = Cstruct.t
type ipv4addr = Ipaddr.V4.t
type 'a io = 'a Lwt.t
type ipv4 = Ipaddr.V4.t option
type ipv4input = unit Lwt.t
type callback = src:ipv4addr -> dst:ipv4addr -> src_port:int -> buffer -> unit io
type t = {
  1. interface : Unix.inet_addr;
  2. listen_fds : (Unix.inet_addr * int, Lwt_unix.file_descr) Hashtbl.t;
}
val get_udpv4_listening_fd : t -> int -> Lwt_unix.file_descr
type error = [
  1. | `Unknown of string
]
val connect : ipv4 -> [> `Ok of t ] Lwt.t
val disconnect : 'a -> unit Lwt.t
val id : t -> Ipaddr.V4.t option
val input : listeners:'a -> 'b -> 'c Lwt.t
val write : ?source_port:int -> dest_ip:Ipaddr.V4.t -> dest_port:int -> t -> Cstruct.t -> unit Lwt.t
OCaml

Innovation. Community. Security.