package mirage-net-fd

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Implementation of the network interface using raw sockets.

include Mirage_net_lwt.S
type error = private [>
  1. | Mirage_device.error
]
val pp_error : error Fmt.t
type page_aligned_buffer = Io_page.t
type buffer = Cstruct.t
type macaddr = Macaddr.t
type 'a io = 'a Lwt.t
type t
val disconnect : t -> unit io
val write : t -> buffer -> (unit, error) Stdlib.result io
val writev : t -> buffer list -> (unit, error) Stdlib.result io
val listen : t -> (buffer -> unit io) -> (unit, error) Stdlib.result io
val mac : t -> macaddr
val get_stats_counters : t -> Mirage_net.stats
val reset_stats_counters : t -> unit
val connect : ?mac:Macaddr.t -> Unix.file_descr -> t Lwt.t

connect ?mac fd connects to the given file descriptor. The caller is responsible to open a raw socket and set-up the file descriptor properly. If mac is not specified, generate a random one.

OCaml

Innovation. Community. Security.