40 |
#include "crypto/md5.h" |
#include "crypto/md5.h" |
41 |
#endif |
#endif |
42 |
|
|
43 |
char title[32] = ""; |
char g_title[32] = ""; |
44 |
char g_username[16]; |
char g_username[16]; |
45 |
char hostname[16]; |
char hostname[16]; |
46 |
char keymapname[16]; |
char keymapname[16]; |
47 |
int keylayout = 0x409; /* Defaults to US keyboard layout */ |
int keylayout = 0x409; /* Defaults to US keyboard layout */ |
48 |
int width = 800; /* If width or height are reset to zero, the geometry will |
int g_width = 800; /* If width or height are reset to zero, the geometry will |
49 |
be fetched from _NET_WORKAREA */ |
be fetched from _NET_WORKAREA */ |
50 |
int height = 600; |
int g_height = 600; |
51 |
int tcp_port_rdp = TCP_PORT_RDP; |
int tcp_port_rdp = TCP_PORT_RDP; |
52 |
int g_server_bpp = 8; |
int g_server_bpp = 8; |
53 |
int win_button_size = 0; /* If zero, disable single app mode */ |
int g_win_button_size = 0; /* If zero, disable single app mode */ |
54 |
BOOL g_bitmap_compression = True; |
BOOL g_bitmap_compression = True; |
55 |
BOOL sendmotion = True; |
BOOL g_sendmotion = True; |
56 |
BOOL g_orders = True; |
BOOL g_orders = True; |
57 |
BOOL g_encryption = True; |
BOOL g_encryption = True; |
58 |
BOOL packet_encryption = True; |
BOOL packet_encryption = True; |
59 |
BOOL g_desktop_save = True; |
BOOL g_desktop_save = True; |
60 |
BOOL fullscreen = False; |
BOOL g_fullscreen = False; |
61 |
BOOL grab_keyboard = True; |
BOOL g_grab_keyboard = True; |
62 |
BOOL hide_decorations = False; |
BOOL g_hide_decorations = False; |
63 |
BOOL g_use_rdp5 = False; |
BOOL g_use_rdp5 = True; |
64 |
extern BOOL owncolmap; |
extern BOOL g_owncolmap; |
65 |
|
|
66 |
#ifdef RDP2VNC |
#ifdef RDP2VNC |
67 |
extern int rfb_port; |
extern int rfb_port; |
102 |
fprintf(stderr, " -T: window title\n"); |
fprintf(stderr, " -T: window title\n"); |
103 |
fprintf(stderr, " -D: hide window manager decorations\n"); |
fprintf(stderr, " -D: hide window manager decorations\n"); |
104 |
fprintf(stderr, " -a: server bpp\n"); |
fprintf(stderr, " -a: server bpp\n"); |
105 |
fprintf(stderr, " -5: Use RDP5 (EXPERIMENTAL!)\n"); |
fprintf(stderr, " -4: Use RDP version 4\n"); |
106 |
|
fprintf(stderr, " -5: Use RDP version 5 (default)\n"); |
107 |
} |
} |
108 |
|
|
109 |
static BOOL |
static BOOL |
252 |
case 'S': |
case 'S': |
253 |
if (!strcmp(optarg, "standard")) |
if (!strcmp(optarg, "standard")) |
254 |
{ |
{ |
255 |
win_button_size = 18; |
g_win_button_size = 18; |
256 |
break; |
break; |
257 |
} |
} |
258 |
|
|
259 |
win_button_size = strtol(optarg, &p, 10); |
g_win_button_size = strtol(optarg, &p, 10); |
260 |
|
|
261 |
if (*p) |
if (*p) |
262 |
{ |
{ |
297 |
case 'g': |
case 'g': |
298 |
if (!strcmp(optarg, "workarea")) |
if (!strcmp(optarg, "workarea")) |
299 |
{ |
{ |
300 |
width = height = 0; |
g_width = g_height = 0; |
301 |
break; |
break; |
302 |
} |
} |
303 |
|
|
304 |
width = strtol(optarg, &p, 10); |
g_width = strtol(optarg, &p, 10); |
305 |
if (*p == 'x') |
if (*p == 'x') |
306 |
height = strtol(p + 1, NULL, 10); |
g_height = strtol(p + 1, NULL, 10); |
307 |
|
|
308 |
if ((width == 0) || (height == 0)) |
if ((g_width == 0) || (g_height == 0)) |
309 |
{ |
{ |
310 |
error("invalid geometry\n"); |
error("invalid geometry\n"); |
311 |
return 1; |
return 1; |
313 |
break; |
break; |
314 |
|
|
315 |
case 'f': |
case 'f': |
316 |
fullscreen = True; |
g_fullscreen = True; |
317 |
break; |
break; |
318 |
|
|
319 |
case 'b': |
case 'b': |
327 |
packet_encryption = False; |
packet_encryption = False; |
328 |
break; |
break; |
329 |
case 'm': |
case 'm': |
330 |
sendmotion = False; |
g_sendmotion = False; |
331 |
break; |
break; |
332 |
|
|
333 |
case 'C': |
case 'C': |
334 |
owncolmap = True; |
g_owncolmap = True; |
335 |
break; |
break; |
336 |
|
|
337 |
case 'K': |
case 'K': |
338 |
grab_keyboard = False; |
g_grab_keyboard = False; |
339 |
break; |
break; |
340 |
|
|
341 |
case 'T': |
case 'T': |
342 |
STRNCPY(title, optarg, sizeof(title)); |
STRNCPY(g_title, optarg, sizeof(g_title)); |
343 |
break; |
break; |
344 |
|
|
345 |
case 'D': |
case 'D': |
346 |
hide_decorations = True; |
g_hide_decorations = True; |
347 |
break; |
break; |
348 |
|
|
349 |
case 'a': |
case 'a': |
356 |
} |
} |
357 |
break; |
break; |
358 |
|
|
359 |
|
case '4': |
360 |
|
g_use_rdp5 = False; |
361 |
|
break; |
362 |
|
|
363 |
case '5': |
case '5': |
364 |
g_use_rdp5 = True; |
g_use_rdp5 = True; |
365 |
break; |
break; |
366 |
|
|
367 |
case 'h': |
case 'h': |
368 |
case '?': |
case '?': |
369 |
default: |
default: |
411 |
if (prompt_password && read_password(password, sizeof(password))) |
if (prompt_password && read_password(password, sizeof(password))) |
412 |
flags |= RDP_LOGON_AUTO; |
flags |= RDP_LOGON_AUTO; |
413 |
|
|
414 |
if (title[0] == 0) |
if (g_title[0] == 0) |
415 |
{ |
{ |
416 |
strcpy(title, "rdesktop - "); |
strcpy(g_title, "rdesktop - "); |
417 |
strncat(title, server, sizeof(title) - sizeof("rdesktop - ")); |
strncat(g_title, server, sizeof(g_title) - sizeof("rdesktop - ")); |
418 |
} |
} |
419 |
|
|
420 |
#ifdef RDP2VNC |
#ifdef RDP2VNC |