Add RDPDR plugin stub. Add namespace to existing RDPSND filenames.

This commit is contained in:
Michael Jumper 2013-06-18 13:39:07 -07:00
parent b94b84956b
commit 6d9ff1e5ee
11 changed files with 317 additions and 22 deletions

View File

@ -40,7 +40,7 @@ ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = -Werror -Wall -Iinclude @LIBGUAC_INCLUDE@ AM_CFLAGS = -Werror -Wall -Iinclude @LIBGUAC_INCLUDE@
lib_LTLIBRARIES = libguac-client-rdp.la lib_LTLIBRARIES = libguac-client-rdp.la
freerdp_LTLIBRARIES = guac_rdpsnd.la freerdp_LTLIBRARIES = guac_rdpsnd.la guac_rdpdr.la
libguac_client_rdp_la_SOURCES = \ libguac_client_rdp_la_SOURCES = \
audio.c \ audio.c \
@ -61,13 +61,19 @@ libguac_client_rdp_la_SOURCES = \
wav_encoder.c wav_encoder.c
guac_rdpsnd_la_SOURCES = \ guac_rdpsnd_la_SOURCES = \
guac_rdpsnd/messages.c \ guac_rdpsnd/rdpsnd_messages.c \
guac_rdpsnd/service.c \ guac_rdpsnd/rdpsnd_service.c \
audio.c audio.c
guac_rdpdr_la_SOURCES = \
guac_rdpdr/rdpdr_messages.c \
guac_rdpdr/rdpdr_service.c
noinst_HEADERS = \ noinst_HEADERS = \
guac_rdpsnd/messages.h \ guac_rdpdr/rdpdr_messages.h \
guac_rdpsnd/service.h \ guac_rdpdr/rdpdr_service.h \
guac_rdpsnd/rdpsnd_messages.h \
guac_rdpsnd/rdpsnd_service.h \
audio.h \ audio.h \
client.h \ client.h \
config.h \ config.h \
@ -89,9 +95,11 @@ endif
libguac_client_rdp_la_LDFLAGS = -version-info 0:0:0 @RDP_LIBS@ @VORBIS_LIBS@ @PTHREAD_LIBS@ libguac_client_rdp_la_LDFLAGS = -version-info 0:0:0 @RDP_LIBS@ @VORBIS_LIBS@ @PTHREAD_LIBS@
guac_rdpsnd_la_LDFLAGS = -module -avoid-version -shared @RDP_LIBS@ @VORBIS_LIBS@ @PTHREAD_LIBS@ guac_rdpsnd_la_LDFLAGS = -module -avoid-version -shared @RDP_LIBS@ @VORBIS_LIBS@ @PTHREAD_LIBS@
guac_rdpdr_la_LDFLAGS = -module -avoid-version -shared @RDP_LIBS@ @PTHREAD_LIBS@
libguac_client_rdp_la_LIBADD = @LIBGUAC_LTLIB@ libguac_client_rdp_la_LIBADD = @LIBGUAC_LTLIB@
guac_rdpsnd_la_LIBADD = @LIBGUAC_LTLIB@ guac_rdpsnd_la_LIBADD = @LIBGUAC_LTLIB@
guac_rdpdr_la_LIBADD = @LIBGUAC_LTLIB@
freerdpdir = ${libdir}/freerdp freerdpdir = ${libdir}/freerdp

View File

@ -92,6 +92,7 @@ const char* GUAC_CLIENT_ARGS[] = {
"initial-program", "initial-program",
"color-depth", "color-depth",
"disable-audio", "disable-audio",
"disable-printing",
"console", "console",
"console-audio", "console-audio",
"server-layout", "server-layout",
@ -110,6 +111,7 @@ enum RDP_ARGS_IDX {
IDX_INITIAL_PROGRAM, IDX_INITIAL_PROGRAM,
IDX_COLOR_DEPTH, IDX_COLOR_DEPTH,
IDX_DISABLE_AUDIO, IDX_DISABLE_AUDIO,
IDX_DISABLE_PRINTING,
IDX_CONSOLE, IDX_CONSOLE,
IDX_CONSOLE_AUDIO, IDX_CONSOLE_AUDIO,
IDX_SERVER_LAYOUT, IDX_SERVER_LAYOUT,
@ -184,6 +186,17 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) {
} /* end if audio enabled */ } /* end if audio enabled */
/* If printing enabled, load rdpdr */
if (guac_client_data->printing_enabled) {
/* Load RDPDR plugin */
if (freerdp_channels_load_plugin(channels, instance->settings,
"guac_rdpdr", NULL))
guac_client_log_error(client,
"Failed to load guac_rdpdr plugin.");
} /* end if printing enabled */
/* Init color conversion structure */ /* Init color conversion structure */
clrconv = xnew(CLRCONV); clrconv = xnew(CLRCONV);
clrconv->alpha = 1; clrconv->alpha = 1;
@ -463,6 +476,10 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
guac_client_data->audio_enabled = guac_client_data->audio_enabled =
(strcmp(argv[IDX_DISABLE_AUDIO], "true") != 0); (strcmp(argv[IDX_DISABLE_AUDIO], "true") != 0);
/* Printing enable/disable */
guac_client_data->printing_enabled =
(strcmp(argv[IDX_DISABLE_PRINTING], "true") != 0);
/* Order support */ /* Order support */
bitmap_cache = settings->bitmap_cache; bitmap_cache = settings->bitmap_cache;
settings->os_major_type = OSMAJORTYPE_UNSPECIFIED; settings->os_major_type = OSMAJORTYPE_UNSPECIFIED;

