2
* FreeRDP: A Remote Desktop Protocol client.
3
* Debugging Virtual Channel
5
* Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6
* Copyright 2011 Vic Lee
8
* Licensed under the Apache License, Version 2.0 (the "License");
9
* you may not use this file except in compliance with the License.
10
* You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing, software
15
* distributed under the License is distributed on an "AS IS" BASIS,
16
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
* See the License for the specific language governing permissions and
18
* limitations under the License.
24
#include <freerdp/constants.h>
25
#include <freerdp/types.h>
26
#include <freerdp/utils/memory.h>
27
#include <freerdp/utils/svc_plugin.h>
29
typedef struct rdpdbg_plugin rdpdbgPlugin;
35
static void rdpdbg_process_connect(rdpSvcPlugin* plugin)
37
DEBUG_WARN("connecting");
40
static void rdpdbg_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
44
DEBUG_WARN("size %d", stream_get_size(data_in));
47
data_out = stream_new(8);
48
stream_write(data_out, "senddata", 8);
49
svc_plugin_send(plugin, data_out);
52
static void rdpdbg_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
54
DEBUG_WARN("event_type %d", event->event_type);
55
freerdp_event_free(event);
57
event = freerdp_event_new(RDP_EVENT_CLASS_DEBUG, 0, NULL, NULL);
58
svc_plugin_send_event(plugin, event);
61
static void rdpdbg_process_terminate(rdpSvcPlugin* plugin)
63
DEBUG_WARN("terminating");
67
DEFINE_SVC_PLUGIN(rdpdbg, "rdpdbg",
68
CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP |
69
CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL)