package tcpip

  1. Overview
  2. Docs

Parameters

module IP : V1_LWT.IPV4

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 error = [
  1. | `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 = src:ipv4addr -> dst:ipv4addr -> src_port:int -> buffer -> unit io
val input : listeners:(dst_port:int -> callback option) -> t -> ipv4input
val write : ?source_port:int -> dest_ip:ipv4addr -> dest_port:int -> t -> buffer -> unit io