35 |
#include <sys/un.h> /* sockaddr_un */ |
#include <sys/un.h> /* sockaddr_un */ |
36 |
#endif |
#endif |
37 |
|
|
|
#ifdef WITH_OPENSSL |
|
38 |
#include <openssl/md5.h> |
#include <openssl/md5.h> |
|
#else |
|
|
#include "crypto/md5.h" |
|
|
#endif |
|
39 |
|
|
40 |
char g_title[64] = ""; |
char g_title[64] = ""; |
41 |
char g_username[64]; |
char g_username[64]; |
49 |
absolute value specifies the |
absolute value specifies the |
50 |
percent of the whole screen. */ |
percent of the whole screen. */ |
51 |
int g_height = 600; |
int g_height = 600; |
52 |
|
int g_xpos = 0; |
53 |
|
int g_ypos = 0; |
54 |
extern int g_tcp_port_rdp; |
extern int g_tcp_port_rdp; |
55 |
int g_server_bpp = 8; |
int g_server_bpp = 8; |
56 |
int g_win_button_size = 0; /* If zero, disable single app mode */ |
int g_win_button_size = 0; /* If zero, disable single app mode */ |
124 |
fprintf(stderr, " -N: enable numlock syncronization\n"); |
fprintf(stderr, " -N: enable numlock syncronization\n"); |
125 |
fprintf(stderr, " -X: embed into another window with a given id.\n"); |
fprintf(stderr, " -X: embed into another window with a given id.\n"); |
126 |
fprintf(stderr, " -a: connection colour depth\n"); |
fprintf(stderr, " -a: connection colour depth\n"); |
127 |
|
fprintf(stderr, " -z: enable rdp compression\n"); |
128 |
fprintf(stderr, " -x: RDP5 experience (m[odem 28.8], b[roadband], l[an] or hex nr.)\n"); |
fprintf(stderr, " -x: RDP5 experience (m[odem 28.8], b[roadband], l[an] or hex nr.)\n"); |
129 |
fprintf(stderr, " -P: use persistent bitmap caching\n"); |
fprintf(stderr, " -P: use persistent bitmap caching\n"); |
130 |
fprintf(stderr, " -r: enable specified device redirection (this flag can be repeated)\n"); |
fprintf(stderr, " -r: enable specified device redirection (this flag can be repeated)\n"); |
132 |
" '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n"); |
" '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n"); |
133 |
fprintf(stderr, " or COM1=/dev/ttyS0,COM2=/dev/ttyS1\n"); |
fprintf(stderr, " or COM1=/dev/ttyS0,COM2=/dev/ttyS1\n"); |
134 |
fprintf(stderr, |
fprintf(stderr, |
135 |
" '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n"); |
" '-r disk:floppy=/mnt/floppy': enable redirection of /mnt/floppy to 'floppy' share\n"); |
136 |
fprintf(stderr, " or A=/mnt/floppy,D=/mnt/cdrom'\n"); |
fprintf(stderr, " or 'floppy=/mnt/floppy,cdrom=/mnt/cdrom'\n"); |
137 |
fprintf(stderr, " '-r clientname=<client name>': Set the client name displayed\n"); |
fprintf(stderr, " '-r clientname=<client name>': Set the client name displayed\n"); |
138 |
fprintf(stderr, " for redirected disks\n"); |
fprintf(stderr, " for redirected disks\n"); |
139 |
fprintf(stderr, |
fprintf(stderr, |
366 |
#endif |
#endif |
367 |
|
|
368 |
while ((c = getopt(argc, argv, |
while ((c = getopt(argc, argv, |
369 |
VNCOPT "u:d:s:c:p:n:k:g:fbBeEmCDKS:T:NX:a:x:Pr:045h?")) != -1) |
VNCOPT "u:d:s:c:p:n:k:g:fbBeEmzCDKS:T:NX:a:x:Pr:045h?")) != -1) |
370 |
{ |
{ |
371 |
switch (c) |
switch (c) |
372 |
{ |
{ |
441 |
} |
} |
442 |
|
|
443 |
if (*p == 'x') |
if (*p == 'x') |
444 |
g_height = strtol(p + 1, NULL, 10); |
g_height = strtol(p + 1, &p, 10); |
445 |
|
|
446 |
if (g_height <= 0) |
if (g_height <= 0) |
447 |
{ |
{ |
450 |
} |
} |
451 |
|
|
452 |
if (*p == '%') |
if (*p == '%') |
453 |
|
{ |
454 |
g_width = -g_width; |
g_width = -g_width; |
455 |
|
p++; |
456 |
|
} |
457 |
|
|
458 |
|
if (*p == '+' || *p == '-') |
459 |
|
g_xpos = strtol(p, &p, 10); |
460 |
|
|
461 |
|
if (*p == '+' || *p == '-') |
462 |
|
g_ypos = strtol(p, NULL, 10); |
463 |
|
|
464 |
break; |
break; |
465 |
|
|
536 |
} |
} |
537 |
break; |
break; |
538 |
|
|
539 |
case 'x': |
case 'z': |
540 |
|
DEBUG(("rdp compression enabled\n")); |
541 |
|
flags |= RDP_COMPRESSION; |
542 |
|
break; |
543 |
|
|
544 |
|
case 'x': |
545 |
if (strncmp("modem", optarg, 1) == 0) |
if (strncmp("modem", optarg, 1) == 0) |
546 |
{ |
{ |
547 |
g_rdp5_performanceflags = |
g_rdp5_performanceflags = |
863 |
void * |
void * |
864 |
xrealloc(void *oldmem, int size) |
xrealloc(void *oldmem, int size) |
865 |
{ |
{ |
866 |
void *mem = realloc(oldmem, size); |
void *mem; |
867 |
|
|
868 |
|
if (size < 1) |
869 |
|
size = 1; |
870 |
|
mem = realloc(oldmem, size); |
871 |
if (mem == NULL) |
if (mem == NULL) |
872 |
{ |
{ |
873 |
error("xrealloc %d\n", size); |
error("xrealloc %d\n", size); |