package mirage-net

  1. Overview
  2. Docs
type t
type interface
type id
val create : ?devs:int -> ?attached:string list -> (t -> interface -> id -> unit Lwt.t) -> unit Lwt.t
val attach : t -> string -> bool Lwt.t
val detach : t -> string -> bool Lwt.t
type config = [
  1. | `DHCP
  2. | `IPv4 of Nettypes.ipv4_addr * Nettypes.ipv4_addr * Nettypes.ipv4_addr list
]
val configure : interface -> config -> unit Lwt.t
val get_udpv4 : t -> Lwt_unix.file_descr
val register_udpv4_listener : t -> (Nettypes.ipv4_addr option * int) -> Lwt_unix.file_descr -> unit
val get_udpv4_listener : t -> (Nettypes.ipv4_addr option * int) -> Lwt_unix.file_descr Lwt.t
val get_intf : interface -> string
val set_promiscuous : t -> id -> (id -> Cstruct.t -> unit Lwt.t) -> unit
val inject_packet : t -> id -> Cstruct.t -> unit Lwt.t
val get_intf_name : t -> id -> string
val get_intf_mac : t -> id -> Nettypes.ethernet_mac
OCaml

Innovation. Community. Security.