1
/* **************************************************************************
2
* Copyright (C) 2010 VMware, Inc. All Rights Reserved -- VMware Confidential
3
* **************************************************************************/
6
* @dndCPTransportGuestRpc.hpp --
8
* GuestRpc implementation of the dndCPTransport interface. Both vmx and guest
9
* tools use this class for DnD version 4.
13
#ifndef DND_CP_TRANSPORT_GUEST_RPC_HPP
14
#define DND_CP_TRANSPORT_GUEST_RPC_HPP
16
#include "dndCPTransport.h"
21
#include "vmware/tools/guestrpc.h"
23
#include "guest_rpc.h"
27
#define GUEST_RPC_CMD_STR_DND "dnd.transport"
28
#define GUEST_RPC_CMD_STR_CP "copypaste.transport"
29
#define GUEST_RPC_DND_DISABLE "dndDisable"
30
#define GUEST_RPC_CP_DISABLE "copyDisable"
32
class DnDCPTransportGuestRpc;
33
typedef struct GuestRpcCBCtx {
34
DnDCPTransportGuestRpc *transport;
35
TransportInterfaceType type;
38
class TransportGuestRpcTables
41
TransportGuestRpcTables(void);
42
~TransportGuestRpcTables(void);
44
RpcBase *GetRpc(TransportInterfaceType type);
45
void SetRpc(TransportInterfaceType type, RpcBase *rpc);
47
GuestRpcCmd GetCmd(TransportInterfaceType type);
49
const char *GetCmdStr(TransportInterfaceType type);
50
const char *GetDisableStr(TransportInterfaceType type);
53
RpcBase *mRpcList[TRANSPORT_INTERFACE_MAX];
55
GuestRpcCmd mCmdTable[TRANSPORT_INTERFACE_MAX];
57
const char *mCmdStrTable[TRANSPORT_INTERFACE_MAX];
58
const char *mDisableStrTable[TRANSPORT_INTERFACE_MAX];
62
class DnDCPTransportGuestRpc
63
: public DnDCPTransport
67
DnDCPTransportGuestRpc(RpcChannel *chan);
69
DnDCPTransportGuestRpc(void);
73
virtual bool RegisterRpc(RpcBase *rpc,
74
TransportInterfaceType type);
75
virtual bool UnregisterRpc(TransportInterfaceType type);
77
virtual bool SendPacket(uint32 destId,
78
TransportInterfaceType type,
81
void OnRecvPacket(TransportInterfaceType type,
85
TransportGuestRpcTables mTables;
86
GuestRpcCBCtx mCBCtx[TRANSPORT_INTERFACE_MAX];
88
RpcChannel *mRpcChannel;
89
RpcChannelCallback mRpcChanCBList[TRANSPORT_INTERFACE_MAX];
93
#endif // DND_CP_TRANSPORT_GUEST_RPC_HPP