FreeRDP
Loading...
Searching...
No Matches
server_tunnel.h
1
17
18#ifndef FREERDP_LIB_CORE_SERVER_TUNNEL_H
19#define FREERDP_LIB_CORE_SERVER_TUNNEL_H
20
21#include <freerdp/config.h>
22#include <freerdp/api.h>
23
24#include "server.h"
25
29
32typedef BOOL (*wtsTunnelReadPduFn)(rdpPeerChannel* channel, wStream* s, UINT8 Cmd, UINT8 Sp,
33 UINT8 cbChId, BOOL fromTunnel);
34
35#if defined(WITH_RDPEUDP_SERVER)
36
37WINPR_ATTR_NODISCARD
38FREERDP_LOCAL BOOL wts_tunnel_new(WTSVirtualChannelManager* vcm, rdpContext* context,
39 wtsTunnelReadPduFn readPdu);
40
41FREERDP_LOCAL void wts_tunnel_free(WTSVirtualChannelManager* vcm);
42
44FREERDP_LOCAL void wts_tunnel_channel_opened(WTSVirtualChannelManager* vcm);
45
46WINPR_ATTR_NODISCARD
47FREERDP_LOCAL BOOL wts_tunnel_is_soft_sync_response(UINT8 Cmd);
48
49WINPR_ATTR_NODISCARD
50FREERDP_LOCAL BOOL wts_tunnel_read_soft_sync_response(WTSVirtualChannelManager* vcm, wStream* s);
51
55WINPR_ATTR_NODISCARD
56FREERDP_LOCAL BOOL wts_tunnel_start_soft_sync_if_due(WTSVirtualChannelManager* vcm);
57
61WINPR_ATTR_NODISCARD
62FREERDP_LOCAL BOOL wts_tunnel_send_message(WTSVirtualChannelManager* vcm, UINT32 id,
63 const BYTE* buffer, UINT32 length, BOOL* status);
64
67WINPR_ATTR_NODISCARD
68FREERDP_LOCAL BOOL wts_tunnel_after_drain(WTSVirtualChannelManager* vcm, BOOL status);
69
73WINPR_ATTR_NODISCARD
74FREERDP_LOCAL BOOL wts_tunnel_open_channel(WTSVirtualChannelManager* vcm, rdpPeerChannel* channel,
75 wStream* s, BOOL* onTunnel);
76
82WINPR_ATTR_NODISCARD
83FREERDP_LOCAL BOOL wts_tunnel_close_request(rdpPeerChannel* channel, const BYTE* data,
84 size_t length, BOOL* status);
85
89WINPR_ATTR_NODISCARD
90FREERDP_LOCAL BOOL wts_tunnel_queue_send_item(rdpPeerChannel* channel, BYTE* buffer, UINT32 length,
91 BOOL* status);
92
93#else
94
95WINPR_ATTR_NODISCARD
96static inline BOOL wts_tunnel_new(WINPR_ATTR_UNUSED WTSVirtualChannelManager* vcm,
97 WINPR_ATTR_UNUSED rdpContext* context,
98 WINPR_ATTR_UNUSED wtsTunnelReadPduFn readPdu)
99{
100 return TRUE;
101}
102
103static inline void wts_tunnel_free(WINPR_ATTR_UNUSED WTSVirtualChannelManager* vcm)
104{
105}
106
107static inline void wts_tunnel_channel_opened(WINPR_ATTR_UNUSED WTSVirtualChannelManager* vcm)
108{
109}
110
111WINPR_ATTR_NODISCARD
112static inline BOOL wts_tunnel_is_soft_sync_response(WINPR_ATTR_UNUSED UINT8 Cmd)
113{
114 return FALSE;
115}
116
117WINPR_ATTR_NODISCARD
118static inline BOOL
119wts_tunnel_read_soft_sync_response(WINPR_ATTR_UNUSED WTSVirtualChannelManager* vcm,
120 WINPR_ATTR_UNUSED wStream* s)
121{
122 return TRUE;
123}
124
125WINPR_ATTR_NODISCARD
126static inline BOOL
127wts_tunnel_start_soft_sync_if_due(WINPR_ATTR_UNUSED WTSVirtualChannelManager* vcm)
128{
129 return TRUE;
130}
131
132WINPR_ATTR_NODISCARD
133static inline BOOL wts_tunnel_send_message(WINPR_ATTR_UNUSED WTSVirtualChannelManager* vcm,
134 WINPR_ATTR_UNUSED UINT32 id,
135 WINPR_ATTR_UNUSED const BYTE* buffer,
136 WINPR_ATTR_UNUSED UINT32 length,
137 WINPR_ATTR_UNUSED BOOL* status)
138{
139 return FALSE;
140}
141
142WINPR_ATTR_NODISCARD
143static inline BOOL wts_tunnel_after_drain(WINPR_ATTR_UNUSED WTSVirtualChannelManager* vcm,
144 BOOL status)
145{
146 return status;
147}
148
149WINPR_ATTR_NODISCARD
150static inline BOOL wts_tunnel_open_channel(WINPR_ATTR_UNUSED WTSVirtualChannelManager* vcm,
151 WINPR_ATTR_UNUSED rdpPeerChannel* channel,
152 WINPR_ATTR_UNUSED wStream* s, BOOL* onTunnel)
153{
154 *onTunnel = FALSE;
155 return TRUE;
156}
157
158WINPR_ATTR_NODISCARD
159static inline BOOL wts_tunnel_close_request(WINPR_ATTR_UNUSED rdpPeerChannel* channel,
160 WINPR_ATTR_UNUSED const BYTE* data,
161 WINPR_ATTR_UNUSED size_t length,
162 WINPR_ATTR_UNUSED BOOL* status)
163{
164 return FALSE;
165}
166
167WINPR_ATTR_NODISCARD
168static inline BOOL wts_tunnel_queue_send_item(WINPR_ATTR_UNUSED rdpPeerChannel* channel,
169 WINPR_ATTR_UNUSED BYTE* buffer,
170 WINPR_ATTR_UNUSED UINT32 length,
171 WINPR_ATTR_UNUSED BOOL* status)
172{
173 return FALSE;
174}
175
176#endif
177
178#endif /* End of FREERDP_LIB_CORE_SERVER_TUNNEL_H */