1 | /* @file
|
---|
2 | * VBox Remote Desktop Extension (VRDE) - raw TSMF dynamic channel interface.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2012-2023 Oracle and/or its affiliates.
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox base platform packages, as
|
---|
9 | * available from https://www.virtualbox.org.
|
---|
10 | *
|
---|
11 | * This program is free software; you can redistribute it and/or
|
---|
12 | * modify it under the terms of the GNU General Public License
|
---|
13 | * as published by the Free Software Foundation, in version 3 of the
|
---|
14 | * License.
|
---|
15 | *
|
---|
16 | * This program is distributed in the hope that it will be useful, but
|
---|
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
19 | * General Public License for more details.
|
---|
20 | *
|
---|
21 | * You should have received a copy of the GNU General Public License
|
---|
22 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
23 | *
|
---|
24 | * The contents of this file may alternatively be used under the terms
|
---|
25 | * of the Common Development and Distribution License Version 1.0
|
---|
26 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
27 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
28 | * CDDL are applicable instead of those of the GPL.
|
---|
29 | *
|
---|
30 | * You may elect to license modified versions of this file under the
|
---|
31 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
32 | *
|
---|
33 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
34 | */
|
---|
35 |
|
---|
36 | #ifndef VBOX_INCLUDED_RemoteDesktop_VRDETSMF_h
|
---|
37 | #define VBOX_INCLUDED_RemoteDesktop_VRDETSMF_h
|
---|
38 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
39 | # pragma once
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | #include <VBox/RemoteDesktop/VRDE.h>
|
---|
43 |
|
---|
44 | /*
|
---|
45 | * Interface creating a TSMF dynamic channel instances and sending/receving data.
|
---|
46 | *
|
---|
47 | * Async callbacks are used for providing feedback, reporting errors, etc.
|
---|
48 | */
|
---|
49 |
|
---|
50 | #define VRDE_TSMF_INTERFACE_NAME "TSMFRAW"
|
---|
51 |
|
---|
52 | /* The VRDE server TSMF interface entry points. Interface version 1. */
|
---|
53 | typedef struct VRDETSMFINTERFACE
|
---|
54 | {
|
---|
55 | /* The header. */
|
---|
56 | VRDEINTERFACEHDR header;
|
---|
57 |
|
---|
58 | /* Create a new TSMF channel instance.
|
---|
59 | * The channel is created only for one client, which is connected to the server.
|
---|
60 | * The client is the first which supports dynamic RDP channels.
|
---|
61 | *
|
---|
62 | * If this method return success then the server will use the VRDE_TSMF_N_CREATE_*
|
---|
63 | * notification to report the channel handle.
|
---|
64 | *
|
---|
65 | * @param hServer The VRDE server instance.
|
---|
66 | * @param pvChannel A context to be associated with the channel.
|
---|
67 | * @param u32Flags VRDE_TSMF_F_*
|
---|
68 | *
|
---|
69 | * @return IPRT status code.
|
---|
70 | */
|
---|
71 | DECLR3CALLBACKMEMBER(int, VRDETSMFChannelCreate, (HVRDESERVER hServer,
|
---|
72 | void *pvChannel,
|
---|
73 | uint32_t u32Flags));
|
---|
74 |
|
---|
75 | /* Close a TSMF channel instance.
|
---|
76 | *
|
---|
77 | * @param hServer The VRDE server instance.
|
---|
78 | * @param u32ChannelHandle Which channel to close.
|
---|
79 | *
|
---|
80 | * @return IPRT status code.
|
---|
81 | */
|
---|
82 | DECLR3CALLBACKMEMBER(int, VRDETSMFChannelClose, (HVRDESERVER hServer,
|
---|
83 | uint32_t u32ChannelHandle));
|
---|
84 |
|
---|
85 | /* Send data to the TSMF channel instance.
|
---|
86 | *
|
---|
87 | * @param hServer The VRDE server instance.
|
---|
88 | * @param u32ChannelHandle Channel to send data.
|
---|
89 | * @param pvData Raw data to be sent, the format depends on which
|
---|
90 | * u32Flags were specified in Create: TSMF message,
|
---|
91 | * or channel header + TSMF message.
|
---|
92 | * @param cbData Size of data.
|
---|
93 | *
|
---|
94 | * @return IPRT status code.
|
---|
95 | */
|
---|
96 | DECLR3CALLBACKMEMBER(int, VRDETSMFChannelSend, (HVRDESERVER hServer,
|
---|
97 | uint32_t u32ChannelHandle,
|
---|
98 | const void *pvData,
|
---|
99 | uint32_t cbData));
|
---|
100 | } VRDETSMFINTERFACE;
|
---|
101 |
|
---|
102 | /* TSMF interface callbacks. */
|
---|
103 | typedef struct VRDETSMFCALLBACKS
|
---|
104 | {
|
---|
105 | /* The header. */
|
---|
106 | VRDEINTERFACEHDR header;
|
---|
107 |
|
---|
108 | /* Channel event notification.
|
---|
109 | *
|
---|
110 | * @param pvContext The callbacks context specified in VRDEGetInterface.
|
---|
111 | * @param u32Notification The kind of the notification: VRDE_TSMF_N_*.
|
---|
112 | * @param pvChannel A context which was used in VRDETSMFChannelCreate.
|
---|
113 | * @param pvParm The notification specific data.
|
---|
114 | * @param cbParm The size of buffer pointed by pvParm.
|
---|
115 | *
|
---|
116 | * @return IPRT status code.
|
---|
117 | */
|
---|
118 | DECLR3CALLBACKMEMBER(void, VRDETSMFCbNotify, (void *pvContext,
|
---|
119 | uint32_t u32Notification,
|
---|
120 | void *pvChannel,
|
---|
121 | const void *pvParm,
|
---|
122 | uint32_t cbParm));
|
---|
123 | } VRDETSMFCALLBACKS;
|
---|
124 |
|
---|
125 |
|
---|
126 | /* VRDETSMFChannelCreate::u32Flags */
|
---|
127 | #define VRDE_TSMF_F_CHANNEL_HEADER 0x00000001
|
---|
128 |
|
---|
129 |
|
---|
130 | /* VRDETSMFCbNotify::u32Notification */
|
---|
131 | #define VRDE_TSMF_N_CREATE_ACCEPTED 1
|
---|
132 | #define VRDE_TSMF_N_CREATE_DECLINED 2
|
---|
133 | #define VRDE_TSMF_N_DATA 3 /* Data received. */
|
---|
134 | #define VRDE_TSMF_N_DISCONNECTED 4 /* The channel is not connected anymore. */
|
---|
135 |
|
---|
136 |
|
---|
137 | /*
|
---|
138 | * Notification parameters.
|
---|
139 | */
|
---|
140 |
|
---|
141 | /* VRDE_TSMF_N_CREATE_ACCEPTED */
|
---|
142 | typedef struct VRDETSMFNOTIFYCREATEACCEPTED
|
---|
143 | {
|
---|
144 | uint32_t u32ChannelHandle;
|
---|
145 | } VRDETSMFNOTIFYCREATEACCEPTED;
|
---|
146 |
|
---|
147 | /* VRDE_TSMF_N_EVENT_DATA */
|
---|
148 | typedef struct VRDETSMFNOTIFYDATA
|
---|
149 | {
|
---|
150 | const void *pvData;
|
---|
151 | uint32_t cbData; /* How many bytes available. */
|
---|
152 | } VRDETSMFNOTIFYDATA;
|
---|
153 |
|
---|
154 | #endif /* !VBOX_INCLUDED_RemoteDesktop_VRDETSMF_h */
|
---|