22 #ifndef FREERDP_SERVER_PROXY_PFCONTEXT_H
23 #define FREERDP_SERVER_PROXY_PFCONTEXT_H
25 #include <freerdp/api.h>
26 #include <freerdp/types.h>
28 #include <freerdp/freerdp.h>
29 #include <freerdp/channels/wtsvc.h>
31 #include <freerdp/server/proxy/proxy_config.h>
32 #include <freerdp/server/proxy/proxy_types.h>
34 #define PROXY_SESSION_ID_LENGTH 32
42 typedef struct proxy_module proxyModule;
45 typedef struct s_InterceptContextMapEntry
47 void (*free)(
struct s_InterceptContextMapEntry*);
52 FREERDP_API
void intercept_context_entry_free(
void* obj);
53 typedef PfChannelResult (*proxyChannelDataFn)(proxyData* pdata,
54 const pServerStaticChannelContext* channel,
55 const BYTE* xdata,
size_t xsize, UINT32 flags,
56 size_t totalSizepServer);
57 typedef void (*proxyChannelContextDtor)(
void* context);
63 UINT32 front_channel_id;
64 UINT32 back_channel_id;
65 pf_utils_channel_mode channelMode;
66 proxyChannelDataFn onFrontData;
67 proxyChannelDataFn onBackData;
68 proxyChannelContextDtor contextDtor;
72 void StaticChannelContext_free(pServerStaticChannelContext* ctx);
86 wHashTable* interceptContextMap;
87 wHashTable* channelsByFrontId;
88 wHashTable* channelsByBackId;
92 WINPR_ATTR_MALLOC(StaticChannelContext_free, 1)
93 pServerStaticChannelContext* StaticChannelContext_new(pServerContext* ps, const
char* name,
116 BOOL allow_next_conn_failure;
120 pReceiveChannelData client_receive_channel_data_original;
121 wQueue* cached_server_channel_data;
125 char* remote_hostname;
130 BOOL input_state_sync_pending;
133 wHashTable* interceptContextMap;
134 UINT32 computerNameLen;
135 BOOL computerNameUnicode;
150 const proxyConfig* config;
156 HANDLE client_thread;
157 HANDLE gfx_server_ready;
159 char session_id[PROXY_SESSION_ID_LENGTH + 1];
162 wHashTable* modules_info;
163 psPeerReceiveChannelData server_receive_channel_data_original;
166 FREERDP_API BOOL pf_context_copy_settings(rdpSettings* dst,
const rdpSettings* src);
167 FREERDP_API BOOL pf_context_init_server_context(freerdp_peer* client);
169 WINPR_ATTR_MALLOC(freerdp_client_context_free, 1)
170 FREERDP_API pClientContext* pf_context_create_client_context(const rdpSettings* clientSettings);
172 FREERDP_API
void proxy_data_free(proxyData* pdata);
174 WINPR_ATTR_MALLOC(proxy_data_free, 1)
175 FREERDP_API proxyData* proxy_data_new(
void);
176 FREERDP_API
void proxy_data_set_client_context(proxyData* pdata, pClientContext* context);
177 FREERDP_API
void proxy_data_set_server_context(proxyData* pdata, pServerContext* context);
179 FREERDP_API BOOL proxy_data_shall_disconnect(proxyData* pdata);
180 FREERDP_API
void proxy_data_abort_connect(proxyData* pdata);
per channel configuration