package mirage-qubes

  1. Overview
  2. Docs

https://www.qubes-os.org/doc/gui/

see qubes-gui-common/include/qubes-gui-protocol.h

val const_QUBES_MAIN_WINDOW : int32
type gui_protocol_version = {
  1. version : int32;
}
val sizeof_gui_protocol_version : int
type msg_header = {
  1. ty : int32;
    (*

    type

    *)
  2. window : int32;
  3. untrusted_len : int32;
}

struct msg_hdr

val get_msg_header_ty : string -> int32
val get_msg_header_window : string -> int32
val get_msg_header_untrusted_len : string -> int32
val sizeof_msg_header : int
type msg_map_info = {
  1. override_redirect : int32;
  2. transient_for : int32;
}

VM -> Dom0, Dom0 -> VM

val get_msg_map_info_override_redirect : string -> int32
val get_msg_map_info_transient_for : string -> int32
val sizeof_msg_map_info : int
val sizeof_msg_clipboard_req : int

Dom0 -> VM, dom0 wants us to reply with a MSG_CLIPBOARD_DATA

type msg_clipboard_data = {
  1. window_id : int32;
  2. len : int32;
}

Dom0 -> VM, VM -> Dom0: MSG_CLIPBOARD_DATA: a normal header, followed by a uint8 array of size len

val get_msg_clipboard_data_window_id : string -> int32
val get_msg_clipboard_data_len : string -> int32
val sizeof_msg_clipboard_data : int
type msg_create = {
  1. x : int32;
  2. y : int32;
  3. width : int32;
  4. height : int32;
  5. parent : int32;
  6. override_redirect : int32;
}

VM -> Dom0

val get_msg_create_x : string -> int32
val get_msg_create_y : string -> int32
val get_msg_create_width : string -> int32
val get_msg_create_height : string -> int32
val get_msg_create_parent : string -> int32
val get_msg_create_override_redirect : string -> int32
val sizeof_msg_create : int
type msg_keypress_t = {
  1. ty : int32;
  2. x : int32;
  3. y : int32;
  4. state : int32;
  5. keycode : int32;
}
val get_msg_keypress_ty : string -> int32

Dom0 -> VM

val get_msg_keypress_x : string -> int32
val get_msg_keypress_y : string -> int32
val get_msg_keypress_state : string -> int32
val get_msg_keypress_keycode : string -> int32
val sizeof_msg_keypress : int
type msg_button_t = {
  1. ty : int32;
  2. x : int32;
  3. y : int32;
  4. state : int32;
  5. button : int32;
}
val get_msg_button_ty : string -> int32
val get_msg_button_x : string -> int32
val get_msg_button_y : string -> int32
val get_msg_button_state : string -> int32
val get_msg_button_button : string -> int32
val sizeof_msg_button : int
val decode_msg_button : string -> msg_button_t option
type msg_motion_t = {
  1. x : int;
  2. y : int;
  3. state : int32;
  4. is_hint : int;
}
val get_msg_motion_x : string -> int32
val get_msg_motion_y : string -> int32
val get_msg_motion_state : string -> int32
val get_msg_motion_is_hint : string -> int32
val sizeof_msg_motion : int
val decode_msg_motion : string -> msg_motion_t option
type msg_crossing_t = {
  1. ty : int32;
  2. x : int32;
  3. y : int32;
  4. state : int32;
  5. mode : int32;
  6. detail : int32;
  7. focus : int32;
}
val get_msg_crossing_ty : string -> int32
val get_msg_crossing_x : string -> int32
val get_msg_crossing_y : string -> int32
val get_msg_crossing_state : string -> int32
val get_msg_crossing_mode : string -> int32
val get_msg_crossing_detail : string -> int32
val get_msg_crossing_focus : string -> int32
val sizeof_msg_crossing : int
val decode_msg_crossing : string -> msg_crossing_t option

VM -> Dom0, Dom0 -> VM, note that when you send this you must read the "corrected" MSG_CONFIGURE you get back and use those values instead of your own

type msg_configure_t = {
  1. x : int32;
  2. y : int32;
  3. width : int32;
  4. height : int32;
  5. override_redirect : int32;
}
val get_msg_configure_x : string -> int32
val get_msg_configure_y : string -> int32
val get_msg_configure_width : string -> int32
val get_msg_configure_height : string -> int32
val get_msg_configure_override_redirect : string -> int32
val sizeof_msg_configure : int
val decode_msg_configure : string -> msg_configure_t option
type msg_shmimage = {
  1. x : int32;
  2. y : int32;
  3. width : int32;
  4. height : int32;
}

