package tcpip

  1. Overview
  2. Docs
type ipaddr = Ipaddr.t
type ipinput = unit Lwt.t
type callback = src:ipaddr -> dst:ipaddr -> src_port:int -> Cstruct.t -> unit Lwt.t
val any_v6 : Unix.inet_addr
type t = {
  1. interface : [ `Any | `Ip of Unix.inet_addr * Unix.inet_addr | `V4_only of Unix.inet_addr | `V6_only of Unix.inet_addr ];
  2. listen_fds : (int, Lwt_unix.file_descr * Lwt_unix.file_descr option) Stdlib.Hashtbl.t;
}
val get_udpv4v6_listening_fd : ?preserve:bool -> ?v4_or_v6:[< `Both | `V4 | `V6 Both ] -> t -> int -> (bool * Lwt_unix.file_descr list) Lwt.t
type error = [
  1. | `Sendto_failed
  2. | `Different_ip_version
]
val pp_error : Stdlib.Format.formatter -> [< `Different_ip_version | `Sendto_failed ] -> unit
val close : Lwt_unix.file_descr -> unit Lwt.t
val connect : ipv4_only:bool -> ipv6_only:bool -> Ipaddr.V4.Prefix.t -> Ipaddr.V6.Prefix.t option -> t Lwt.t
val disconnect : t -> unit Lwt.t
val input : listeners:'a -> 'b -> unit Lwt.t
val write : ?src:'a -> ?src_port:int -> ?ttl:'b -> dst:Ipaddr.t -> dst_port:int -> t -> Cstruct.t -> (unit, [> `Different_ip_version | `Sendto_failed ]) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.