View File

@ -176,6 +176,11 @@ typedef struct rdp_guac_client_data {
*/ */
int audio_enabled; int audio_enabled;
/**
* Whether printing is enabled.
*/
int printing_enabled;
/** /**
* Audio output, if any. * Audio output, if any.
*/ */

View File

@ -0,0 +1,54 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <freerdp/constants.h>
#include <freerdp/types.h>
#include <freerdp/utils/memory.h>
#include <freerdp/utils/stream.h>
#include <freerdp/utils/svc_plugin.h>
#include <guacamole/client.h>
#include "rdpdr_service.h"
#include "rdpdr_messages.h"
#include "client.h"
/* STUB - message handlers */

View File

@ -0,0 +1,44 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __GUAC_RDPDR_MESSAGES_H
#define __GUAC_RDPDR_MESSAGES_H
/* STUB */
#endif

View File

@ -0,0 +1,85 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdlib.h>
#include <string.h>
#include <freerdp/constants.h>
#include <freerdp/types.h>
#include <freerdp/utils/memory.h>
#include <freerdp/utils/stream.h>
#include <freerdp/utils/svc_plugin.h>
#include <guacamole/client.h>
#include "rdpdr_service.h"
#include "rdpdr_messages.h"
/* Define service, associate with "rdpdr" channel */
DEFINE_SVC_PLUGIN(guac_rdpdr, "rdpdr",
CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP)
/*
* Service Handlers
*/
void guac_rdpdr_process_connect(rdpSvcPlugin* plugin) {
/* STUB - init */
}
void guac_rdpdr_process_terminate(rdpSvcPlugin* plugin) {
xfree(plugin);
}
void guac_rdpdr_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event) {
freerdp_event_free(event);
}
void guac_rdpdr_process_receive(rdpSvcPlugin* plugin,
STREAM* input_stream) {
/*guac_rdpdrPlugin* rdpdr = (guac_rdpdrPlugin*) plugin;*/
/* STUB - read packet type, dispatch based on type */
}

View File

@ -0,0 +1,82 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __GUAC_RDPDR_SERVICE_H
#define __GUAC_RDPDR_SERVICE_H
/**
* Structure representing the current state of the Guacamole RDPDR plugin for
* FreeRDP.
*/
typedef struct guac_rdpdrPlugin {
/**
* The FreeRDP parts of this plugin. This absolutely MUST be first.
* FreeRDP depends on accessing this structure as if it were an instance
* of rdpSvcPlugin.
*/
rdpSvcPlugin plugin;
/* STUB */
} guac_rdpdrPlugin;
/**
* Handler called when this plugin is loaded by FreeRDP.
*/
void guac_rdpdr_process_connect(rdpSvcPlugin* plugin);
/**
* Handler called when this plugin receives data along its designated channel.
*/
void guac_rdpdr_process_receive(rdpSvcPlugin* plugin,
STREAM* input_stream);
/**
* Handler called when this plugin is being unloaded.
*/
void guac_rdpdr_process_terminate(rdpSvcPlugin* plugin);
/**
* Handler called when this plugin receives an event. For the sake of RDPDR,
* all events will be ignored and simply free'd.
*/
void guac_rdpdr_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event);
#endif

View File

@ -47,8 +47,8 @@
#include <guacamole/client.h> #include <guacamole/client.h>
#include "audio.h" #include "audio.h"
#include "service.h" #include "rdpsnd_service.h"
#include "messages.h" #include "rdpsnd_messages.h"
#include "client.h" #include "client.h"
/* MESSAGE HANDLERS */ /* MESSAGE HANDLERS */

View File

@ -47,8 +47,8 @@
#include <guacamole/client.h> #include <guacamole/client.h>
#include "audio.h" #include "audio.h"
#include "service.h" #include "rdpsnd_service.h"
#include "messages.h" #include "rdpsnd_messages.h"
/* Define service, associate with "rdpsnd" channel */ /* Define service, associate with "rdpsnd" channel */