open-vm-tools 12.4.0
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;
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;
87 
89 typedef struct RpcDebugMsgList {
90  RpcDebugMsgMapping *mappings;
91  size_t index;
93 
94 
102 typedef gboolean (*RpcDebugSendFn)(RpcDebugMsgMapping *rpcdata);
103 
105 typedef void (*RpcDebugShutdownFn)(ToolsAppCtx *ctx,
106  struct RpcDebugPlugin *plugin);
107 
112 typedef struct 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;
151 
153 typedef RpcDebugLibData *(* RpcDebugInitializeFn)(ToolsAppCtx *, gchar *);
154 
155 
156 G_BEGIN_DECLS
157 
158 void
160 
161 void
162 RpcDebug_IncRef(void);
163 
166  gchar *dbgPlugin);
167 
168 gboolean
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 
struct RpcDebugMsgList RpcDebugMsgList
RpcDebugLibData * RpcDebug_Initialize(ToolsAppCtx *ctx, gchar *dbgPlugin)
Definition: vmrpcdbg.c:190
void RpcDebug_SetResult(const char *str, char **res, size_t *len)
Definition: vmrpcdbg.c:256
gboolean(* RpcDebugRecvFn)(char *data, size_t dataLen, char **result, size_t *resultLen)
Definition: rpcdebug.h:53
gboolean(* RpcDebugSendFn)(RpcDebugMsgMapping *rpcdata)
Definition: rpcdebug.h:102
void RpcDebug_IncRef(void)
Definition: vmrpcdbg.c:173
G_BEGIN_DECLS void RpcDebug_DecRef(ToolsAppCtx *ctx)
Definition: vmrpcdbg.c:159
struct RpcDebugRecvMapping RpcDebugRecvMapping
gboolean(* RpcDebugValidateFn)(RpcInData *data, gboolean ret)
Definition: rpcdebug.h:77
struct RpcDebugMsgMapping RpcDebugMsgMapping
gboolean RpcDebug_SendNext(RpcDebugMsgMapping *rpcdata, RpcDebugMsgList *list)
Definition: vmrpcdbg.c:232
struct RpcDebugPlugin RpcDebugPlugin
void(* RpcDebugShutdownFn)(ToolsAppCtx *ctx, struct RpcDebugPlugin *plugin)
Definition: rpcdebug.h:105
struct RpcDebugLibData RpcDebugLibData
Definition: rpcdebug.h:142
Definition: rpcdebug.h:89
Definition: rpcdebug.h:81
Definition: rpcdebug.h:112
ToolsPluginData * plugin
Definition: rpcdebug.h:125
RpcDebugShutdownFn shutdownFn
Definition: rpcdebug.h:123
RpcDebugRecvFn dfltRecvFn
Definition: rpcdebug.h:119
RpcDebugRecvMapping * recvFns
Definition: rpcdebug.h:114
RpcDebugSendFn sendFn
Definition: rpcdebug.h:121
Definition: rpcdebug.h:59
gpointer xdrProc
Definition: rpcdebug.h:66
size_t xdrSize
Definition: rpcdebug.h:68
Definition: guestrpc.h:67
Definition: plugin.h:294
Definition: plugin.h:561