package vif
Source file vif_server.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17type t = { devices: Vif_device.Hmap.t ; cookie_key: Mirage_crypto.AES.GCM.key ; metrics: Vif_metrics.t } let metrics t = t.metrics let device : type a. ('value, a) Vif_device.device -> t -> a = fun (Vif_device.Device (_, _, k)) { devices; _ } -> match Vif_device.Hmap.find k devices with | Some value -> value | None -> Fmt.failwith "Device %s not found" (Vif_device.Hmap.Key.info k).Vif_device.Device.name let { ; _ } = cookie_key