package tcpip

  1. Overview
  2. Docs

Parameters

module N : Mirage_protocols_lwt.ETHIF
module A : Mirage_protocols_lwt.ARP

Signature

include Mirage_protocols_lwt.IPV4 with type ethif = N.t
type error = private [>
  1. | Mirage_protocols.Ip.error
]
val pp_error : error Fmt.t
type buffer = Cstruct.t
type ethif = N.t
type ipaddr = Ipaddr.V4.t
type prefix = Ipaddr.V4.Prefix.t
type 'a io = 'a Lwt.t
type t
val disconnect : t -> unit io
type callback = src:ipaddr -> dst:ipaddr -> buffer -> unit io
val input : t -> tcp:callback -> udp:callback -> default:(proto:int -> callback) -> buffer -> unit io
val allocate_frame : t -> dst:ipaddr -> proto:[ `ICMP | `TCP | `UDP ] -> buffer * int
val write : t -> buffer -> buffer -> (unit, error) Pervasives.result io
val writev : t -> buffer -> buffer list -> (unit, error) Pervasives.result io
val checksum : buffer -> buffer list -> int
val pseudoheader : t -> dst:ipaddr -> proto:[< `TCP | `UDP ] -> int -> buffer
val src : t -> dst:ipaddr -> ipaddr
val set_ip : t -> ipaddr -> unit io
val get_ip : t -> ipaddr list
type uipaddr = Ipaddr.t
val to_uipaddr : ipaddr -> uipaddr
val of_uipaddr : uipaddr -> ipaddr option
val mtu : t -> int
val connect : ?ip:Ipaddr.V4.t -> ?network:Ipaddr.V4.Prefix.t -> ?gateway:Ipaddr.V4.t option -> ethif -> A.t -> t Lwt.t

Connect to an ipv4 device. Default ip is Ipaddr.V4.any Default network is Ipaddr.V4.any/0 Default gateway is None.

OCaml

Innovation. Community. Security.