00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _VMWARE_TOOLS_RPCDEBUG_H_
00020 #define _VMWARE_TOOLS_RPCDEBUG_H_
00021
00032 #include "vmware/tools/plugin.h"
00033
00034 struct RpcDebugPlugin;
00035
00040 typedef gboolean (*RpcDebugRecvFn)(char *data,
00041 size_t dataLen,
00042 char **result,
00043 size_t *resultLen);
00044
00046 typedef struct RpcDebugRecvMapping {
00047 gchar *name;
00048 RpcDebugRecvFn recvFn;
00053 gpointer xdrProc;
00055 size_t xdrSize;
00056 } RpcDebugRecvMapping;
00057
00058
00064 typedef gboolean (*RpcDebugValidateFn)(RpcInData *data,
00065 gboolean ret);
00066
00068 typedef struct RpcDebugMsgMapping {
00069 gchar *message;
00070 size_t messageLen;
00071 RpcDebugValidateFn validateFn;
00072 gboolean freeMsg;
00073 } RpcDebugMsgMapping;
00074
00076 typedef struct RpcDebugMsgList {
00077 RpcDebugMsgMapping *mappings;
00078 size_t index;
00079 } RpcDebugMsgList;
00080
00081
00089 typedef gboolean (*RpcDebugSendFn)(RpcDebugMsgMapping *rpcdata);
00090
00092 typedef void (*RpcDebugShutdownFn)(ToolsAppCtx *ctx,
00093 struct RpcDebugPlugin *plugin);
00094
00099 typedef struct RpcDebugPlugin {
00101 RpcDebugRecvMapping *recvFns;
00106 RpcDebugRecvFn dfltRecvFn;
00108 RpcDebugSendFn sendFn;
00110 RpcDebugShutdownFn shutdownFn;
00111 } RpcDebugPlugin;
00112
00113
00118 typedef RpcDebugPlugin *(*RpcDebugOnLoadFn)(ToolsAppCtx *ctx);
00119
00120 struct RpcDebugLibData;
00121
00127 typedef struct RpcDebugLibData {
00128 RpcChannel * (*newDebugChannel) (ToolsAppCtx *, struct RpcDebugLibData *);
00129 void (*shutdown) (ToolsAppCtx *, struct RpcDebugLibData *);
00130 RpcDebugPlugin *debugPlugin;
00131 } RpcDebugLibData;
00132
00134 typedef RpcDebugLibData *(* RpcDebugInitializeFn)(ToolsAppCtx *, gchar *);
00135
00136
00137 G_BEGIN_DECLS
00138
00139 void
00140 RpcDebug_DecRef(ToolsAppCtx *ctx);
00141
00142 void
00143 RpcDebug_IncRef(void);
00144
00145 RpcDebugLibData *
00146 RpcDebug_Initialize(ToolsAppCtx *ctx,
00147 gchar *dbgPlugin);
00148
00149 RpcChannel *
00150 RpcDebug_NewDebugChannel(ToolsAppCtx *ctx,
00151 RpcDebugLibData *data);
00152
00153 gboolean
00154 RpcDebug_SendNext(RpcDebugMsgMapping *rpcdata,
00155 RpcDebugMsgList *list);
00156
00157 void
00158 RpcDebug_SetResult(const char *str,
00159 char **res,
00160 size_t *len);
00161
00162 void
00163 RpcDebug_Shutdown(ToolsAppCtx *ctx,
00164 RpcDebugLibData *data);
00165
00166 G_END_DECLS
00167
00170 #endif
00171