Added a number of command line options including autologon.

Inverted sense of -m (the default is now to send mouse move events).
Preparing for release of 1.0.0.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@20 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Matt Chapman 2000-10-16 08:44:48 +00:00
parent 71830eeb65
commit 6585bc027f
6 changed files with 47 additions and 9 deletions

View File

@ -207,3 +207,7 @@ enum RDP_INPUT_DEVICE
#define RDP_CAPLEN_UNKNOWN 0x9C
#define RDP_SOURCE "MSTSC"
/* Logon flags */
#define RDP_LOGON_NORMAL 0x33
#define RDP_LOGON_AUTO 0x8

View File

@ -46,7 +46,7 @@ void licence_process(STREAM s);
void rdp_out_unistr(STREAM s, char *string, int len);
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2);
void rdp_main_loop(void);
BOOL rdp_connect(char *server);
BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory);
void rdp_disconnect(void);
/* orders.c */

View File

@ -32,7 +32,7 @@ char hostname[16];
int width = 800;
int height = 600;
int keylayout = 0x409;
BOOL motion = False;
BOOL motion = True;
BOOL orders = True;
BOOL licence = True;
@ -41,12 +41,16 @@ static void usage(char *program)
{
STATUS("Usage: %s [options] server\n", program);
STATUS(" -u: user name\n");
STATUS(" -d: domain\n");
STATUS(" -s: shell\n");
STATUS(" -c: working directory\n");
STATUS(" -p: password (autologon)\n");
STATUS(" -n: client hostname\n");
STATUS(" -w: desktop width\n");
STATUS(" -h: desktop height\n");
STATUS(" -k: keyboard layout (hex)\n");
STATUS(" -m: send motion events\n");
STATUS(" -b: force bitmap updates\n");
STATUS(" -m: do not send motion events\n");
STATUS(" -l: do not request licence\n\n");
}
@ -55,6 +59,11 @@ int main(int argc, char *argv[])
{
struct passwd *pw;
char *server;
uint32 flags;
char domain[16];
char password[16];
char shell[32];
char directory[32];
char title[32];
int c;
@ -62,7 +71,10 @@ int main(int argc, char *argv[])
STATUS("Version "VERSION". Copyright (C) 1999-2000 Matt Chapman.\n");
STATUS("See http://www.rdesktop.org/ for more information.\n\n");
while ((c = getopt(argc, argv, "u:n:w:h:k:mbl?")) != -1)
flags = RDP_LOGON_NORMAL;
domain[0] = password[0] = shell[0] = directory[0] = 0;
while ((c = getopt(argc, argv, "u:d:s:c:p:n:w:h:k:bml?")) != -1)
{
switch (c)
{
@ -70,6 +82,23 @@ int main(int argc, char *argv[])
strncpy(username, optarg, sizeof(username));
break;
case 'd':
strncpy(domain, optarg, sizeof(domain));
break;
case 'p':
flags |= RDP_LOGON_AUTO;
strncpy(password, optarg, sizeof(password));
break;
case 's':
strncpy(shell, optarg, sizeof(shell));
break;
case 'c':
strncpy(directory, optarg, sizeof(directory));
break;
case 'n':
strncpy(hostname, optarg, sizeof(hostname));
break;
@ -87,7 +116,7 @@ int main(int argc, char *argv[])
break;
case 'm':
motion = True;
motion = False;
break;
case 'b':
@ -134,7 +163,7 @@ int main(int argc, char *argv[])
}
}
if (!rdp_connect(server))
if (!rdp_connect(server, flags, domain, password, shell, directory))
return 1;
STATUS("Connection successful.\n");

View File

@ -21,7 +21,7 @@
#include <stdio.h>
#include <string.h>
#define VERSION "0.9.0-alpha2"
#define VERSION "1.0.0"
#define STATUS(args...) fprintf(stderr, args);
#define ERROR(args...) fprintf(stderr, "ERROR: "args);

6
rdp.c
View File

@ -627,12 +627,14 @@ void rdp_main_loop()
}
/* Establish a connection up to the RDP layer */
BOOL rdp_connect(char *server)
BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password,
char *command, char *directory)
{
if (!sec_connect(server))
return False;
rdp_send_logon_info(0x33, "", username, "", "", "");
rdp_send_logon_info(flags, domain, username, password,
command, directory);
return True;
}

3
xwin.c
View File

@ -41,7 +41,10 @@ BOOL ui_create_window(char *title)
display = XOpenDisplay(NULL);
if (display == NULL)
{
ERROR("Failed to open display\n");
return False;
}
/* Check the screen supports 8-bit depth. */
screen = DefaultScreenOfDisplay(display);