VirtualBox

source: vbox/trunk/src/VBox/HostServices/HostChannel/HostChannel.h@ 74910

Last change on this file since 74910 was 69500, checked in by vboxsync, 7 years ago

*: scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1/* @file
2 *
3 * Host Channel
4 */
5
6/*
7 * Copyright (C) 2012-2017 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef __VBOXHOSTCHANNEL__H
19#define __VBOXHOSTCHANNEL__H
20
21#include <iprt/list.h>
22
23#define LOG_GROUP LOG_GROUP_HGCM
24#include <VBox/log.h>
25#include <VBox/HostServices/VBoxHostChannel.h>
26
27#define HOSTCHLOG Log
28
29#ifdef DEBUG_sunlover
30# undef HOSTCHLOG
31# define HOSTCHLOG LogRel
32#endif /* DEBUG_sunlover */
33
34struct VBOXHOSTCHCTX;
35typedef struct VBOXHOSTCHCTX VBOXHOSTCHCTX;
36
37typedef struct VBOXHOSTCHCLIENT
38{
39 RTLISTNODE nodeClient;
40
41 VBOXHOSTCHCTX *pCtx;
42
43 uint32_t u32ClientID;
44
45 RTLISTANCHOR listChannels;
46 uint32_t volatile u32HandleSrc;
47
48 RTLISTANCHOR listContexts; /* Callback contexts. */
49
50 RTLISTANCHOR listEvents;
51
52 bool fAsync; /* Guest is waiting for a message. */
53
54 struct {
55 VBOXHGCMCALLHANDLE callHandle;
56 VBOXHGCMSVCPARM *paParms;
57 } async;
58
59} VBOXHOSTCHCLIENT;
60
61
62/*
63 * The service functions. Locking is between the service thread and the host channel provider thread.
64 */
65int vboxHostChannelLock(void);
66void vboxHostChannelUnlock(void);
67
68int vboxHostChannelInit(void);
69void vboxHostChannelDestroy(void);
70
71int vboxHostChannelClientConnect(VBOXHOSTCHCLIENT *pClient);
72void vboxHostChannelClientDisconnect(VBOXHOSTCHCLIENT *pClient);
73
74int vboxHostChannelAttach(VBOXHOSTCHCLIENT *pClient,
75 uint32_t *pu32Handle,
76 const char *pszName,
77 uint32_t u32Flags);
78int vboxHostChannelDetach(VBOXHOSTCHCLIENT *pClient,
79 uint32_t u32Handle);
80
81int vboxHostChannelSend(VBOXHOSTCHCLIENT *pClient,
82 uint32_t u32Handle,
83 const void *pvData,
84 uint32_t cbData);
85int vboxHostChannelRecv(VBOXHOSTCHCLIENT *pClient,
86 uint32_t u32Handle,
87 void *pvData,
88 uint32_t cbData,
89 uint32_t *pu32DataReceived,
90 uint32_t *pu32DataRemaining);
91int vboxHostChannelControl(VBOXHOSTCHCLIENT *pClient,
92 uint32_t u32Handle,
93 uint32_t u32Code,
94 void *pvParm,
95 uint32_t cbParm,
96 void *pvData,
97 uint32_t cbData,
98 uint32_t *pu32SizeDataReturned);
99
100int vboxHostChannelEventWait(VBOXHOSTCHCLIENT *pClient,
101 bool *pfEvent,
102 VBOXHGCMCALLHANDLE callHandle,
103 VBOXHGCMSVCPARM *paParms);
104
105int vboxHostChannelEventCancel(VBOXHOSTCHCLIENT *pClient);
106
107int vboxHostChannelQuery(VBOXHOSTCHCLIENT *pClient,
108 const char *pszName,
109 uint32_t u32Code,
110 void *pvParm,
111 uint32_t cbParm,
112 void *pvData,
113 uint32_t cbData,
114 uint32_t *pu32SizeDataReturned);
115
116int vboxHostChannelRegister(const char *pszName,
117 const VBOXHOSTCHANNELINTERFACE *pInterface,
118 uint32_t cbInterface);
119int vboxHostChannelUnregister(const char *pszName);
120
121
122void vboxHostChannelEventParmsSet(VBOXHGCMSVCPARM *paParms,
123 uint32_t u32ChannelHandle,
124 uint32_t u32Id,
125 const void *pvEvent,
126 uint32_t cbEvent);
127
128void vboxHostChannelReportAsync(VBOXHOSTCHCLIENT *pClient,
129 uint32_t u32ChannelHandle,
130 uint32_t u32Id,
131 const void *pvEvent,
132 uint32_t cbEvent);
133
134#endif /* __VBOXHOSTCHANNEL__H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette