package mirage-vnetif

  1. Overview
  2. Docs

Module Basic_backend.MakeSource

Sourcetype 'a io = 'a Lwt.t
Sourcetype buffer = Cstruct.t
Sourcetype id = int
Sourcetype macaddr = Macaddr.t
Sourcetype t
Sourceval create : ?yield:(unit -> unit io) -> ?use_async_readers:bool -> unit -> t
Sourceval register : t -> (id, Mirage_net.Net.error) result
Sourceval unregister : t -> id -> unit io

Unregister the listener and callback function

Sourceval unregister_and_flush : t -> id -> unit io

Unregister the listener, then block until all callbacks return for this * id. Useful when listeners are called in async.

Sourceval mac : t -> id -> macaddr
Sourceval write : t -> id -> size:int -> (buffer -> int) -> (unit, Mirage_net.Net.error) result io
Sourceval set_listen_fn : t -> id -> (buffer -> unit io) -> unit