rpcdebug.h
Go to the documentation of this file.
/*********************************************************
* Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation version 2.1 and no later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*********************************************************/
#ifndef _VMWARE_TOOLS_RPCDEBUG_H_
#define _VMWARE_TOOLS_RPCDEBUG_H_
#include "vmware/tools/plugin.h"
#define RPCDEBUG_ASSERT(test, retval) do { \
CU_ASSERT(test); \
g_return_val_if_fail(test, retval); \
} while (0)
struct RpcDebugPlugin;
typedef gboolean (*RpcDebugRecvFn)(char *data,
size_t dataLen,
char **result,
size_t *resultLen);
typedef struct RpcDebugRecvMapping {
gchar *name;
RpcDebugRecvFn recvFn;
gpointer xdrProc;
size_t xdrSize;
} RpcDebugRecvMapping;
typedef gboolean (*RpcDebugValidateFn)(RpcInData *data,
gboolean ret);
typedef struct RpcDebugMsgMapping {
gchar *message;
size_t messageLen;
RpcDebugValidateFn validateFn;
gboolean freeMsg;
} RpcDebugMsgMapping;
typedef struct RpcDebugMsgList {
RpcDebugMsgMapping *mappings;
size_t index;
} RpcDebugMsgList;
typedef gboolean (*RpcDebugSendFn)(RpcDebugMsgMapping *rpcdata);
typedef void (*RpcDebugShutdownFn)(ToolsAppCtx *ctx,
struct RpcDebugPlugin *plugin);
typedef struct RpcDebugPlugin {
RpcDebugRecvMapping *recvFns;
RpcDebugRecvFn dfltRecvFn;
RpcDebugSendFn sendFn;
RpcDebugShutdownFn shutdownFn;
ToolsPluginData *plugin;
} RpcDebugPlugin;
typedef RpcDebugPlugin *(*RpcDebugOnLoadFn)(ToolsAppCtx *ctx);
struct RpcDebugLibData;
typedef struct RpcDebugLibData {
RpcChannel * (*newDebugChannel) (ToolsAppCtx *,
struct RpcDebugLibData *);
int (*run) (ToolsAppCtx *,
gpointer runMainLoop,
gpointer runData,
struct RpcDebugLibData *);
RpcDebugPlugin *debugPlugin;
} RpcDebugLibData;
typedef RpcDebugLibData *(* RpcDebugInitializeFn)(ToolsAppCtx *, gchar *);
G_BEGIN_DECLS
void
RpcDebug_DecRef(ToolsAppCtx *ctx);
void
RpcDebug_IncRef(void);
RpcDebugLibData *
RpcDebug_Initialize(ToolsAppCtx *ctx,
gchar *dbgPlugin);
gboolean
RpcDebug_SendNext(RpcDebugMsgMapping *rpcdata,
RpcDebugMsgList *list);
void
RpcDebug_SetResult(const char *str,
char **res,
size_t *len);
G_END_DECLS
#endif /* _VMWARE_TOOLS_RPCDEBUG_H_ */
RpcDebug_SetResult
void RpcDebug_SetResult(const char *str, char **res, size_t *len)
Definition vmrpcdbg.c:256
RpcDebugRecvFn
gboolean(* RpcDebugRecvFn)(char *data, size_t dataLen, char **result, size_t *resultLen)
Definition rpcdebug.h:53
RpcDebugSendFn
gboolean(* RpcDebugSendFn)(RpcDebugMsgMapping *rpcdata)
Definition rpcdebug.h:102
RpcDebug_IncRef
void RpcDebug_IncRef(void)
Definition vmrpcdbg.c:173
RpcDebug_DecRef
G_BEGIN_DECLS void RpcDebug_DecRef(ToolsAppCtx *ctx)
Definition vmrpcdbg.c:159
RpcDebugValidateFn
gboolean(* RpcDebugValidateFn)(RpcInData *data, gboolean ret)
Definition rpcdebug.h:77
RpcDebug_SendNext
gboolean RpcDebug_SendNext(RpcDebugMsgMapping *rpcdata, RpcDebugMsgList *list)
Definition vmrpcdbg.c:232
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
plugin.h
RpcDebugLibData
Definition rpcdebug.h:142
RpcDebugMsgList
Definition rpcdebug.h:89
RpcDebugMsgMapping
Definition rpcdebug.h:81
RpcDebugPlugin
Definition rpcdebug.h:112
RpcDebugPlugin::plugin
ToolsPluginData * plugin
Definition rpcdebug.h:125
RpcDebugPlugin::shutdownFn
RpcDebugShutdownFn shutdownFn
Definition rpcdebug.h:123
RpcDebugPlugin::dfltRecvFn
RpcDebugRecvFn dfltRecvFn
Definition rpcdebug.h:119
RpcDebugPlugin::recvFns
RpcDebugRecvMapping * recvFns
Definition rpcdebug.h:114
RpcDebugPlugin::sendFn
RpcDebugSendFn sendFn
Definition rpcdebug.h:121
RpcDebugRecvMapping
Definition rpcdebug.h:59
RpcDebugRecvMapping::xdrProc
gpointer xdrProc
Definition rpcdebug.h:66
RpcDebugRecvMapping::xdrSize
size_t xdrSize
Definition rpcdebug.h:68
RpcInData
Definition guestrpc.h:67
ToolsAppCtx
Definition plugin.h:307
ToolsPluginData
Definition plugin.h:574