open-vm-tools 10.1.5

rpcdebug.h
Go to the documentation of this file.
1 /*********************************************************
2 * Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published
6 * by the Free Software Foundation version 2.1 and no later version.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11 * License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
16 *
17 *********************************************************/
18
19 #ifndef _VMWARE_TOOLS_RPCDEBUG_H_
20 #define _VMWARE_TOOLS_RPCDEBUG_H_
21
32 #include "vmware/tools/plugin.h"
33
34
41 #define RPCDEBUG_ASSERT(test, retval) do { \
42 CU_ASSERT(test); \
43 g_return_val_if_fail(test, retval); \
44 } while (0)
45
46
47 struct RpcDebugPlugin;
48
53 typedef gboolean (*RpcDebugRecvFn)(char *data,
54 size_t dataLen,
55 char **result,
56 size_t *resultLen);
57
59 typedef struct RpcDebugRecvMapping {
60 gchar *name;
61 RpcDebugRecvFn recvFn;
66 gpointer xdrProc;
68 size_t xdrSize;
69 } RpcDebugRecvMapping;
70
71
77 typedef gboolean (*RpcDebugValidateFn)(RpcInData *data,
78 gboolean ret);
79
81 typedef struct RpcDebugMsgMapping {
82 gchar *message;
83 size_t messageLen;
84 RpcDebugValidateFn validateFn;
85 gboolean freeMsg;
86 } RpcDebugMsgMapping;
87
89 typedef struct RpcDebugMsgList {
90 RpcDebugMsgMapping *mappings;
91 size_t index;
92 } RpcDebugMsgList;
93
94
102 typedef gboolean (*RpcDebugSendFn)(RpcDebugMsgMapping *rpcdata);
103
105 typedef void (*RpcDebugShutdownFn)(ToolsAppCtx *ctx,
106 struct RpcDebugPlugin *plugin);
107
112 typedef struct RpcDebugPlugin {
114 RpcDebugRecvMapping *recvFns;
119 RpcDebugRecvFn dfltRecvFn;
121 RpcDebugSendFn sendFn;
123 RpcDebugShutdownFn shutdownFn;
125 ToolsPluginData *plugin;
126 } RpcDebugPlugin;
127
128
133 typedef RpcDebugPlugin *(*RpcDebugOnLoadFn)(ToolsAppCtx *ctx);
134
135 struct RpcDebugLibData;
136
142 typedef struct RpcDebugLibData {
143 RpcChannel * (*newDebugChannel) (ToolsAppCtx *,
144 struct RpcDebugLibData *);
145 int (*run) (ToolsAppCtx *,
146 gpointer runMainLoop,
147 gpointer runData,
148 struct RpcDebugLibData *);
149 RpcDebugPlugin *debugPlugin;
150 } RpcDebugLibData;
151
153 typedef RpcDebugLibData *(* RpcDebugInitializeFn)(ToolsAppCtx *, gchar *);
154
155
156 G_BEGIN_DECLS
157
158 void
159 RpcDebug_DecRef(ToolsAppCtx *ctx);
160
161 void
162 RpcDebug_IncRef(void);
163
164 RpcDebugLibData *
165 RpcDebug_Initialize(ToolsAppCtx *ctx,
166 gchar *dbgPlugin);
167
168 gboolean
169 RpcDebug_SendNext(RpcDebugMsgMapping *rpcdata,
170 RpcDebugMsgList *list);
171
172 void
173 RpcDebug_SetResult(const char *str,
174 char **res,
175 size_t *len);
176
177 G_END_DECLS
178
181 #endif /* _VMWARE_TOOLS_RPCDEBUG_H_ */
182
RpcDebug_IncRef
void RpcDebug_IncRef(void)
Definition: vmrpcdbg.c:173
RpcDebugLibData
struct RpcDebugLibData RpcDebugLibData
RpcInData
Definition: guestrpc.h:51
RpcDebug_SendNext
gboolean RpcDebug_SendNext(RpcDebugMsgMapping *rpcdata, RpcDebugMsgList *list)
Definition: vmrpcdbg.c:232
plugin.h
RpcDebugRecvMapping
Definition: rpcdebug.h:59
RpcDebugLibData
Definition: rpcdebug.h:142
RpcDebugPlugin::shutdownFn
RpcDebugShutdownFn shutdownFn
Definition: rpcdebug.h:123
RpcDebugRecvMapping
struct RpcDebugRecvMapping RpcDebugRecvMapping
RpcDebug_SetResult
void RpcDebug_SetResult(const char *str, char **res, size_t *len)
Definition: vmrpcdbg.c:256
RpcDebugMsgMapping
Definition: rpcdebug.h:81
RpcDebugMsgList
Definition: rpcdebug.h:89
RpcDebugMsgMapping
struct RpcDebugMsgMapping RpcDebugMsgMapping
RpcDebugValidateFn
gboolean(* RpcDebugValidateFn)(RpcInData *data, gboolean ret)
Definition: rpcdebug.h:77
RpcDebugPlugin
struct RpcDebugPlugin RpcDebugPlugin
RpcDebugSendFn
gboolean(* RpcDebugSendFn)(RpcDebugMsgMapping *rpcdata)
Definition: rpcdebug.h:102
RpcDebugPlugin::dfltRecvFn
RpcDebugRecvFn dfltRecvFn
Definition: rpcdebug.h:119
RpcDebugPlugin::plugin
ToolsPluginData * plugin
Definition: rpcdebug.h:125
RpcDebug_Initialize
RpcDebugLibData * RpcDebug_Initialize(ToolsAppCtx *ctx, gchar *dbgPlugin)
Definition: vmrpcdbg.c:190
RpcDebugShutdownFn
void(* RpcDebugShutdownFn)(ToolsAppCtx *ctx, struct RpcDebugPlugin *plugin)
Definition: rpcdebug.h:105
RpcDebugPlugin
Definition: rpcdebug.h:112
ToolsPluginData
Definition: plugin.h:499
RpcDebugPlugin::sendFn
RpcDebugSendFn sendFn
Definition: rpcdebug.h:121
RpcDebugRecvFn
gboolean(* RpcDebugRecvFn)(char *data, size_t dataLen, char **result, size_t *resultLen)
Definition: rpcdebug.h:53
RpcDebug_DecRef
G_BEGIN_DECLS void RpcDebug_DecRef(ToolsAppCtx *ctx)
Definition: vmrpcdbg.c:159
ToolsAppCtx
Definition: plugin.h:241
RpcDebugPlugin::recvFns
RpcDebugRecvMapping * recvFns
Definition: rpcdebug.h:114
RpcDebugRecvMapping::xdrSize
size_t xdrSize
Definition: rpcdebug.h:68
RpcDebugRecvMapping::xdrProc
gpointer xdrProc
Definition: rpcdebug.h:66
RpcDebugMsgList
struct RpcDebugMsgList RpcDebugMsgList