5a9acd8a376f250802e466628fa8c9d76333a370
[freerdp-ubuntu-pcb-backport.git] / include / freerdp / settings.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * RDP Settings
4  *
5  * Copyright 2009-2011 Jay Sorg
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __RDP_SETTINGS_H
21 #define __RDP_SETTINGS_H
22
23 #include <freerdp/types.h>
24 #include <freerdp/utils/blob.h>
25 #include <freerdp/utils/unicode.h>
26
27 /* Performance Flags */
28 #define PERF_FLAG_NONE                          0x00000000
29 #define PERF_DISABLE_WALLPAPER                  0x00000001
30 #define PERF_DISABLE_FULLWINDOWDRAG             0x00000002
31 #define PERF_DISABLE_MENUANIMATIONS             0x00000004
32 #define PERF_DISABLE_THEMING                    0x00000008
33 #define PERF_DISABLE_CURSOR_SHADOW              0x00000020
34 #define PERF_DISABLE_CURSORSETTINGS             0x00000040
35 #define PERF_ENABLE_FONT_SMOOTHING              0x00000080
36 #define PERF_ENABLE_DESKTOP_COMPOSITION         0x00000100
37
38 /* Connection Types */
39 #define CONNECTION_TYPE_MODEM                   0x01
40 #define CONNECTION_TYPE_BROADBAND_LOW           0x02
41 #define CONNECTION_TYPE_SATELLITE               0x03
42 #define CONNECTION_TYPE_BROADBAND_HIGH          0x04
43 #define CONNECTION_TYPE_WAN                     0x05
44 #define CONNECTION_TYPE_LAN                     0x06
45
46 /* Encryption Methods */
47 #define ENCRYPTION_METHOD_NONE                  0x00000000
48 #define ENCRYPTION_METHOD_40BIT                 0x00000001
49 #define ENCRYPTION_METHOD_128BIT                0x00000002
50 #define ENCRYPTION_METHOD_56BIT                 0x00000008
51 #define ENCRYPTION_METHOD_FIPS                  0x00000010
52
53 /* Encryption Levels */
54 #define ENCRYPTION_LEVEL_NONE                   0x00000000
55 #define ENCRYPTION_LEVEL_LOW                    0x00000001
56 #define ENCRYPTION_LEVEL_CLIENT_COMPATIBLE      0x00000002
57 #define ENCRYPTION_LEVEL_HIGH                   0x00000003
58 #define ENCRYPTION_LEVEL_FIPS                   0x00000004
59
60 /* Auto Reconnect Version */
61 #define AUTO_RECONNECT_VERSION_1                0x00000001
62
63 /* Order Support */
64 #define NEG_DSTBLT_INDEX                        0x00
65 #define NEG_PATBLT_INDEX                        0x01
66 #define NEG_SCRBLT_INDEX                        0x02
67 #define NEG_MEMBLT_INDEX                        0x03
68 #define NEG_MEM3BLT_INDEX                       0x04
69 #define NEG_ATEXTOUT_INDEX                      0x05
70 #define NEG_AEXTTEXTOUT_INDEX                   0x06
71 #define NEG_DRAWNINEGRID_INDEX                  0x07
72 #define NEG_LINETO_INDEX                        0x08
73 #define NEG_MULTI_DRAWNINEGRID_INDEX            0x09
74 #define NEG_OPAQUE_RECT_INDEX                   0x0A
75 #define NEG_SAVEBITMAP_INDEX                    0x0B
76 #define NEG_WTEXTOUT_INDEX                      0x0C
77 #define NEG_MEMBLT_V2_INDEX                     0x0D
78 #define NEG_MEM3BLT_V2_INDEX                    0x0E
79 #define NEG_MULTIDSTBLT_INDEX                   0x0F
80 #define NEG_MULTIPATBLT_INDEX                   0x10
81 #define NEG_MULTISCRBLT_INDEX                   0x11
82 #define NEG_MULTIOPAQUERECT_INDEX               0x12
83 #define NEG_FAST_INDEX_INDEX                    0x13
84 #define NEG_POLYGON_SC_INDEX                    0x14
85 #define NEG_POLYGON_CB_INDEX                    0x15
86 #define NEG_POLYLINE_INDEX                      0x16
87 #define NEG_FAST_GLYPH_INDEX                    0x18
88 #define NEG_ELLIPSE_SC_INDEX                    0x19
89 #define NEG_ELLIPSE_CB_INDEX                    0x1A
90 #define NEG_GLYPH_INDEX_INDEX                   0x1B
91 #define NEG_GLYPH_WEXTTEXTOUT_INDEX             0x1C
92 #define NEG_GLYPH_WLONGTEXTOUT_INDEX            0x1D
93 #define NEG_GLYPH_WLONGEXTTEXTOUT_INDEX         0x1E
94
95 /* Glyph Support Level */
96 #define GLYPH_SUPPORT_NONE                      0x0000
97 #define GLYPH_SUPPORT_PARTIAL                   0x0001
98 #define GLYPH_SUPPORT_FULL                      0x0002
99 #define GLYPH_SUPPORT_ENCODE                    0x0003
100
101 /* SYSTEM_TIME */
102 typedef struct
103 {
104         uint16 wYear;
105         uint16 wMonth;
106         uint16 wDayOfWeek;
107         uint16 wDay;
108         uint16 wHour;
109         uint16 wMinute;
110         uint16 wSecond;
111         uint16 wMilliseconds;
112 } SYSTEM_TIME;
113
114 /* TIME_ZONE_INFORMATION */
115 struct _TIME_ZONE_INFO
116 {
117         uint32 bias;
118         char standardName[32];
119         SYSTEM_TIME standardDate;
120         uint32 standardBias;
121         char daylightName[32];
122         SYSTEM_TIME daylightDate;
123         uint32 daylightBias;
124 };
125 typedef struct _TIME_ZONE_INFO TIME_ZONE_INFO;
126
127 /* ARC_CS_PRIVATE_PACKET */
128 typedef struct
129 {
130         uint32 cbLen;
131         uint32 version;
132         uint32 logonId;
133         uint8 securityVerifier[16];
134 } ARC_CS_PRIVATE_PACKET;
135
136 /* ARC_SC_PRIVATE_PACKET */
137 typedef struct
138 {
139         uint32 cbLen;
140         uint32 version;
141         uint32 logonId;
142         uint8 arcRandomBits[16];
143 } ARC_SC_PRIVATE_PACKET;
144
145 /* Certificates */
146
147 typedef struct rdp_certificate rdpCertificate;
148 typedef struct rdp_key rdpKey;
149
150 struct rdp_CertBlob
151 {
152         uint32 length;
153         uint8* data;
154 };
155 typedef struct rdp_CertBlob rdpCertBlob;
156
157 struct rdp_X509CertChain
158 {
159         uint32 count;
160         rdpCertBlob* array;
161 };
162 typedef struct rdp_X509CertChain rdpX509CertChain;
163
164 struct rdp_CertInfo
165 {
166         rdpBlob modulus;
167         uint8 exponent[4];
168 };
169 typedef struct rdp_CertInfo rdpCertInfo;
170
171 struct rdp_certificate
172 {
173         rdpCertInfo cert_info;
174         rdpX509CertChain* x509_cert_chain;
175 };
176
177 /* Channels */
178
179 struct rdp_channel
180 {
181         char name[8]; /* ui sets */
182         int options; /* ui sets */
183         int channel_id; /* core sets */
184         boolean joined; /* client has joined the channel */
185         void* handle; /* just for ui */
186 };
187 typedef struct rdp_channel rdpChannel;
188
189 /* Extensions */
190
191 struct rdp_ext_set
192 {
193         char name[256]; /* plugin name or path */
194         void* data; /* plugin data */
195 };
196
197 /* Bitmap Cache */
198
199 struct _BITMAP_CACHE_CELL_INFO
200 {
201         uint16 numEntries;
202         uint16 maxSize;
203 };
204 typedef struct _BITMAP_CACHE_CELL_INFO BITMAP_CACHE_CELL_INFO;
205
206 struct _BITMAP_CACHE_V2_CELL_INFO
207 {
208         uint32 numEntries;
209         boolean persistent;
210 };
211 typedef struct _BITMAP_CACHE_V2_CELL_INFO BITMAP_CACHE_V2_CELL_INFO;
212
213 /* Glyph Cache */
214
215 struct _GLYPH_CACHE_DEFINITION
216 {
217         uint16 cacheEntries;
218         uint16 cacheMaximumCellSize;
219 };
220 typedef struct _GLYPH_CACHE_DEFINITION GLYPH_CACHE_DEFINITION;
221
222 /* Monitors */
223
224 struct rdp_monitor
225 {
226         int x;
227         int y;
228         int width;
229         int height;
230         int is_primary;
231 };
232
233 /* Settings */
234
235 struct rdp_settings
236 {
237         void* instance; /* 0 */
238         uint32 paddingA[16 - 1]; /* 1 */
239
240         /* Core Protocol Parameters */
241         uint32 width; /* 16 */
242         uint32 height; /* 17 */
243         uint32 rdp_version; /* 18 */
244         uint32 color_depth; /* 19 */
245         uint32 kbd_layout; /* 20 */
246         uint32 kbd_type; /* 21 */
247         uint32 kbd_subtype; /* 22 */
248         uint32 kbd_fn_keys; /* 23 */
249         uint32 client_build; /* 24 */
250         uint32 requested_protocols; /* 25 */
251         uint32 selected_protocol; /* 26 */
252         uint32 encryption_method; /* 27 */
253         uint32 encryption_level; /* 28 */
254         boolean authentication; /* 29 */
255         uint32 negotiationFlags; /* 30 */
256         uint32 paddingB[48 - 31]; /* 31 */
257
258         /* Connection Settings */
259         uint32 port; /* 48 */
260         boolean ipv6; /* 49 */
261         char* hostname; /* 50 */
262         char* username; /* 51 */
263         char* password; /* 52 */
264         char* domain; /* 53 */
265         char* shell; /* 54 */
266         char* directory; /* 55 */
267         char* ip_address; /* 56 */
268         char* client_dir; /* 57 */
269         boolean autologon; /* 58 */
270         boolean compression; /* 59 */
271         uint32 performance_flags; /* 60 */
272         rdpBlob* password_cookie; /* 61 */
273         uint32 paddingC[80 - 62]; /* 62 */
274
275         /* User Interface Parameters */
276         boolean sw_gdi; /* 80 */
277         boolean workarea; /* 81 */
278         boolean fullscreen; /* 82 */
279         boolean grab_keyboard; /* 83 */
280         boolean decorations; /* 84 */
281         uint32 percent_screen; /* 85 */
282         boolean mouse_motion; /* 86 */
283         char* window_title; /* 87 */
284         uint64 parent_window_xid; /* 88 */
285         uint32 paddingD[112 - 89]; /* 89 */
286
287         /* Internal Parameters */
288         char* home_path; /* 112 */
289         uint32 share_id; /* 113 */
290         uint32 pdu_source; /* 114 */
291         UNICONV* uniconv; /* 115 */
292         boolean server_mode; /* 116 */
293         char* config_path; /* 117 */
294         char* current_path; /* 118 */
295         char* development_path; /* 119 */
296         boolean development_mode; /* 120 */
297         uint32 paddingE[144 - 121]; /* 121 */
298
299         /* Security */
300         boolean encryption; /* 144 */
301         boolean tls_security; /* 145 */
302         boolean nla_security; /* 146 */
303         boolean rdp_security; /* 147 */
304         uint32 ntlm_version; /* 148 */
305         boolean secure_checksum; /* 149 */
306         uint32 paddingF[160 - 150]; /* 150 */
307
308         /* Session */
309         boolean console_audio; /* 160 */
310         boolean console_session; /* 161 */
311         uint32 redirected_session_id; /* 162 */
312         uint32 paddingG[176 - 163]; /* 163 */
313
314         /* Output Control */
315         boolean refresh_rect; /* 176 */
316         boolean suppress_output; /* 177 */
317         boolean desktop_resize; /* 178 */
318         uint32 paddingH[192 - 179]; /* 179 */
319
320         /* Reconnection */
321         boolean auto_reconnection; /* 192 */
322         ARC_CS_PRIVATE_PACKET* client_auto_reconnect_cookie; /* 193 */
323         ARC_SC_PRIVATE_PACKET* server_auto_reconnect_cookie; /* 194 */
324         uint32 paddingI[208 - 195]; /* 195 */
325
326         /* Time Zone */
327         TIME_ZONE_INFO* client_time_zone; /* 208 */
328         uint32 paddingJ[216 - 209]; /* 209 */
329
330         /* Capabilities */
331         uint32 os_major_type; /* 216 */
332         uint32 os_minor_type; /* 217 */
333         uint32 vc_chunk_size; /* 218 */
334         boolean sound_beeps; /* 219 */
335         boolean smooth_fonts; /* 220 */
336         boolean frame_marker; /* 221 */
337         boolean fastpath_input; /* 222 */
338         boolean fastpath_output; /* 223 */
339         uint8 received_caps[32]; /* 224 (8) */
340         uint8 order_support[32]; /* 232 (8) */
341         boolean surface_commands; /* 240 */
342         boolean disable_wallpaper; /* 241 */
343         boolean disable_full_window_drag; /* 242 */
344         boolean disable_menu_animations; /* 243 */
345         boolean disable_theming; /* 244 */
346         uint32 connection_type; /* 245 */
347         uint32 multifrag_max_request_size; /* 246 */
348         uint32 paddingK[248 - 247]; /* 247 */
349
350         /* Certificate */
351         char* cert_file; /* 248 */
352         char* privatekey_file; /* 249 */
353         char client_hostname[32]; /* 250 (8) */
354         char client_product_id[32]; /* 258 (8) */
355         rdpBlob* server_random; /* 266 */
356         rdpBlob* server_certificate; /* 267 */
357         boolean ignore_certificate; /* 268 */
358         rdpCertificate* server_cert; /* 269 */
359         char* rdp_key_file; /* 270 */
360         rdpKey* server_key; /* 271 */
361         char* certificate_name; /* 272 */
362         uint32 paddingL[280 - 273]; /* 273 */
363
364         /* Codecs */
365         boolean rfx_codec; /* 280 */
366         boolean ns_codec; /* 281 */
367         uint32 rfx_codec_id; /* 282 */
368         uint32 ns_codec_id; /* 283 */
369         uint32 rfx_codec_mode; /* 284 */
370         boolean frame_acknowledge; /* 285 */
371         uint32 paddingM[296 - 286]; /* 286 */
372
373         /* Recording */
374         boolean dump_rfx; /* 296 */
375         boolean play_rfx; /* 297 */
376         char* dump_rfx_file; /* 298 */
377         char* play_rfx_file; /* 299 */
378         uint32 paddingN[312 - 300]; /* 300 */
379
380         /* RemoteApp */
381         boolean remote_app; /* 312 */
382         uint32 num_icon_caches; /* 313 */
383         uint32 num_icon_cache_entries; /* 314 */
384         boolean rail_langbar_supported; /* 315 */
385         uint32 paddingO[320 - 316]; /* 316 */
386
387         /* Pointer */
388         boolean large_pointer; /* 320 */
389         boolean color_pointer; /* 321 */
390         uint32 pointer_cache_size; /* 322 */
391         uint32 paddingP[328 - 323]; /* 323 */
392
393         /* Bitmap Cache */
394         boolean bitmap_cache; /* 328 */
395         boolean bitmap_cache_v3; /* 329 */
396         boolean persistent_bitmap_cache; /* 330 */
397         uint32 bitmapCacheV2NumCells; /* 331 */
398         BITMAP_CACHE_V2_CELL_INFO* bitmapCacheV2CellInfo; /* 332 */
399         uint32 paddingQ[344 - 333]; /* 333 */
400
401         /* Offscreen Bitmap Cache */
402         boolean offscreen_bitmap_cache; /* 344 */
403         uint32 offscreen_bitmap_cache_size; /* 345 */
404         uint32 offscreen_bitmap_cache_entries; /* 346 */
405         uint32 paddingR[352 - 347]; /* 347 */
406
407         /* Glyph Cache */
408         boolean glyph_cache; /* 352 */
409         uint32 glyphSupportLevel; /* 353 */
410         GLYPH_CACHE_DEFINITION* glyphCache; /* 354 */
411         GLYPH_CACHE_DEFINITION* fragCache; /* 355 */
412         uint32 paddingS[360 - 356]; /* 356 */
413
414         /* Draw Nine Grid */
415         boolean draw_nine_grid; /* 360 */
416         uint32 draw_nine_grid_cache_size; /* 361 */
417         uint32 draw_nine_grid_cache_entries; /* 362 */
418         uint32 paddingT[368 - 363]; /* 363 */
419
420         /* Draw GDI+ */
421         boolean draw_gdi_plus; /* 368 */
422         boolean draw_gdi_plus_cache; /* 369 */
423         uint32 paddingU[376 - 370]; /* 370 */
424
425         /* Desktop Composition */
426         boolean desktop_composition; /* 376 */
427         uint32 paddingV[384 - 377]; /* 377 */
428
429         /* Channels */
430         int num_channels;
431         rdpChannel channels[16];
432
433         /* Monitors */
434         int num_monitors;
435         struct rdp_monitor monitors[16];
436
437         /* Extensions */
438         int num_extensions;
439         struct rdp_ext_set extensions[16];
440 };
441 typedef struct rdp_settings rdpSettings;
442
443 rdpSettings* settings_new(void* instance);
444 void settings_free(rdpSettings* settings);
445
446 #endif /* __RDP_SETTINGS_H */