20#ifndef _VMWARE_TOOLS_GDP_H_
21#define _VMWARE_TOOLS_GDP_H_
37#include <glib-object.h>
47#define GDP_PROTOCOL_VERSION 2
52#define GDP_PROTOCOL_UNVERSIONED_VERSION 1
57#define GDP_PROTOCOL_VERSIONED_VERSION 2
62#define GDP_PROTOCOL_DM_MAX_VERSION GDP_PROTOCOL_VERSION
67#define GDP_PROTOCOL_DM_RESP_MAX_VERSION GDP_PROTOCOL_VERSION
74#define GDP_MAX_PACKET_LEN (17 * 4096 - 24)
82#define GDP_USER_DATA_LEN (12 * 4096)
88#define TOOLS_PLUGIN_SVC_PROP_GDP "tps_prop_gdp"
100 GDP_ERR_ITEM(GDP_ERROR_SUCCESS = 0, \
103 GDP_ERR_ITEM(GDP_ERROR_INVALID_DATA, \
106 GDP_ERR_ITEM(GDP_ERROR_DATA_SIZE, \
108 "Data size too large") \
109 GDP_ERR_ITEM(GDP_ERROR_GENERAL, \
112 GDP_ERR_ITEM(GDP_ERROR_STOP, \
113 "stopped-for-shutdown", \
114 "Stopped for vmtoolsd shutdown") \
115 GDP_ERR_ITEM(GDP_ERROR_UNREACH, \
116 "publisher-unreachable", \
117 "Host daemon unreachable") \
118 GDP_ERR_ITEM(GDP_ERROR_TIMEOUT, \
120 "Operation timed out") \
121 GDP_ERR_ITEM(GDP_ERROR_NO_SUBSCRIBERS, \
123 "No subscribers for data") \
124 GDP_ERR_ITEM(GDP_ERR_MAX, \
131#define GDP_ERR_ITEM(a, b, c) a,
132typedef enum GdpError {
145 GdpError (*publish)(gint64 createTime,
148 const gchar *category,
152 gboolean requireSubs);
184static inline GdpError
189 const gchar *category,
193 gboolean requireSubs)
196 g_object_get(ctx->
serviceObj, TOOLS_PLUGIN_SVC_PROP_GDP, &svcGdp, NULL);
197 if (svcGdp != NULL && svcGdp->publish != NULL) {
198 return svcGdp->publish(createTime, topic, token,
199 category, data, dataLen, cacheData, requireSubs);
201 return GDP_ERROR_GENERAL;
struct ToolsPluginSvcGdp ToolsPluginSvcGdp
Type of the public interface of the gdp plugin service.