VirtualBox

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

Last change on this file was 98103, checked in by vboxsync, 17 months ago

Copyright year updates by scm.

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

© 2023 Oracle
ContactPrivacy policyTerms of Use