Library
Module
Module type
Parameter
Class
Class type
Implementation of the network interface using raw sockets.
include Mirage_net_lwt.S
The type for network errors.
type page_aligned_buffer = Io_page.t
The type for page-aligned memory buffers.
type buffer = Cstruct.t
The type for memory buffers.
type macaddr = Macaddr.t
The type for unique MAC identifiers for the device.
include Mirage_device.S with type 'a io = 'a Lwt.t
type 'a io = 'a Lwt.t
The type for potentially blocking I/O operation
val write : t -> buffer -> (unit, error) Pervasives.result io
write nf buf
outputs buf
to netfront nf
.
val writev : t -> buffer list -> (unit, error) Pervasives.result io
writev nf bufs
output a list of buffers to netfront nf
as a single packet.
listen nf fn
is a blocking operation that calls fn buf
with every packet that is read from the interface. The function can be stopped by calling disconnect
in the device layer.
val get_stats_counters : t -> Mirage_net.stats
Obtain the most recent snapshot of the device statistics.
val reset_stats_counters : t -> unit
Reset the statistics associated with this device to their defaults.
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.