package tcpip

  1. Overview
  2. Docs

Parameters

module R : Mirage_random.S
module C : Mirage_clock.MCLOCK
module E : Mirage_protocols.ETHERNET
module A : Mirage_protocols.ARP

Signature

include Mirage_protocols.IP with type ipaddr = Ipaddr.V4.t
type error = private [>
  1. | Mirage_protocols.Ip.error
]
val pp_error : error Fmt.t
type ipaddr = Ipaddr.V4.t
val pp_ipaddr : ipaddr Fmt.t
type t
val disconnect : t -> unit Lwt.t
type callback = src:ipaddr -> dst:ipaddr -> Cstruct.t -> unit Lwt.t
val input : t -> tcp:callback -> udp:callback -> default:(proto:int -> callback) -> Cstruct.t -> unit Lwt.t
val write : t -> ?fragment:bool -> ?ttl:int -> ?src:ipaddr -> ipaddr -> Mirage_protocols.Ip.proto -> ?size:int -> (Cstruct.t -> int) -> Cstruct.t list -> (unit, error) Stdlib.result Lwt.t
val pseudoheader : t -> ?src:ipaddr -> ipaddr -> Mirage_protocols.Ip.proto -> int -> Cstruct.t
val src : t -> dst:ipaddr -> ipaddr
val get_ip : t -> ipaddr list
val mtu : t -> dst:ipaddr -> int
val connect : ?no_init:bool -> cidr:Ipaddr.V4.Prefix.t -> ?gateway:Ipaddr.V4.t -> ?fragment_cache_size:int -> E.t -> A.t -> t Lwt.t

connect ~no_init ~cidr ~gateway ~fragment_cache_size eth arp connects the ipv4 device using cidr and gateway for network communication. The size of the IPv4 fragment cache (for reassembly) can be provided in byte-size of fragments (defaults to 256kB).

OCaml

Innovation. Community. Security.