2015-12-30 08:59:13 -05:00
|
|
|
(* Copyright (C) 2015, Thomas Leonard <thomas.leonard@unikernel.com>
|
|
|
|
See the README file for details. *)
|
|
|
|
|
|
|
|
(** The link from us to NetVM (and, through that, to the outside world). *)
|
|
|
|
|
2017-03-02 09:52:55 -05:00
|
|
|
open Fw_utils
|
2015-12-30 08:59:13 -05:00
|
|
|
|
2020-04-29 10:06:48 -04:00
|
|
|
[@@@ocaml.warning "-67"]
|
2022-03-30 03:12:01 -04:00
|
|
|
module Make (R: Mirage_random.S)(Clock : Mirage_clock.MCLOCK)(Time : Mirage_time.S) : sig
|
2020-04-29 10:06:48 -04:00
|
|
|
type t
|
2015-12-30 08:59:13 -05:00
|
|
|
|
2020-04-29 10:06:48 -04:00
|
|
|
val connect : Dao.network_config -> t Lwt.t
|
|
|
|
(** Connect to our NetVM (gateway). *)
|
2015-12-30 08:59:13 -05:00
|
|
|
|
2020-04-29 10:06:48 -04:00
|
|
|
val interface : t -> interface
|
|
|
|
(** The network interface to NetVM. *)
|
2015-12-30 08:59:13 -05:00
|
|
|
|
2020-04-29 10:06:48 -04:00
|
|
|
val listen : t -> (unit -> int64) -> (Udp_packet.t * Cstruct.t) Lwt_mvar.t -> Router.t -> unit Lwt.t
|
|
|
|
(** Handle incoming frames from NetVM. *)
|
|
|
|
|
|
|
|
val send_dns_client_query: t -> src_port:int-> dst:Ipaddr.V4.t -> dst_port:int -> Cstruct.t -> (unit, [`Msg of string]) result Lwt.t
|
|
|
|
end
|