19#ifndef _VMWARE_TOOLS_GDP_H_
20#define _VMWARE_TOOLS_GDP_H_
36#include <glib-object.h>
46#define GDP_PROTOCOL_VERSION 2
51#define GDP_PROTOCOL_UNVERSIONED_VERSION 1
56#define GDP_PROTOCOL_VERSIONED_VERSION 2
61#define GDP_PROTOCOL_DM_MAX_VERSION GDP_PROTOCOL_VERSION
66#define GDP_PROTOCOL_DM_RESP_MAX_VERSION GDP_PROTOCOL_VERSION
73#define GDP_MAX_PACKET_LEN (17 * 4096 - 24)
81#define GDP_USER_DATA_LEN (12 * 4096)
87#define TOOLS_PLUGIN_SVC_PROP_GDP "tps_prop_gdp"
97 GDP_ERR_ITEM(GDP_ERROR_SUCCESS = 0, \
100 GDP_ERR_ITEM(GDP_ERROR_INVALID_DATA, \
103 GDP_ERR_ITEM(GDP_ERROR_DATA_SIZE, \
105 "Data size too large") \
106 GDP_ERR_ITEM(GDP_ERROR_GENERAL, \
109 GDP_ERR_ITEM(GDP_ERROR_STOP, \
110 "stopped-for-shutdown", \
111 "Stopped for vmtoolsd shutdown") \
112 GDP_ERR_ITEM(GDP_ERROR_UNREACH, \
113 "publisher-unreachable", \
114 "Host daemon unreachable") \
115 GDP_ERR_ITEM(GDP_ERROR_TIMEOUT, \
117 "Operation timed out") \
118 GDP_ERR_ITEM(GDP_ERROR_NO_SUBSCRIBERS, \
120 "No subscribers for data")
125#define GDP_ERR_ITEM(a, b, c) a,
126typedef enum GdpError {
140 GdpError (*publish)(gint64 createTime,
143 const gchar *category,
147 gboolean requireSubs);
179static inline GdpError
184 const gchar *category,
188 gboolean requireSubs)
191 g_object_get(ctx->serviceObj, TOOLS_PLUGIN_SVC_PROP_GDP, &svcGdp, NULL);
192 if (svcGdp != NULL && svcGdp->publish != NULL) {
193 return svcGdp->publish(createTime, topic, token,
194 category, data, dataLen, cacheData, requireSubs);
196 return GDP_ERROR_GENERAL;