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