2011-07-10 18:24:05 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol client.
|
|
|
|
* Debugging Virtual Channel
|
|
|
|
*
|
|
|
|
* Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
* Copyright 2011 Vic Lee
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <freerdp/constants.h>
|
2011-07-10 19:56:52 +04:00
|
|
|
#include <freerdp/types.h>
|
2011-07-10 18:24:05 +04:00
|
|
|
#include <freerdp/utils/memory.h>
|
|
|
|
#include <freerdp/utils/svc_plugin.h>
|
|
|
|
|
|
|
|
typedef struct rdpdbg_plugin rdpdbgPlugin;
|
|
|
|
struct rdpdbg_plugin
|
|
|
|
{
|
|
|
|
rdpSvcPlugin plugin;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void rdpdbg_process_connect(rdpSvcPlugin* plugin)
|
|
|
|
{
|
2011-07-13 10:04:42 +04:00
|
|
|
DEBUG_WARN("connecting");
|
2011-07-10 18:24:05 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rdpdbg_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
|
|
|
|
{
|
|
|
|
STREAM* data_out;
|
|
|
|
|
2011-07-13 10:04:42 +04:00
|
|
|
DEBUG_WARN("size %d", stream_get_size(data_in));
|
2011-07-10 18:24:05 +04:00
|
|
|
stream_free(data_in);
|
|
|
|
|
|
|
|
data_out = stream_new(8);
|
|
|
|
stream_write(data_out, "senddata", 8);
|
|
|
|
svc_plugin_send(plugin, data_out);
|
|
|
|
}
|
|
|
|
|
2011-08-18 01:28:26 +04:00
|
|
|
static void rdpdbg_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
|
2011-07-10 19:56:52 +04:00
|
|
|
{
|
2011-07-13 10:04:42 +04:00
|
|
|
DEBUG_WARN("event_type %d", event->event_type);
|
2011-07-11 08:04:13 +04:00
|
|
|
freerdp_event_free(event);
|
2011-07-11 08:21:55 +04:00
|
|
|
|
2011-08-18 01:28:26 +04:00
|
|
|
event = freerdp_event_new(RDP_EVENT_CLASS_DEBUG, 0, NULL, NULL);
|
2011-07-11 08:21:55 +04:00
|
|
|
svc_plugin_send_event(plugin, event);
|
2011-07-10 19:56:52 +04:00
|
|
|
}
|
|
|
|
|
2011-07-10 18:24:05 +04:00
|
|
|
static void rdpdbg_process_terminate(rdpSvcPlugin* plugin)
|
|
|
|
{
|
2011-07-13 10:04:42 +04:00
|
|
|
DEBUG_WARN("terminating");
|
2011-07-10 18:24:05 +04:00
|
|
|
xfree(plugin);
|
|
|
|
}
|
|
|
|
|
2011-07-15 19:39:38 +04:00
|
|
|
DEFINE_SVC_PLUGIN(rdpdbg, "rdpdbg",
|
|
|
|
CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP |
|
|
|
|
CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL)
|