package mirage-protocols

  1. Overview
  2. Docs

ICMP module

include Mirage_device.S
type +'a io

The type for potentially blocking I/O operation

type t

The type representing the internal state of the device

val disconnect : t -> unit io

Disconnect from the device. While this might take some time to complete, it can never result in an error.

type ipaddr

The type for IP addresses.

type buffer

The type for buffers.

type error

The type for ICMP errors.

val pp_error : error Fmt.t

pp_error is the pretty-printer for errors.

val input : t -> src:ipaddr -> dst:ipaddr -> buffer -> unit io

input t src dst buffer reacts to the ICMP message in buffer.

val write : t -> dst:ipaddr -> ?ttl:int -> buffer -> (unit, error) Pervasives.result io

write t dst ~ttl buffer sends the ICMP message in buffer to dst over IP. Passes the time-to-live (ttl) to the IP stack if given.

OCaml

Innovation. Community. Security.