]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add initial host side support for request/confirm/ack unity operation.
authorVMware, Inc <>
Mon, 22 Mar 2010 22:16:09 +0000 (15:16 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 22 Mar 2010 22:16:09 +0000 (15:16 -0700)
Add RPC names and XDR definitions for requesting, confirming and acknowledging
unity operations via the host. A limited number if operation types are defined,
we currently only care about 'minimize'.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/guestRpc/unity.x
open-vm-tools/lib/include/unityCommon.h
open-vm-tools/lib/include/vm_version.h

index 5d35e63023c7060300888cc1c018beb730356d47..0e11c8c0ab437a4bd0d6b0f5115b710913689484 100644 (file)
@@ -66,6 +66,76 @@ case UNITY_OPTIONS_V1:
 };
 
 
+/*
+ * Unity Request, Confirm and Acknowledge XDR structures.
+ *
+ * The guest will request (from the host) that it be allowed to perform certain types
+ * of window operations - for example minimize, the host will later confirm that the
+ * guest can (or cannot) go ahead with the operation. Once the guest has performed
+ * the requested operation it will acknowledge its completion back to the host.
+ * In many ways this is analagous to the three way handshaking used by TCP.
+ */
+
+/*
+ * Enumerates the different versions of the messages. Note that all three types of
+ * messages (request, confirm, acknowledge) share the same version value. They must
+ * be managed together when updating versions.
+ */
+enum UnityOperationVersion {
+  UNITY_OP_V1 = 1
+};
+
+enum UnityOperations {
+   MINIMIZE = 1
+};
+
+/*
+ * The structure used to distinguish the operations of the message.
+ */
+union UnityOperationDetails switch (UnityOperations op) {
+case MINIMIZE:
+   int dummy;        /* Dummy value to avoid empty union */
+};
+
+struct UnityRequestOperationV1 {
+  /*
+   * sequence should be used to associate a request with a later confirmation so that
+   * state can be maintained within the guest as to oustanding requests (or to set
+   * an error for requests that must maintain order and do not reflect the order
+   * back correctly.).
+   */
+   int sequence;
+   int windowId;
+   UnityOperationDetails details;
+};
+
+struct UnityConfirmOperationV1 {
+   int sequence;
+   int windowId;
+   UnityOperationDetails details;
+   bool allow;
+};
+
+/*
+ * This defines the protocol for a 'unityRequestOperation' message.
+ *
+ * The union allows us to introduce new versions of the protocol later by
+ * creating new values in the enumeration, without having to change much of
+ * the code calling the (de)serialization functions.
+ *
+ * Since the union doesn't have a default case, de-serialization will fail if
+ * an unknown version is provided on the wire.
+ */
+union UnityRequestOperation switch (UnityOperationVersion ver) {
+case UNITY_OP_V1:
+   struct UnityRequestOperationV1 *unityRequestOpV1;
+};
+
+union UnityConfirmOperation switch (UnityOperationVersion ver) {
+case UNITY_OP_V1:
+   struct UnityConfirmOperationV1 *unityConfirmOpV1;
+};
+
 /*
  * Protocol to send the scraped/grabbed contents of a window to the host.
  */
index a3084855063cc02f7fea3a92c4af78404a4e8f41..a3d4253ffddf5366d936b92598d19b1384ea1534 100644 (file)
 #define UNITY_RPC_SET_OPTIONS             "unity.set.options"
 #define UNITY_RPC_WINDOW_STICK            "unity.window.stick"
 #define UNITY_RPC_WINDOW_UNSTICK          "unity.window.unstick"
+#define UNITY_RPC_CONFIRM_OPERATION       "unity.operation.confirm"
 #define UNITY_RPC_WINDOW_CONTENTS_REQUEST "unity.window.contents.request"
 
 #define GHI_RPC_GUEST_SHELL_ACTION                    "ghi.guest.shell.action"
 #define GHI_RPC_TRASH_FOLDER_STATE        "ghi.guest.trashFolder.state"
 #define GHI_RPC_TRAY_ICON_UPDATE          "ghi.guest.trayIcon.update"
 #define GHI_RPC_HOST_SHELL_ACTION         "ghi.host.shell.action"
+#define UNITY_RPC_REQUEST_OPERATION       "unity.operation.request"
+#define UNITY_RPC_ACK_OPERATION           "unity.operation.ack"
 #define UNITY_RPC_WINDOW_CONTENTS_START   "unity.window.contents.start"
 #define UNITY_RPC_WINDOW_CONTENTS_CHUNK   "unity.window.contents.chunk"
 #define UNITY_RPC_WINDOW_CONTENTS_END     "unity.window.contents.end"
@@ -780,6 +783,13 @@ desktop where the upper right <tt>{1,2}</tt> is the currently active desktop.
    @endcode
    @param[in] UnityWindowId UnityWindowId of window to unstick.
 
+   @def         UNITY_RPC_CONFIRM_OPERATION
+   @brief       Confirm (or deny) that a previously requested operation should now be performed.
+   @code
+   UNITY_RPC_CONFIRM_OPERATION XDR_REP
+   @endcode
+   @param[in] XDR_REP XDR Encoded (see unity.x) representation of arguments.
+
    @}
 */
 
@@ -848,6 +858,20 @@ desktop where the upper right <tt>{1,2}</tt> is the currently active desktop.
    @endcode
    @param[in] flag If 1, Unity is active. If 0, Unity is not active
 
+   @def         UNITY_RPC_REQUEST_OPERATION
+   @brief       Request that the host should allow the guest to perform an operation.
+   @code
+   UNITY_RPC_REQUEST_OPERATION XDR_REP
+   @endcode
+   @param[in] XDR_REP XDR Encoded (see unity.x) representation of arguments.
+
+   @def         UNITY_RPC_ACK_OPERATION
+   @brief       Acknowledge that a previously confirmed operations has been performed.
+   @code
+   UNITY_RPC_ACK_OPERATION XDR_REP
+   @endcode
+   @param[in] XDR_REP XDR Encoded (see unity.x) representation of arguments.
+
    @}
 */
 
index d378d64ac130eacde6a9b03f106b3da98d78f407..6e688278b366ff78db39033aeca3d1cd763935d5 100644 (file)
 #define PLAYER_VERSION "e.x.p"
 #define V2V_VERSION "e.x.p"
 #define V2V_FILE_VERSION 1,0,0,0
-#define FUSION_VERSION "3.0.2"
+#define FUSION_VERSION "e.x.p"
 
 // These must match VIE_FILEVERSION above
 #define SYSIMAGE_VERSION "4.0.0"