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) Hashtbl.t;
}
val get_udpv4v6_listening_fd : t -> int -> Lwt_unix.file_descr list Lwt.t
type error = [
  1. | `Sendto_failed
  2. | `Different_ip_version
]
val pp_error : Format.formatter -> [< `Different_ip_version | `Sendto_failed ] -> unit
val connect : ipv4_only:bool -> ipv6_only:bool -> Ipaddr.V4.Prefix.t -> Ipaddr.V6.Prefix.t option -> t Lwt.t
val disconnect : 'a -> unit Lwt.t
val input : listeners:'a -> 'b -> unit Lwt.t
val create_socket : t -> ?port:int -> ('a, 'b) Ipaddr.v4v6 -> (Lwt_unix.file_descr, [> `Different_ip_version ]) result 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 ]) result Lwt.t
OCaml

Innovation. Community. Security.