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
00041 #define RPCDEBUG_ASSERT(test, retval) do { \
00042 CU_ASSERT(test); \
00043 g_return_val_if_fail(test, retval); \
00044 } while (0)
00045
00046
00047 struct RpcDebugPlugin;
00048
00053 typedef gboolean (*RpcDebugRecvFn)(char *data,
00054 size_t dataLen,
00055 char **result,
00056 size_t *resultLen);
00057
00059 typedef struct RpcDebugRecvMapping {
00060 gchar *name;
00061 RpcDebugRecvFn recvFn;
00066 gpointer xdrProc;
00068 size_t xdrSize;
00069 } RpcDebugRecvMapping;
00070
00071
00077 typedef gboolean (*RpcDebugValidateFn)(RpcInData *data,
00078 gboolean ret);
00079
00081 typedef struct RpcDebugMsgMapping {
00082 gchar *message;
00083 size_t messageLen;
00084 RpcDebugValidateFn validateFn;
00085 gboolean freeMsg;
00086 } RpcDebugMsgMapping;
00087
00089 typedef struct RpcDebugMsgList {
00090 RpcDebugMsgMapping *mappings;
00091 size_t index;
00092 } RpcDebugMsgList;
00093
00094
00102 typedef gboolean (*RpcDebugSendFn)(RpcDebugMsgMapping *rpcdata);
00103
00105 typedef void (*RpcDebugShutdownFn)(ToolsAppCtx *ctx,
00106 struct RpcDebugPlugin *plugin);
00107
00112 typedef struct RpcDebugPlugin {
00114 RpcDebugRecvMapping *recvFns;
00119 RpcDebugRecvFn dfltRecvFn;
00121 RpcDebugSendFn sendFn;
00123 RpcDebugShutdownFn shutdownFn;
00124 } RpcDebugPlugin;
00125
00126
00131 typedef RpcDebugPlugin *(*RpcDebugOnLoadFn)(ToolsAppCtx *ctx);
00132
00133 struct RpcDebugLibData;
00134
00140 typedef struct RpcDebugLibData {
00141 RpcChannel * (*newDebugChannel) (ToolsAppCtx *,
00142 struct RpcDebugLibData *);
00143 int (*run) (ToolsAppCtx *,
00144 gpointer runMainLoop,
00145 gpointer runData,
00146 struct RpcDebugLibData *);
00147 RpcDebugPlugin *debugPlugin;
00148 } RpcDebugLibData;
00149
00151 typedef RpcDebugLibData *(* RpcDebugInitializeFn)(ToolsAppCtx *, gchar *);
00152
00153
00154 G_BEGIN_DECLS
00155
00156 void
00157 RpcDebug_DecRef(ToolsAppCtx *ctx);
00158
00159 void
00160 RpcDebug_IncRef(void);
00161
00162 RpcDebugLibData *
00163 RpcDebug_Initialize(ToolsAppCtx *ctx,
00164 gchar *dbgPlugin);
00165
00166 gboolean
00167 RpcDebug_SendNext(RpcDebugMsgMapping *rpcdata,
00168 RpcDebugMsgList *list);
00169
00170 void
00171 RpcDebug_SetResult(const char *str,
00172 char **res,
00173 size_t *len);
00174
00175 G_END_DECLS
00176
00179 #endif
00180