additional RDP parameters
This commit is contained in:
parent
6fe448edf8
commit
a647eca634
51
protocols/rdp/src/client.c
Normal file → Executable file
51
protocols/rdp/src/client.c
Normal file → Executable file
@ -69,9 +69,26 @@
|
||||
const char* GUAC_CLIENT_ARGS[] = {
|
||||
"hostname",
|
||||
"port",
|
||||
"username",
|
||||
"password",
|
||||
"width",
|
||||
"height",
|
||||
"initial_program",
|
||||
"color_depth",
|
||||
NULL
|
||||
};
|
||||
|
||||
enum ARGS_IDX {
|
||||
IDX_HOSTNAME,
|
||||
IDX_PORT,
|
||||
IDX_USERNAME,
|
||||
IDX_PASSWORD,
|
||||
IDX_WIDTH,
|
||||
IDX_HEIGHT,
|
||||
IDX_INITIAL_PROGRAM,
|
||||
IDX_COLOR_DEPTH
|
||||
};
|
||||
|
||||
boolean rdp_freerdp_pre_connect(freerdp* instance) {
|
||||
|
||||
rdpContext* context = instance->context;
|
||||
@ -197,17 +214,17 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
|
||||
int port = RDP_DEFAULT_PORT;
|
||||
boolean bitmap_cache;
|
||||
|
||||
if (argc < 2) {
|
||||
if (argc < 8) {
|
||||
guac_protocol_send_error(client->socket, "Wrong argument count received.");
|
||||
guac_socket_flush(client->socket);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If port specified, use it */
|
||||
if (argv[1][0] != '\0')
|
||||
port = atoi(argv[1]);
|
||||
if (argv[IDX_PORT][0] != '\0')
|
||||
port = atoi(argv[IDX_PORT]);
|
||||
|
||||
hostname = argv[0];
|
||||
hostname = argv[IDX_HOSTNAME];
|
||||
|
||||
/* Allocate client data */
|
||||
guac_client_data = malloc(sizeof(rdp_guac_client_data));
|
||||
@ -238,14 +255,38 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
|
||||
settings->encryption_method = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS;
|
||||
settings->encryption_level = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
|
||||
|
||||
/* Default size */
|
||||
/* session width */
|
||||
settings->width = 1024;
|
||||
if (argv[IDX_WIDTH][0] != '\0')
|
||||
settings->width = atoi(argv[IDX_WIDTH]);
|
||||
if (settings->width == 0)
|
||||
settings->width = 1024;
|
||||
|
||||
/* session height */
|
||||
settings->height = 768;
|
||||
if (argv[IDX_HEIGHT][0] != '\0')
|
||||
settings->height = atoi(argv[IDX_HEIGHT]);
|
||||
if (settings->height == 0)
|
||||
settings->height = 768;
|
||||
|
||||
/* Set hostname */
|
||||
settings->hostname = strdup(hostname);
|
||||
settings->window_title = strdup(hostname);
|
||||
|
||||
/* username */
|
||||
settings->username = "guest";
|
||||
if (argv[IDX_USERNAME][0] != '\0')
|
||||
settings->username = strdup (argv[IDX_USERNAME]);
|
||||
|
||||
/* password */
|
||||
if (argv[IDX_PASSWORD][0] != '\0') {
|
||||
settings->password = strdup (argv[IDX_PASSWORD]);
|
||||
settings->autologon = 1;
|
||||
}
|
||||
|
||||
/* initial program */
|
||||
if (argv[IDX_INITIAL_PROGRAM][0] != '\0')
|
||||
settings->shell = strdup (argv[IDX_INITIAL_PROGRAM]);
|
||||
|
||||
/* Order support */
|
||||
bitmap_cache = settings->bitmap_cache;
|
||||
|
Loading…
Reference in New Issue
Block a user