* also removed and the HGFS server exit is called and this object is torn down.
*/
typedef struct HgfsChannelServerData {
- HgfsServerCallbacks *serverCBTable; /* HGFS server entry points. */
+ const HgfsServerCallbacks *serverCBTable; /* HGFS server entry points. */
Atomic_uint32 refCount; /* Server data reference count. */
} HgfsChannelServerData;
* for each client that it is returned to (a usage count).
*/
typedef struct HgfsChannelData {
- const char *name; /* Channel name. */
- HgfsGuestChannelCBTable *ops; /* Channel operations. */
- uint32 state; /* Channel state (see flags below). */
- struct HgfsGuestConn *connection; /* Opaque server connection */
- HgfsChannelServerData *serverInfo; /* HGFS server entry points. */
- Atomic_uint32 refCount; /* Channel reference count. */
+ const char *name; /* Channel name. */
+ const HgfsGuestChannelCBTable *ops; /* Channel operations. */
+ uint32 state; /* Channel state (see flags below). */
+ struct HgfsGuestConn *connection; /* Opaque server connection */
+ HgfsChannelServerData *serverInfo; /* HGFS server entry points. */
+ Atomic_uint32 refCount; /* Channel reference count. */
} HgfsChannelData;
#define HGFS_CHANNEL_STATE_INIT (1 << 0)
Debug("%s: Initialize Hgfs server.\n", __FUNCTION__);
/* If we have a new connection initialize the server session with default settings. */
- result = HgfsServer_InitState(&serverInfo->serverCBTable, &gHgfsGuestCfgSettings, mgrCb);
+ result = HgfsServer_InitState((HgfsServerCallbacks **)&serverInfo->serverCBTable,
+ &gHgfsGuestCfgSettings,
+ mgrCb);
if (!result) {
Debug("%s: Could not init Hgfs server.\n", __FUNCTION__);
}
typedef struct HgfsGuestConn {
Atomic_uint32 refCount; /* Reference count. */
HgfsGuestConnState state;
- HgfsServerSessionCallbacks *serverCbTable; /* Server session callbacks. */
+ const HgfsServerSessionCallbacks *serverCbTable; /* Server session callbacks. */
HgfsServerChannelCallbacks channelCbTable;
void *serverSession;
size_t packetOutLen;
/* Callback functions. */
-static Bool HgfsChannelGuestBdInit(HgfsServerSessionCallbacks *serverCBTable,
+static Bool HgfsChannelGuestBdInit(const HgfsServerSessionCallbacks *serverCBTable,
void *rpc,
void *rpcCallback,
HgfsGuestConn **connection);
size_t *packetOutSize);
static uint32 HgfsChannelGuestBdInvalidateInactiveSessions(HgfsGuestConn *data);
-HgfsGuestChannelCBTable gGuestBackdoorOps = {
+const HgfsGuestChannelCBTable gGuestBackdoorOps = {
HgfsChannelGuestBdInit,
HgfsChannelGuestBdExit,
HgfsChannelGuestBdReceive,
*/
static Bool
-HgfsChannelGuestConnInit(HgfsGuestConn **connData, // IN/OUT: channel object
- HgfsServerSessionCallbacks *serverCBTable) // IN: server callbacks
+HgfsChannelGuestConnInit(HgfsGuestConn **connData, // IN/OUT: channel object
+ const HgfsServerSessionCallbacks *serverCBTable) // IN: server callbacks
{
HgfsGuestConn *conn = NULL;
*/
static Bool
-HgfsChannelGuestBdInit(HgfsServerSessionCallbacks *serverCBTable, // IN: server callbacks
- void *rpc, // IN: Rpc channel unused
- void *rpcCallback, // IN: Rpc callback unused
- HgfsGuestConn **connection) // OUT: connection object
+HgfsChannelGuestBdInit(const HgfsServerSessionCallbacks *serverCBTable, // IN: server callbacks
+ void *rpc, // IN: Rpc channel unused
+ void *rpcCallback, // IN: Rpc callback unused
+ HgfsGuestConn **connection) // OUT: connection object
{
HgfsGuestConn *connData = NULL;
Bool result;
* Guest channel table of callbacks.
*/
typedef struct HgfsGuestChannelCBTable {
- Bool (*init)(HgfsServerSessionCallbacks *, void *, void *, struct HgfsGuestConn **);
+ Bool (*init)(const HgfsServerSessionCallbacks *, void *, void *, struct HgfsGuestConn **);
void (*exit)(struct HgfsGuestConn *);
Bool (*receive)(struct HgfsGuestConn *, char const *, size_t, char *, size_t *);
uint32 (*invalidateInactiveSessions)(struct HgfsGuestConn *);
} HgfsGuestChannelCBTable;
/* The guest channels callback tables. */
-extern HgfsGuestChannelCBTable gGuestBackdoorOps;
+extern const HgfsGuestChannelCBTable gGuestBackdoorOps;
/* For use by HgfsServerManager. */
Bool HgfsChannelGuest_Init(HgfsServerMgrData *data, HgfsServerMgrCallbacks *cb);