VirtualBox

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

Last change on this file since 78425 was 76570, checked in by vboxsync, 6 years ago

HostServices: Use VBOX_INCLUDED_SRC_ as header guard prefix with scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1/* @file
2 *
3 * Host Channel
4 */
5
6/*
7 * Copyright (C) 2012-2019 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 VBOX_INCLUDED_SRC_HostChannel_HostChannel_h
19#define VBOX_INCLUDED_SRC_HostChannel_HostChannel_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <iprt/list.h>
25
26#define LOG_GROUP LOG_GROUP_HGCM
27#include <VBox/log.h>
28#include <VBox/HostServices/VBoxHostChannel.h>
29
30#define HOSTCHLOG Log
31
32#ifdef DEBUG_sunlover
33# undef HOSTCHLOG
34# define HOSTCHLOG LogRel
35#endif /* DEBUG_sunlover */
36
37struct VBOXHOSTCHCTX;
38typedef struct VBOXHOSTCHCTX VBOXHOSTCHCTX;
39
40typedef struct VBOXHOSTCHCLIENT
41{
42 RTLISTNODE nodeClient;
43
44 VBOXHOSTCHCTX *pCtx;
45
46 uint32_t u32ClientID;
47
48 RTLISTANCHOR listChannels;
49 uint32_t volatile u32HandleSrc;
50
51 RTLISTANCHOR listContexts; /* Callback contexts. */
52
53 RTLISTANCHOR listEvents;
54
55 bool fAsync; /* Guest is waiting for a message. */
56
57 struct {
58 VBOXHGCMCALLHANDLE callHandle;
59 VBOXHGCMSVCPARM *paParms;
60 } async;
61
62} VBOXHOSTCHCLIENT;
63
64
65/*
66 * The service functions. Locking is between the service thread and the host channel provider thread.
67 */
68int vboxHostChannelLock(void);
69void vboxHostChannelUnlock(void);
70
71int vboxHostChannelInit(void);
72void vboxHostChannelDestroy(void);
73
74int vboxHostChannelClientConnect(VBOXHOSTCHCLIENT *pClient);
75void vboxHostChannelClientDisconnect(VBOXHOSTCHCLIENT *pClient);
76
77int vboxHostChannelAttach(VBOXHOSTCHCLIENT *pClient,
78 uint32_t *pu32Handle,
79 const char *pszName,
80 uint32_t u32Flags);
81int vboxHostChannelDetach(VBOXHOSTCHCLIENT *pClient,
82 uint32_t u32Handle);
83
84int vboxHostChannelSend(VBOXHOSTCHCLIENT *pClient,
85 uint32_t u32Handle,
86 const void *pvData,
87 uint32_t cbData);
88int vboxHostChannelRecv(VBOXHOSTCHCLIENT *pClient,
89 uint32_t u32Handle,
90 void *pvData,
91 uint32_t cbData,
92 uint32_t *pu32DataReceived,
93 uint32_t *pu32DataRemaining);
94int vboxHostChannelControl(VBOXHOSTCHCLIENT *pClient,
95 uint32_t u32Handle,
96 uint32_t u32Code,
97 void *pvParm,
98 uint32_t cbParm,
99 void *pvData,
100 uint32_t cbData,
101 uint32_t *pu32SizeDataReturned);
102
103int vboxHostChannelEventWait(VBOXHOSTCHCLIENT *pClient,
104 bool *pfEvent,
105 VBOXHGCMCALLHANDLE callHandle,
106 VBOXHGCMSVCPARM *paParms);
107
108int vboxHostChannelEventCancel(VBOXHOSTCHCLIENT *pClient);
109
110int vboxHostChannelQuery(VBOXHOSTCHCLIENT *pClient,
111 const char *pszName,
112 uint32_t u32Code,
113 void *pvParm,
114 uint32_t cbParm,
115 void *pvData,
116 uint32_t cbData,
117 uint32_t *pu32SizeDataReturned);
118
119int vboxHostChannelRegister(const char *pszName,
120 const VBOXHOSTCHANNELINTERFACE *pInterface,
121 uint32_t cbInterface);
122int vboxHostChannelUnregister(const char *pszName);
123
124
125void vboxHostChannelEventParmsSet(VBOXHGCMSVCPARM *paParms,
126 uint32_t u32ChannelHandle,
127 uint32_t u32Id,
128 const void *pvEvent,
129 uint32_t cbEvent);
130
131void vboxHostChannelReportAsync(VBOXHOSTCHCLIENT *pClient,
132 uint32_t u32ChannelHandle,
133 uint32_t u32Id,
134 const void *pvEvent,
135 uint32_t cbEvent);
136
137#endif /* !VBOX_INCLUDED_SRC_HostChannel_HostChannel_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