VM -> Dom0

val get_msg_shmimage_x : string -> int32
val get_msg_shmimage_y : string -> int32
val get_msg_shmimage_width : string -> int32
val get_msg_shmimage_height : string -> int32
val sizeof_msg_shmimage : int
type msg_focus_t = {
  1. mode : int32;
  2. detail : int32;
}
type msg_focus = {
  1. ty : int32;
  2. mode : int32;
  3. detail : int32;
}

Dom0 -> VM

val get_msg_focus_ty : string -> int32
val get_msg_focus_mode : string -> int32
val get_msg_focus_detail : string -> int32
val sizeof_msg_focus : int
type msg_execute = {
  1. cmd : string;
}
val sizeof_msg_execute : int
type xconf = {
  1. w : int32;
    (*

    width

    *)
  2. h : int32;
    (*

    height

    *)
  3. depth : int32;
    (*

    bits per pixel

    *)
  4. mem : int32;
}

Dom0 -> VM: Xorg conf

val get_xconf_w : string -> int32
val get_xconf_h : string -> int32
val get_xconf_depth : string -> int32
val get_xconf_mem : string -> int32
val sizeof_xconf : int
type msg_wmname = {
  1. data : string;
}

VM -> Dom0

val sizeof_msg_wmname : int
type msg_keymap_notify = {
  1. keys : string;
}

Dom0 -> VM

val sizeof_msg_keymap_notify : int
type msg_window_hints = {
  1. flags : int32;
  2. min_width : int32;
  3. min_height : int32;
  4. max_width : int32;
  5. max_height : int32;
  6. width_inc : int32;
  7. height_inc : int32;
  8. base_width : int32;
  9. base_height : int32;
}

VM -> Dom0

val sizeof_msg_window_hints : int
type msg_window_flags = {
  1. flags_set : int32;
  2. flags_unset : int32;
}

VM -> Dom0, Dom0 -> VM

val sizeof_msg_window_flags : int
type shm_cmd = {
  1. shmid : int32;
  2. width : int32;
  3. height : int32;
  4. bpp : int32;
  5. off : int32;
  6. num_mfn : int32;
  7. domid : int32;
}

VM -> Dom0

val sizeof_shm_cmd : int
type msg_wmclass = {
  1. res_class : string;
  2. res_name : string;
}

VM -> Dom0

val sizeof_msg_wmclass : int
type msg_type =
  1. | MSG_KEYPRESS
  2. | MSG_BUTTON
  3. | MSG_MOTION
  4. | MSG_CROSSING
  5. | MSG_FOCUS
  6. | MSG_CREATE
  7. | MSG_DESTROY
  8. | MSG_MAP
  9. | MSG_UNMAP
  10. | MSG_CONFIGURE
  11. | MSG_MFNDUMP
  12. | MSG_SHMIMAGE
  13. | MSG_CLOSE
  14. | MSG_EXECUTE
  15. | MSG_CLIPBOARD_REQ
  16. | MSG_CLIPBOARD_DATA
  17. | MSG_WMNAME
  18. | MSG_KEYMAP_NOTIFY
  19. | MSG_DOCK
  20. | MSG_WINDOW_HINTS
  21. | MSG_WINDOW_FLAGS
  22. | MSG_WMCLASS
val msg_type_size : msg_type -> int option
val msg_type_to_int : msg_type -> int32
val int_to_msg_type : int32 -> msg_type option

"MFN: machine frame number - actual hw addresses" http://ccrc.web.nthu.edu.tw/ezfiles/16/1016/img/598/v14n_xen.pdf

val make_with_header : window:int32 -> ty:msg_type -> body_len:int32 -> string -> string
val make_msg_mfndump : window:int32 -> width:int32 -> height:int32 -> mfns:'a list -> string
val make_msg_shmimage : window:int32 -> x:int32 -> y:int32 -> width:int32 -> height:int32 -> string
val make_msg_create : window:int32 -> width:int32 -> height:int32 -> x:int32 -> y:int32 -> override_redirect:int32 -> parent:int32 -> string
val make_msg_map_info : window:int32 -> override_redirect:int32 -> transient_for:int32 -> string
val make_msg_wmname : window:int32 -> wmname:string -> string
val make_msg_window_hints : window:int32 -> width:int32 -> height:int32 -> string
val make_msg_configure : window:int32 -> x:int32 -> y:int32 -> width:int32 -> height:int32 -> string
module Framing : sig ... end
OCaml

Innovation. Community. Security.